From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Biomedical User Group Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Question on HRV HF and LF calcuations

Hi,

Can anyone advise on the how the HF and LF are calculated in the HRV calculations? I had the same RR values put into Matlab and the HF and LF results are different. Thank you. 

0 Kudos
Message 1 of 4
(4,331 Views)

Hey,

If you have the source codes, please check the core VI. I think some difference is right as the spectrum estimation algorithm is slightly different from Matlab. You should comapre the LF/HF ratio. That has not unit.

Thanks!

ZJ Gu

0 Kudos
Message 2 of 4
(2,981 Views)

Yes I had gone through the source code. Please advise if I have missed any point here:

1. NFFT - 1024

2. Take each point and calculate the magnitude square

3. Using 1024 bin as 1Hz, allocate the frequency for each band (i.e. LF and HF)

4. Add up all the magnitude square obtained for each of the points in the respective frequency band to give LF and HF value

Yes, I have also compared the ratio and they are very different too. Please advsie. Thanks.

0 Kudos
Message 3 of 4
(2,981 Views)

You are right. And you could change those settings.  There is one important stage you didn't mention - detrend. RR interval signal may have very strong power around 0Hz, we should remove it first. In startup kit, we use wavelet detrend, I think.

What do you mean by very different ? Could you please attach the RR interval file?

Thanks!

ZJ Gu.

0 Kudos
Message 4 of 4
(2,981 Views)