paulvangentcom / heartrate_analysis_python

Python Heart Rate Analysis Package, for both PPG and ECG signals
MIT License
930 stars 321 forks source link

RR interval updates after filtering bad peaks #87

Closed christianschneebeli closed 2 years ago

christianschneebeli commented 2 years ago

I have a concern about this line in analysis.py update_rr function: https://github.com/paulvangentcom/heartrate_analysis_python/blob/42534d74d31ec6575a5cc0111787c21339e6002b/heartpy/analysis.py#L142 As I understood, this function updates the rr values by filtering out the bad peaks identified in check_peaks. It keeps the rr values between two good peaks. Is there any reason why we not simply drop all the bad peaks and recalculate the rr values between the remaining good peaks? For small windows we can lose a lot of information the way it is done right now.

christianschneebeli commented 2 years ago

Nevermind. I think it makes sense for noisy data.