Hi, I'm trying to perform the spectral analysis for HRV of ECG signals. I've done the PSD,but how do I split the spectrum into these frequency bands for HRV parameters (ULF, VLF, LF, HF - 0,003 to 0,4 Hz)? How do I show it on the plot power[ms^s](frequency[Hz])? I've done psd with this code:
fs = 400;
xdft = fft(odstepRR);
xdft = xdft(1:length(odstepRR)/2+1);
xdft(2:end-1) = 2*xdft(2:end-1);
psdest = 1/(length(odstepRR)*fs)*abs(xdft).^2;
freq = 0:fs/length(odstepRR):fs/2;
plot(freq/100,10*log10(psdest));
grid on;
btw. odstepRR is my vector with NN intervals. Shall be very gratefull for your help. ;)

답변 (1개)

Wayne King
Wayne King 2012년 2월 9일

0 개 추천

Hi Olga, you have your frequencies in your freq vector. You can use that information to subset your psdest vector.
Keep in mind that your frequency resolution is determined by the sampling frequency and the length of the data vector. So depending on how long odstepRR is, you may have a very small step between elements of freq (much less than 1 Hz), or a step much larger than 1 Hz.
But you can do something like
indices = find(freq> 0.1 & freq<0.4);
ULF = psdest(indices);
to separate the power estimates in the band.
If you use spectrum.periodogram from the Signal Processing Toolbox, there is an avgpower() method that you can use to integrate the power in the PSD estimate over a given interval.
x = randn(1024,1);
psdest = psd(spectrum.periodogram,x,'Fs',400,'NFFT',length(x));
ULFpower = avgpower(psdest,[0.1 0.4]);

댓글 수: 4

Olga
Olga 2012년 2월 9일
Thanks. But is there any way so that I get power in ms^2 insted of dB/Hz on Y-axis?
Wayne King
Wayne King 2012년 2월 9일
Hi Olga, Neither of the ways I showed you are in dB, then are units squared.
Olga
Olga 2012년 2월 12일
And it is not possible to change the units, is it?
Wayne King
Wayne King 2012년 2월 13일
the PSD is in squared units by definition.

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

카테고리

질문:

2012년 2월 9일

편집:

Jan
2013년 10월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by