MarcusVollmer / HRV

Methods for analyzing Heart Rate Variability
http://marcusvollmer.github.io/HRV/
MIT License
86 stars 38 forks source link

ERROR: Nan values for LF/LH ratio #19

Open susanar1111 opened 1 year ago

susanar1111 commented 1 year ago

Hi, I am using your toolbox for ECG analysis; however this error is happening, Nan values for LF/LH ratio in some intervals of data. Moreover, the imported data for the HRVtool app appear to be cut in these segments where this error occurs (In the original file, this piece of data doesn´t have Nan values and is not zero).

Example

In the example, as you can see the ratio is equal to Nan, and in the RR Tachogram, this segment of data appear to be cut. Also, in the Spectugram of RR Tachogram, the ratio is not Nan, why?

Can you help me understand what is happening here?

MarcusVollmer commented 1 year ago

Hi,

the filter sets an RR interval to NaN which looks suspicious, see some details here (Issues 2). To figure out, which intervals are affected, please set the view to 25:35 seconds and show the absolute and relative intervals by pressing the top two buttons on the upper right. As there is no underlying ECG loaded, it hard to verify whether the intervals are correct. But I assume that the respiratory modulation is the reason for a long interval after a short one. You might disable the filter by setting the filter value to NaN (just type it in the edit field which currently have the value '20'). If you keep the NaN value - it will break the RR tachogram leaving the interval time series incomplete. The frequency composition (low and high frequencies in the RR tachogram) cannot be computed from a time series with missing information. LF/HF values also needs a sufficient number of intervals for reliable measures. I would recommend to use other parameters for short /ultra-short HRV.

Best, Marcus

Best