Wavplot
wavplot is simple function to plot .wav file. Why I need it? because I continuously working with .wav file, and I want to plot it directly to get information of sound file via its waveform. Here the code of wavplot function.
function wavplot(wavFile)
% wavplot(wavFile) plot waveform and spectrum of wav file
% bagus@ep.its.ac.id
if nargin>1
fprintf('Usage: wavplot(wavFile \n');
return;
end;
[y, fs]=wavread(wavFile);
plot(y)
end
How to use it? it is simple. If you have .wav file, for example it has name tone.wav and you are in the current directory of Matlab command window, you can directly plot it with this function,
wavplot('tone.wav')And it will plot the wav file like the following,
![]() |
| Output of wavplot function |
