calculate the frequency where psd is maximun
7 views (last 30 days)
Show older comments
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
0 Comments
Accepted Answer
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])
Wayne
0 Comments
More Answers (0)
See Also
Categories
Find more on ECG / EKG in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!