paulvangentcom / heartrate_analysis_python

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

Fix rolling mean bug and enhance rolling mean calculation #86

Closed meierman1 closed 2 years ago

meierman1 commented 3 years ago

Fix #85 (see bug description there)

Instead of a fix, I dumped the whole rolling mean calculation and use scipy.ndimage.filters.uniform_filter1d instead which is faster and better (it handles edges well without just copying the neighbouring values). Besides the edge cases, it is fully backwards compatible (I ensured float computation even though you could argue that int would do the job too).

Considerations regarding efficiency

Function Doc

paulvangentcom commented 2 years ago

Thanks, good find! Merged