Home▸Articles▸Medicine & Biophysics

Pan-Tompkins QRS Detector 2D: Decoding Heartbeats from ECG Signals

A cornerstone of modern cardiac monitoring technology, the Pan-Tompkins algorithm extracts heartbeats from noisy electrocardiogram (ECG) signals with remarkable accuracy.

mysimulator teamUpdated June 2026≈ 4 min read▶ Open the simulation

What is the Pan-Tompkins QRS Detector?

The Pan-Tompkins algorithm is a widely used method for detecting R-waves (QRS complexes) in electrocardiogram (ECG) signals. It consists of several stages: bandpass filtering, differentiation, squaring, moving-window integration, and thresholding. These steps are designed to isolate the QRS complex from noise and other artifacts.

Originally developed by David Pan and John Tompkins in 1985, this algorithm has become a standard in wearable ECG devices due to its robustness against motion artifacts and its ability to accurately detect heartbeats even under challenging conditions.

How Does the Algorithm Work?

The process begins with bandpass filtering, which isolates the frequency range of interest around the QRS complex. The five-tap derivative step emphasizes the sharp transitions in the ECG signal, making it easier to detect peaks corresponding to the R-waves. Squaring amplifies these peaks further and moving-window integration smooths out the signal while retaining the peak information.

Finally, an adaptive threshold is applied to identify the peaks as QRS complexes. This self-calibrating threshold adjusts based on the local characteristics of the ECG signal, ensuring accurate detection even in noisy conditions.

live demo · related simulation● LIVE

Why Does It Matter?

Accurate heart rate monitoring is crucial for diagnosing and managing various cardiac conditions. The Pan-Tompkins algorithm ensures reliable detection of heartbeats from ECG signals, which can be obscured by motion artifacts or other electrical noise. This makes it invaluable in wearable devices like fitness trackers and medical monitors.

Moreover, the ability to detect ectopic (premature) beats is essential for identifying arrhythmias and other cardiac issues that might not be apparent otherwise.

Real-World Applications

The Pan-Tompkins QRS detector is used in a variety of applications, from fitness trackers to hospital monitoring systems. It enables real-time heart rate monitoring during physical activity and helps in detecting abnormal heart rhythms that could indicate underlying health issues.

In clinical settings, the algorithm's ability to flag ectopic beats can be critical for diagnosing conditions like atrial fibrillation or ventricular tachycardia.

Frequently asked questions

How does the Pan-Tompkins QRS detector handle motion artifacts?

The algorithm uses a combination of bandpass filtering and adaptive thresholding to mitigate the effects of motion artifacts. The bandpass filter isolates the frequency range of interest, while the adaptive threshold adjusts based on local signal characteristics, reducing false positives from noise.

Why is the five-tap derivative step important?

The five-tap derivative step enhances the sharp transitions in the ECG signal, making it easier to detect peaks corresponding to QRS complexes. This step is crucial for isolating the R-wave from other components of the ECG waveform.

Can the Pan-Tompkins algorithm be used outside medical applications?

Yes, the Pan-Tompkins algorithm has found use in various non-medical applications such as fitness trackers and smartwatches. Its ability to accurately detect heartbeats from noisy ECG signals makes it suitable for monitoring physical activity and overall health.

How does adaptive thresholding work?

Adaptive thresholding adjusts the detection threshold based on the local characteristics of the ECG signal, ensuring that the algorithm can accurately detect QRS complexes even in noisy conditions. This self-calibrating approach minimizes false positives and negatives.

Try it live

Everything above runs in your browser — open Pan-Tompkins QRS Detector 2D: ECG Strip-Chart & Poincaré Plot and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

▶ Open Pan-Tompkins QRS Detector 2D: ECG Strip-Chart & Poincaré Plot simulation

What did you find?

Add reproduction steps (optional)