neuropsychology / NeuroKit.py

A Python Toolbox for Statistics and Neurophysiological Signal Processing (EEG, EDA, ECG, EMG...).
http://neurokit.rtfd.io
MIT License
365 stars 102 forks source link

Cubic interpolation for frequency domain #66

Open Eichhof opened 6 years ago

Eichhof commented 6 years ago

Hello

In bio_ecg.ecg_hrv you interpolate the RR intervals to convert to continuous RR interval before extracting the frequency domain features. You are doing this using a third order (i.e. cubic) spline. I assume that the way you calculate the frequency features needs a continuous signal. Would it not also be possible to compute frequency features without interpolation?

However, why are you using this cubic interpolation instead of a linear interpolation? I think with a cubic interpolation the signal can be overestimated or underestimated, especially around the RR values.

DominiqueMakowski commented 6 years ago

@Eichhof glad to see you're digging into the code :)

Cubic interpolation is the method described in the papers I read. I believe this has to do with the underlying physiological dynamics (the heart rate would change "smoothly" rather than linearly with abrupt changes). However, you might want to ask an HRV expert to be sure.

Eichhof commented 6 years ago

Thank you for your answer. Do you have some of the papers at hand which you mentioned?

DominiqueMakowski commented 6 years ago

@Eichhof maybe in one of those: