rhenanbartels / hrv

A Python package for heart rate variability analysis
BSD 3-Clause "New" or "Revised" License
196 stars 58 forks source link

RRI detrended #26

Open adesider73 opened 3 years ago

adesider73 commented 3 years ago

When calculating rri_detrended with the smoothness priors method: rri_detrended = smoothness_priors(rri, l=500, fs=4.0) the rri_detrended values have a spike towards the end (see 2nd graph below) for both sample files real_rri.txt and rest_rri.txt which looks off. Is this expected behaviour or a bug? Thanks for your feedback. Screen Shot 2021-04-03 at 15 44 08

rhenanbartels commented 3 years ago

Hi @adesider73, how are you doing?

Thanks for your feedback. This is an expected bug :/

This happens, because in some cases the NumPy can not represent the tiny values present in the calculation of smoothness priors and round them off. I will check if it is possible to overcome this limitation using Numpy's float128.

adesider73 commented 3 years ago

Hi Rhenan, I'm doing good - how are you? Many thanks for your prompt reply and the explanation - much appreciated!

noah10 commented 3 years ago

I've recently encountered this bug as well. Unfortunately it has made smoothness priors unusable for me and I've had to switch to Savitzsky-Golay.