필터 지우기
필터 지우기

hrv spectral analysis

조회 수: 32 (최근 30일)
Olga
Olga 2012년 3월 14일
댓글: Apoorva Gangula 2021년 5월 24일
Hello, I've been trying to perform spectral analysis for hrv for some time already but there all the time problems with it.
I'm using such code:
%Spectral Analysis - WELCH metod
odstepRR=odstepRR.*1000; %odstepRR it an array with NN intervals
fs = 400;
maxF=fs/2;
odstepRR=detrend(odstepRR,'linear');
odstepRR=odstepRR-mean(odstepRR);
%Calculate PSD
[PSD,F] = pwelch(odstepRR,128,64,[],fs); %uses a hamming window
VLF = [0.0033 0.04];
LF = [0.04 0.15];
HF = [0.15 0.4];
% find the indexes corresponding to the VLF, LF, and HF bands
iVLF= (F>=VLF(1)) & (F<=VLF(2));
iLF = (F>=LF(1)) & (F<=LF(2));
iHF = (F>=HF(1)) & (F<=HF(2));
% calculate areas, within the freq bands (ms^2)
aVLF=trapz(F(iVLF),PSD(iVLF));
set(handles.vlf, 'string', num2str(aVLF));
aLF=trapz(F(iLF),PSD(iLF));
set(handles.lf, 'string', num2str(LF));
aHF=trapz(F(iHF),PSD(iHF));
set(handles.hf, 'string', num2str(aHF));
aTotal=aVLF+aLF+aHF;
set(handles.tp, 'string', num2str(aTotal));
% calculate areas relative to the total area (%)
% pVLF=(aVLF/aTotal)*100;
% pLF=(aLF/aTotal)*100;
% pHF=(aHF/aTotal)*100;
%calculate LF/HF ratio
lfhf =aLF/aHF;
axes(handles.axes5);
set(handles.text45, 'visible', 'on')
set(handles.axes5, 'visible', 'on')
%plot area under PSD curve
area(F(:),PSD(:),'FaceColor',[.6 .6 .6]);
grid on;
What am I doing wrong? The program doesn't count the spectral parameters (TP, HF, LF) and the plot is in different freq bands than it should be (on X axis freq should be 0.0-0.5 Hz). Shall be grateful for any help. ;)
  댓글 수: 3
NICOLE MIN
NICOLE MIN 2020년 11월 30일
im stuck at calculating aLF onwards . please help
thanks
Apoorva Gangula
Apoorva Gangula 2021년 5월 24일
What is odstepRR here?
I'm doing a project for fetal heart rate analysis and need to do spectral analysis as a part of it
please answer this

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

채택된 답변

Wayne King
Wayne King 2012년 3월 14일
Hi Olga, I think your problem is that your frequency resolution is too poor.
You are only obtaining PSD estimates at steps of 1.5625 Hz. Look at:
diff(F)
This is based on your sampling frequency and window (segment) length.
Therefore the code:
VLF = [0.0033 0.04];
LF = [0.04 0.15];
HF = [0.15 0.4];
iVLF= (F>=VLF(1)) & (F<=VLF(2));
iLF = (F>=LF(1)) & (F<=LF(2));
iHF = (F>=HF(1)) & (F<=HF(2));
Is going to return a vector of zeros for iVLF, iLF, and iHF. Look at the output for
nnz(iVLF)
nnz(iLF)
nnz(iHF)
You are trying to obtain power estimates on a grid that is much finer than your frequency resolution.
  댓글 수: 6
Olga
Olga 2012년 3월 15일
That's too bad. Thanks a lot for your help ;)
Bach
Bach 2012년 7월 27일
you can increase the number of FFT to improve the resolution. The frequency resolution = fs / nfft.

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

추가 답변 (3개)

Pradeep Kumar R
Pradeep Kumar R 2016년 2월 23일
hi guys i'm doing a project of fetal heart rate variability analysis i'm finding difficult to find and plot the heart rate of fetal i've extracted the fetal signal but only heart rate part i'm not able to come to a solution please help me with that.i've attached my code please help me out

KYAW KYAW
KYAW KYAW 2012년 7월 26일
Dear Wayne King,
I am facing problem for optimizing the peak frequency location in frequency domain analysis for normal and low respiratory rate.
Theoretically, the highest peak frequency must occured at 0.16667 Hz but in pratical is 0.164 to 0.1799(mostly 0.176 above).
My frequency resolution in X axis is 0.0078 which is in FFT only and I optimized then I got the wrost results.
The low frequency lower than 0.10 Hz(low respiratory rate) has issue for spectral analysis that is can't get the peak frequency in 0.10 Hz around there.
Please advise me why theoretical and experimental results are different and can't achieve for very low frequency.
In addition, why the peak frequeny occured in FFT is not same as AR Burg in some of the cases.
Thanks and best regards
  댓글 수: 1
Wayne King
Wayne King 2012년 7월 26일
please post a separate question for this.

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


Pradeep Kumar R
Pradeep Kumar R 2016년 2월 23일
hi guys i'm doing a project of fetal heart rate variability analysis i'm finding difficult to find and plot the heart rate of fetal i've extracted the fetal signal but only heart rate part i'm not able to come to a solution please help me with that.i've attached my code please help me out

카테고리

Help CenterFile Exchange에서 Spectral Estimation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by