Pan–Tompkins algorithm

The Pan–Tompkins algorithm is commonly used to detect QRS complexes in electrocardiographic signals (ECG).

Uses your system voice; voice and rate in settings.

Snapshot

≈ 5 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

The Pan–Tompkins algorithm is commonly used to detect QRS complexes in electrocardiographic signals (ECG). The QRS complex represents the ventricular depolarization and the main spike visible in an ECG signal (see figure). This feature makes it particularly suitable for measuring heart rate, the first way to assess the heart health state.

In the first derivation of Einthoven of a physiological heart, the QRS complex is composed by a downward deflection (Q wave), a high upward deflection (R wave) and a final downward deflection (S wave). The Pan–Tompkins algorithm applies a series of filters to highlight the frequency content of this rapid heart depolarization and removes the background noise.

Then, it squares the signal to amplify the QRS contribution, which makes identifying the QRS complex more straightforward. Finally, it applies adaptive thresholds to detect the peaks of the filtered signal. The algorithm was proposed by Jiapu Pan and Willis J. Tompkins in 1985, in the journal IEEE Transactions on Biomedical Engineering.

The performance of the method was tested on an annotated arrhythmia database (MIT/BIH ) and evaluated also in presence of noise. Pan and Tompkins reported that the 99.3 percent of QRS complexes was correctly detected.

H(z)={(1-z^{-6})^{2} \over (1-z^{-1})^{2}} for a second-order low-pass filter with a gain of 36 and a processing delay of 5 samples; H(z)={(-1/32+z^{-16}-z^{-17}+z^{-32}/32)\over(1-z^{-1})} for a high-pass filter with a unity gain and a processing delay of 16 samples. H(z)=0.1(-z^{-2}-2z^{-1}+2z^{1}+z^{2}) for a 5-point derivative filter with gain of 0.1 and a processing delay of 2 samples.

Threshold_I= NoiseLevel_I + 0.25 (SignalLevel_I - NoiseLevel_I) where NoiseLevel I is the running estimate of the noise level in the integrated signal and SignalLevel I is the running estimate of the signal level in the integrated signal. The threshold is automatically updated after detecting a new peak, based on its classification as signal or noise peak: SignalLevel_I = 0.125 PEAK_I + 0.875 SignalLevel_I (if PEAK I is a signal peak) NoiseLevel_I = 0.125 PEAK_I + 0.875 NoiseLevel_I (if PEAK I is a noise peak) where PEAK I is the new peak found in the integrated signal.

At the beginning of the QRS detection, a 2 seconds learning phase is needed to initialize SignalLevel I and NoiseLevel I as a percentage of the maximum and average amplitude of the integrated signal, respectively. If a new PEAK I is under the Threshold I , the noise level is updated.

If PEAK I is above the Threshold I , the algorithm implements a further check before confirming the peak as a true QRS, taking into consideration the information provided by the bandpass filtered signal. In the filtered signal the peak corresponding to the one evaluated on the integrated signal is searched and compared with a threshold, calculated in a similar way to the previous step: Threshold_F= NoiseLevel_F + 0.25 (SignalLevel_F - NoiseLevel_F) SignalLevel_F = 0.125 PEAK_F + 0.875 SignalLevel_F (if PEAK F is a signal peak) NoiseLevel_F = 0.125 PEAK_F + 0.875 NoiseLevel_F (if PEAK F is a noise peak) where the final F stands for filtered signal.

RRlow = 92% RRaverage2 RRhigh = 116% RRaverage2 If no QRS is detected in a window of 166% of the average RR (RRaverage1 or RRaverage2, if the heart rhythm is regular or irregular, respectively), the algorithm adds the maximal peak in the window as a potential QRS and classify it considering half the values of the thresholds (both ThresholdI I and ThresholdI F ). This check is implemented because the temporal distance between two consecutive beats cannot physiologically change more quickly than this. \mathit{HR}\ (\text{bpm})={60 \over \mathit{RR}\ (\text{s})} where bpm stands for beats per minute. The HR is often used to compute the heart rate variability (HRV) a measure of the variability of the time interval between heartbeats.

HRV is often used in the clinical field to diagnose and monitor pathological conditions and their treatment, but also in the affective computing research to study new methods to assess the emotional state of people.

Text derived from https://en.wikipedia.org/w/index.php?oldid=1343614003 under CC BY-SA 4.0; modifications have been made.

Sources cited in this revision

2 named source(s) extracted from the cited revision. A source with no author is shown by its publication; nothing is invented.