calculate the frequency where psd is maximun

8 views (last 30 days)
hi i am new in matlab and i want to calculate
"the percent power content around the dominant frequency" that dominant frequency is
_"the frequency where the power spectral density (PSD) is maximum"_this process will work on ECG signal.
thank you very much

Accepted Answer

Wayne King
Wayne King on 28 Sep 2011
Hi, one thing you can do is to obtain a periodogram and then calculate the average power in an interval around the maximum frequency and then compare that to the average power from 0 to the Nyquist.
Fs = 1e3;
t = 0:1/Fs:1-(1/Fs);
x = cos(2*pi*100*t)+randn(size(t));
psdest = psd(spectrum.periodogram,x,'Fs',1e3,'NFFT',length(x));
[mx,I] = max(psdest.Data);
relperc = ...
100*avgpower(psdest,[psdest.Frequencies(I-2) psdest.Frequencies(I+2)])/avgpower(psdest,[0 Fs/2])

More Answers (0)

Community Treasure Hunt

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

Start Hunting!