MATLAB: Audio signal in spectrogram

audiospectrogram

Hello,
How to apply window function for a audio signal in spectrogram and compare it with the one without applying window function ?

Best Answer

You can supply the window argument as a vector.
Signal
t=0:0.001:2;
x=chirp(t,0,1,150);
Now to find the short-time Fourier transforms
% without a window
win = ones(200,1);
[S,F,T] = spectrogram(x,win,100,200,1000);
% with a hamming window
win = hamming(200);
[Swin,Fwin,Twin] = spectrogram(x,win,100,200,1000);