How to get the time frequency plot using autoregrssive model?

조회 수: 1 (최근 30일)
yogesh  pratap
yogesh pratap 2017년 3월 9일
편집: Greg Dionne 2017년 3월 16일
I want to have a time frequency plot using parametric methods, plz anyone help.

채택된 답변

Greg Dionne
Greg Dionne 2017년 3월 9일
편집: Greg Dionne 2017년 3월 9일
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
% nfft - how many points you want for the FFT.
% Fs - sample rate of signal
nx = length(x);
ncol = fix((nx-noverlap)/(nwin-noverlap));
coloffsets = (0:(ncol-1))*(nwin-noverlap);
rowindices = (1:nwin)';
xin = x(rowindices+coloffsets);
T = (coloffsets+(nwin/2)')/Fs;
[Pxx,F] = pburg(xin,order,nfft,Fs);
imagesc(T, F, 10*log10(abs(Pxx)+eps));
set(gca,'YDir','normal');
xlabel('Time');
ylabel('Frequency');
colorbar;
Example
load mtlb
pburgspectrogram(mtlb, 6, 128, 120, 128, Fs);
  댓글 수: 1
Greg Dionne
Greg Dionne 2017년 3월 16일
편집: Greg Dionne 2017년 3월 16일
Looks like you have an older version of MATLAB that doesn't have implicit expansion.
Replace:
xin = x(rowindices+coloffsets);
with
xin = x(bsxfun(@plus,rowindices,coloffsets));
That should get it to work (at least as far back as R2014b). Use whatever you want for x... so long as it's a column vector. If you have something earlier than that you'll need a for-loop.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Scopes and Data Logging에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by