## 1 Introduction  
Pacemakers are devices that deliver electrical impulses to the heart chambers in order to provoke regular cardiac contractions. Electrocardiogram (ECG) analysis is important for the detection of pace pulse artifacts, since their existence indicates the presence of a pacemaker. ECG gives information on the proper functionality of the device and could help to evaluate the reaction of the heart. Statistics on the occurrence of pace pulses can be used to measure the evolution of arrhythmias and can eventually fine-tune the electrical or pharmacological therapy. However, not all pacemakers are equipped with event recorders, and some of them provide only concise statistics about pacing, but not information about the timing of the pace pulses [1]. One more reason for the need to detect pace pulses is the necessity to reject artifacts before automatic ECG analysis. As recently reported, the presence of pacing artifacts may impede the diagnosis of ventricular fibrillation during cardiac arrest [2]. In the best scenario, the ECG of a patient with an implanted pacemaker consists of the following:  
* natural ECG signal with amplitude up to 2 mV and frequency range between 0 Hz and 150 Hz;
* pace pulses with a wide amplitude range from 100 \(\mu\)V to as high as 100 mV, pulse width from 100 us to 2 ms, measured on the patient's skin, and a fast rising edge that could be as narrow as 10 us [3]. Depending on the underlying heart disease, the pacemaker could be programmed to pace the upper chambers, the lower chambers or both at a different rate. According to the number of active leads, the pacemaker types include the following:  
* single-chamber pacemaker, which uses one electrode placed either in the right atrium (when the sinus node is generating pulses that are too slow or irregular) or in the right ventricle (when the electrical flow is slowed or blocked in the region of the AV node, and the normal impulses from the atria cannot reach the ventricle);
* dual-chamber pacemaker, which uses one electrode in the upper chamber and one electrode in the lower chamber of the heart, thus regulating the heart's electrical activity in both chambers;
* bi-ventricular pacemaker, which uses three leads, first into the right atrium, second into the right ventricle and third into the left ventricle, applied for cardiac resynchronization therapy. According to programming, the pacemakers could be as follows:  
* fixed-rate pacemaker, which produces pace pulses at a steady rate, regardless of the heart's own electrical activity;
* pacemaker \"on demand\", which monitors the heart rhythm and generates electrical pulses only if the heart is beating too slowly or if it misses a beat;
* rate-responsive pacemaker, which speeds up or slows down the heart rate depending on how active the person is. Depending on the pacemaker type, pace artifacts could appear at different places in the PQRST segment, e.g., preceding the P wave or the QRS complex for single-chamber pacemakers, before both P wave and QRS complex in the case of dual-chamber devices, and two close in time artifacts preceding the QRS generated by the bi-ventricular pacemaker. According to the device programming, the pulses could be fixed-rate, on demand or rate-responsive [4]. In real environments, the ECG of a patient usually contains noise components such as:  
* low-frequency noise (0.05-1) Hz, which is generated by the patient's movements and respiration;
* power-line interference (50 or 60 Hz);
* electromyographic (EMG) noise caused by muscle electrical activity, which is reported to reach up to 1000 Hz [5]. There are two general approaches for pace pulses detection: hardware and software; these are outlined as follows:  
* Hardware approach--analyzes the analogue ECG signal in the process of ECG acquisition. This type of pace pulses detection is implemented by Texas Instruments relying on attenuation of the QRS complexes and consequent steep slope detection [6].