MATLAB: How to get the time frequency plot using autoregrssive model
frequncy plotSignal Processing Toolbox
I want to have a time frequency plot using parametric methods, plz anyone help.
Best Answer
If you have the Signal Processing Toolbox, try PYULEAR, PBURG, PCOV, PMCOV. Those will give you a periodogram for a given time slice.
You can either call it once per time slice, or if you'd like to do it all in one shot, you can give it a column for each estimate. Something like this pseudo-code:
function pburgspectrogram(x, order, nwin, noverlap, nfft, Fs)
% x - the input signal
% order - the model order
% nwin - the number of samples for any one given estimate
% noverlap - the number of overlapping samples between windows
Have a look at the documentation for the spectrogram function, that should do what you want. 0.025 is a rather short time so perhaps you can get something from calculating the instantaneous frequency - so have a look at that (and first the Hilbert transform too), this is likely a rough suggestion since we expect frequencies way higher than 20 Hz.
The "noverlap" should be a positive integer as it represents the number of samples of overlap with previous window. Hence the 50% overlap would be floor(win_size/2).
I'm attaching the figure that I obtained after making the changes using your input signal.
Since your window size is 2*fs, the 50% overlap will be "fs". Hence the use of the function "spectrogram" should look like: -
Best Answer