Correct detection of pace pulses in the electrocardiogram (ECG) is crucial for evaluation of pacemaker’s functionality and effect on the cardiac rhythm, as well as for elimination of the pace pulses influence on the automatic ECG analysis. Different medical standards have variable requirements regarding the amplitude and width of the pace pulses that should be indicated. Modern pacemakers could generate pulses smaller than the requirements set in the standards and could lead to complications in the pace detection algorithms. This paper presents an algorithm for real-time pace pulses detection in a single-lead ECG, based on assessment of the cumulative slope of the ECG signal (Slope) calculated in a narrow time window (N). The detection procedure includes crossing of a threshold (SlopeTHR) with predefined initial and minimal values (SlopeTHRInit, SlopeTHRMin) and a decrease coefficient K. The algorithm is trained and tested on an artificial database (sampled at 128 kHz, 9.81 µV/LSB) containing 780 ECGs (lead II) that represent different arrhythmias, combined with artificially superimposed pace pulses, which cover the wide ranges of rising edge (<10 µs to 100 µs) and total pulse durations (100 µs to 2 ms) and correspond to various pacemaker modes. A set of 390 randomly selected recordings is used for tuning the adjustable parameters N, SlopeThrInit, SlopeThrMin, K, sampling frequency (Fs). Three parameter settings are highlighted:
Setting1: N=1.5 ms, Fs=32 kHz, SlopeThrInit=3.84 V, SlopeThrMin=2.16 V, K=0.3125‰;
Setting2: N=1.5 ms, Fs=16 kHz, SlopeThrInit=1.32 V, SlopeThrMin=1.08 V, K=0‰;
Setting3: N=1.5 ms, Fs=16 kHz, SlopeThrInit=1.32 V, SlopeThrMin=1.08 V, K=1.25‰; The independent testing on the remaining 390 ECGs showed:
Sensitivity Se=99.27% and positive predictive value PPV=98.95% for Setting1;
Se=96.14%, PPV=97.85% for Setting2;
Se=97.14%, PPV=96.75% for Setting3. The accuracy drop for Fs=16 kHz is generally due to false negative errors occurring for low-amplitude pace pulses.