I would like to get a plot of the same type of the one that I get with spectrogram
function, I am trying with contour
but I do not get the same result. I have written a small function which compares the two plot. The function records audio for one second and then plot the spectrogram.
function graph_comparison
a = audiorecorder(44100,16,1);
recordblocking(a,1);
y = getaudiodata(a);
figure
subplot(1,2,1);
spectrogram(y);
s = spectrogram(y);
subplot(1,2,2);
contour(mag2db(abs(s))); %mag2db converts intensity in db
%rotate the second plot
view(-90, 90);
set(gca, 'ydir', 'reverse');
end
I found it, it is sufficient to replace
contour
withimagesc
.