Need an example for calculating power spectrum density
12 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I want to plot a Power Spectrum Density(having units s^2/Hz)plot against frequency(Hz) as shown in this link PSD and want to calculate the variables PeakFreq,VLFpower,LFpower,UFpower,VLF,LF,UF as shown in link.
Can someone please give a demo with some example values of
1)how to plot the PSD as shown in the link
2)how to calculate those variables.
Thankyou.
0 件のコメント
採用された回答
Greg Dionne
2014 年 7 月 29 日
編集済み: Greg Dionne
2014 年 7 月 29 日
Hi Stefan,
Thanks for the data set. Here's an idea to get you started.
% RRintervals is a list of the intervals between successive R waves
% approximate the time relative to the first interval
t = cumsum(RRintervals);
% make a uniform grid inside the full interval
% I arbitrarily picked a grid at 1 second intervals... you may find something else more useful.
tGrid = 1:55;
% interpolate to get the beats per second on a uniform grid
bps = interp1(t,RRintervals,tGrid,'spline');
% compute the PSD
% units of Pxx are squared seconds/Hz.
% sample rate is 1 Hz.
[Pxx,F] = periodogram(bps,[],numel(bps),1);
% Zero out the DC bin so it fits nicely on screen
Pxx(1) = 0;
% make a pretty plot
plot(F,Pxx);
xlabel('Hertz');
ylabel('s^2 / Hz');
% compute the power in the various bands...
% note that I removed the DC bin earlier, so VLF is somewhat suspect...
vlf = bandpower(Pxx,F,[0 0.04],'psd') % units of sec^2
lf = bandpower(Pxx,F,[0.04 0.15],'psd') % units of sec^2
hf = bandpower(Pxx,F,[0.15 0.4],'psd') % units of sec^2
totPower = bandpower(Pxx,F,'psd') % units of sec^2
% you can then take the ratio of lf, hf, etc. to totPower * 100 to get the percentages etc.
Hope this helps.
-G
5 件のコメント
Greg Dionne
2014 年 8 月 1 日
- To convert X s^2 to X ms^2, multiply by 1e6.
- You could try something like:
iRange = find(0 <= F & F <= 0.04);
[pMax, iMax] = max(Pxx(iRange))
fMax = F(iRange(iMax))
ROHAN JAIN
2020 年 5 月 4 日
Hi, I have a general doubt regarding the previous question. For very low frequencies (below 2Hz) the power of the psd is by default very high because of the presence of 1/f inherent noise, and as a result of which many interpretations go wrong. So, the high amplitudes or power values at such low frequencies is not due to the signal but noise actually.
Do you have any suggestions for the removal of such noise from EEG signal in an effective way ?
Many Thanks,
Best Wishes,
RJ
その他の回答 (1 件)
Greg Dionne
2014 年 7 月 28 日
Hi Stefan,
There are numerous programs on MATLAB Central's File Exchange that can extract various features from ECG waveforms.
If you just need something simple and have a recent copy of the Signal Processing Toolbox, you can use PERIODOGRAM without output arguments to plot a PSD. You can also use BANDPOWER to obtain the bandpower between two frequencies of a uniformly sampled signal or a PSD.
Hope this helps.
-Greg
参考
カテゴリ
Help Center および File Exchange で Spectral Estimation についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!