## 5 Discussion  
Generally, a limited number of studies has addressed the problem for pace pulses detection, which might be due to the fact that there is no publicly available ECG database containing recordings from paced patients. This study reveals the potential of a methodology based on Stockwell transformation and subsequent Shannon energy calculation for pace artifacts detection in a single-lead ECG corrupted with EMG noise. The design, validation and test are performed on a large, publicly available artificial database [32] recorded at a high sampling rate of 128 kHz, thus preserving even the steepest pulses with rising edges about 10 \(\upmu\)s. The benefits of using the 'ArtPacedECGdb' database, especially for training and validation, are as follows:  
* 'ArtPacedECGdb' database contains a great variety of ECG rhythms combined with pacing pulses that cover a wide range of amplitudes, rising edges and total pulse durations. The pace pulse positions are consistent with single-chamber, dual-chamber and bi-ventricular pacemaker types, as well as fixed-rate and 'on-demand' pacing, thus mimicking a variety of pacemaker types and modes. * 'ArtPacedECGdb' database provides paced ECGs corrupted by EMG artifacts, which is the only physiological noise that could compromise the methods for pace pulses detection. * 'ArtPacedECGdb' database is accompanied by reliable annotation of the positions of the pace pulses. The benefit of using the ArtPacedECGdb database for test purposes is its public accessibility, which gives the opportunity for fair comparison. The proposed methodology for pace pulses detection is further advanced by ECG analysis in the time-frequency domain, which provides the opportunity to correctly localize even very low amplitude pace pulses (~100 \(\upmu\)V) on the background of significant EMG artifacts based on their spectral components. While the time domain does not contain information about the frequency content of the signals, and the Fourier transform cannot depict how the ECG spectra change with time, the S-transform applied in this study provides an accurate presentation of the ECG frequency content changes over time (represented in the second subplot of Figure 2). The calculated Shannon energy over the S-transform of the ECG under analysis provides information about the energy concentration along the frequency axis at a given time instant and successfully localizes the positions of even low-amplitude pace pulses in the time domain. The proposed algorithm handles equally well (mean Se-100%, mean PPV \(>\) 98%) with paced ECGs corrupted or not by EMG noise. This fact also confirms the potential of the S-transform to reliably represent the ECG signal components generated by different sources. The analysis of the results presented in Table 2 and Figure 4 shows that the accuracy of the presented method is mostly influenced by the simulated pacemaker mode, instead of the EMG presence in the tested ECG. The drop downs in Figure 4 appear particularly for ECG signals with simulated bi-ventricular pacing, for which the minimal value of PPV in Table 2 is observed. SNR does not influence the observed high Se = 100%, which means that the EMG artifacts have not impeded the correct detection of the pace pulses. The decreased PPV (mean and minimal values) for SNR in the range 0.2 \(\div\) 0.75 (see Figure 5) is due to the increased number of false positive detections, generally for ECG recordings with pace pulse amplitude <200\(\upmu\)V. This could be explained by the decreased value of mean (abs(ShE)) in Equation (6), which is crossed also by some EMG artifacts. Comparisons of the performance of the method presented in this study to the accuracies of methods for pace pulses detection reported in the literature are presented in Table 3. It includes an algorithm previously designed by us [22], which was tested over the ECG signals from the test dataset described in section 'ECG database', as well as to a recently reported algorithm [18], which was trained and tested also on 'ArtPacedECGdb' database.