I'm trying to plot a spectrogram of a vibration signal using Matlab, but I'm not happy with the way that the spectrogram
-function plots the signal (I would like to customize the axes and use a mapped vector instead of time). Right now I'm trying to plot the thing myself using pcolor
:
[M_s, M_w, M_t] = spectrogram(M_i, 2^16, ceil(2^16*0.95), [0:0.2:15000], Sample_rate);
figure;
[M_t, M_w] = meshgrid(M_t, M_w);
h = pcolor(M_t, M_w, mag2db(abs(M_s)));
set(h, 'LineStyle', 'none);
However, doing this, my plotted figure is extremely slow and I can't really work with that, because it takes ages to zoom in or do anything with it. When I just use spectrogram
to plot the figure, it's super fast. So my question is, what exactly does spectrogram
do, to plot the figure?