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

ECG: Localize Q and T waves #6

Closed DominiqueMakowski closed 7 years ago

DominiqueMakowski commented 7 years ago

This would be useful for being able to characterize periods of systole (R-T interval) and diastole. More and more papers (example) suggest that the cardiac phase has an impact on the processing of a stimulus.

We could then add a column within the processed dataframe corresponding to an array of zeros and ones, called for example 'Systole' that would indicate the cardiac phase.

Found some matlab code for the localization of QRS waves that, maybe, could be adapted?

@rhenanbartels do you think that detecting the t wave is complicated?

DominiqueMakowski commented 7 years ago

Looking at biosppy's R peak detector, I found this line that says: "if current slope is smaller than half the previous one, then it is a T-wave".

However, the code's a bit to complex for understanding how to extract them.

DominiqueMakowski commented 7 years ago

If we find a way to localize T waves, we could also localize the Q wave, then extract the QT intervals. This would be a nice feature for medical studies and assessments (the QT interval being an important feature of cardiac wellness).

rhenanbartels commented 7 years ago

Maybe we can clone the repository and change the code to return a list where the algorithm found a T-wave. I will try this here with a well-behaved ecg signal

DominiqueMakowski commented 7 years ago

might be useful someday: http://ieeexplore.ieee.org/abstract/document/1275572/

DominiqueMakowski commented 7 years ago

Done - Needs validation. Note that QT interval length computation remains impossible as it uses the beginning of both waves, and I managed to get the peak location 😢