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

Hardcoded sampling rate? #68

Closed Fegalf closed 6 years ago

Fegalf commented 6 years ago

https://github.com/neuropsychology/NeuroKit.py/blob/30710dba4200f18d75a9faf54ea0a13e749248fc/neurokit/bio/bio_ecg.py#L580

If I understand correctly, this is an hard coded value of 1000Hz for "sampling_rate" variable. There seems to be many other instances of this elsewhere in the code.

DominiqueMakowski commented 6 years ago

@Fegalf I think that it is because it was previously rescaled to a specific rate (for rejecting outliers in "seconds") for example here:

https://github.com/neuropsychology/NeuroKit.py/blob/30710dba4200f18d75a9faf54ea0a13e749248fc/neurokit/bio/bio_ecg.py#L504

It is then rescaled to "milliseconds" to compute the frequency domains indices (which need the same scale).

It's also possible that it's a bug, in which case do not hesitate to report or correct it ;)

Fegalf commented 6 years ago

Alright! I will look into it and run some tests before making any modifications.

Fegalf commented 6 years ago

@DominiqueMakowski You were right! It's only a rescaling to milliseconds units. My bad :/ !