neuropsychology / NeuroKit

NeuroKit2: The Python Toolbox for Neurophysiological Signal Processing
https://neuropsychology.github.io/NeuroKit
MIT License
1.55k stars 414 forks source link

Neurokit2 ecg_delineate detects wrong R onsets and offsets #1042

Open sanketahegde opened 2 days ago

sanketahegde commented 2 days ago

Hi,

I am working some MIMIC ECGs which are 10 second each and have a sampling rate of 500Hz with total 5000 data points for every lead. I applied ecg_clean followed by ecg_peaks and used the required results in ecg_delineate. Everything works decently except for R_Onsets and R_Offsets. The R_Onset is detected very near to the P peak and R_Offset is detected sometimes correct but most of the time detected before the S peaks. I am mainly trying to calculate ecg-related intervals and for PR interval I need the correct R_Onsets.

Find some examples below:

image image

I also compared the PR interval calculated with the help of Neurokit2 against the original values from the ECG metadata and I get, PR_interval_orig = 130 msec PR_interval_neurokit = 52 msec

Is there a way I could overcome this problem with already available Neurokit functions or appreciate some suggestions for a workaround.

Thank you!

welcome[bot] commented 2 days ago

Hi 👋 Thanks for reaching out and opening your first issue here! We'll try to come back to you as soon as possible. ❤️ kenobi