⚠️ Not medical advice. This simulation is an educational, simplified illustration of ECG waveform features and classification logic. It is not a diagnostic ECG reader, has not been validated on real patient data, and must never be used to interpret an actual ECG or guide a real medical decision. If you or someone else has chest pain, palpitations, shortness of breath, fainting, or any other concerning cardiac symptom, seek prompt medical evaluation from a qualified professional or emergency services.
What PTB-XL Is, and Why It Changed ECG Machine Learning
Training a reliable ECG classifier requires two things that used to be scarce together: a large volume of real recordings, and trustworthy labels attached to them. PTB-XL, released by researchers building on the long-running Physikalisch-Technische Bundesanstalt ECG database (Wagner et al.), addressed both at once. It provides over 21,000 clinical 12-lead ECG recordings, each ten seconds long, drawn from a genuinely diverse patient population, and each one carries diagnostic labels assigned by expert cardiologists across dozens of rhythm and morphology categories, from normal sinus rhythm through various conduction abnormalities, hypertrophy patterns and myocardial infarction subtypes, with many records receiving more than one label at once, since real ECGs frequently show overlapping findings. That combination of scale and annotation quality is precisely what made it practical to train deep learning models directly on the raw waveform signal, feeding a neural network the actual voltage-over-time trace rather than a small hand-picked set of measurements like QRS duration or PR interval alone. Earlier ECG classification approaches often relied on exactly those hand-engineered features because there wasn't enough richly labeled raw-signal data to learn more nuanced patterns directly. Datasets at PTB-XL's scale let models instead learn which subtle shapes, slopes and combinations of features in the raw trace correlate with which diagnostic categories, sometimes surfacing patterns that are hard to fully capture in a short list of interval measurements, while still, importantly, remaining broadly consistent with the same standardized clinical criteria cardiologists have used for decades. This simulation demonstrates the standardized-criteria side of that picture in an intentionally simple, rule-based way.
QRS Duration: Reading the Ventricles' Electrical Wiring
The QRS complex is the sharp spike in an ECG trace that represents ventricular depolarization, the electrical signal spreading through the heart's two large pumping chambers to trigger a contraction. In a healthy heart, that signal travels down a fast, dedicated conduction pathway, the bundle branches, so the whole ventricles activate together almost instantly; a normal QRS complex typically lasts only about 80 to 100 milliseconds. If one of those bundle branches is blocked or delayed, the electrical wave can no longer spread through both ventricles simultaneously via the fast pathway; it has to detour through slower, ordinary heart-muscle tissue to reach the delayed side, and that detour takes measurably longer. Standard ECG interpretation criteria set the cut-off at 120 milliseconds: a QRS complex at or beyond that duration is the accepted threshold for suspecting a bundle branch block. This simulation uses that same 120-millisecond figure, drawn directly from standard ECG interpretation criteria, not an invented number, and widens the drawn QRS complex proportionally as you move the slider so the visual widening and the numeric threshold move together.
PR Interval: Timing the Handoff Through the AV Node
Before the ventricles can depolarize, the electrical signal has to first spread across the atria, producing the small, rounded P wave, and then pass through the atrioventricular (AV) node, a natural checkpoint that briefly delays the signal to give the atria time to finish contracting and fill the ventricles before they squeeze. The PR interval measures the total time from the start of the P wave to the start of the QRS complex, capturing both atrial depolarization and that AV-node delay together. A normal PR interval falls roughly between 120 and 200 milliseconds. When the AV node's conduction slows down further, whether from age-related fibrosis, certain medications, increased vagal tone, or other causes, the PR interval stretches out. A PR interval beyond 200 milliseconds is the standard threshold for first-degree AV block, the mildest category of AV conduction delay, in which every atrial signal still eventually reaches the ventricles but takes longer to get there. This simulation applies that same 200-millisecond threshold and visibly lengthens the gap between the P wave and QRS complex as you raise the PR-interval slider.
ST-Segment Elevation: The Signature Cardiologists Watch Most Urgently
After the QRS complex, the trace briefly settles onto the ST segment before rising into the broader, rounded T wave that represents the ventricles resetting (repolarizing) for the next beat. In a healthy heart, that ST segment sits essentially flat, at the same baseline level as the rest of the trace between beats. When a portion of heart muscle is acutely deprived of blood flow, most seriously during a full-thickness heart attack, the injured tissue's electrical behavior changes in a way that lifts the ST segment above the baseline on the ECG, producing the ST-segment elevation pattern that gives ST-elevation myocardial infarction, or STEMI, its name. Standard diagnostic criteria measure this elevation at the J-point, where the QRS complex ends and the ST segment begins, and generally require at least 1 millimeter (0.1 millivolt) of elevation in at least two anatomically contiguous limb leads, with a higher threshold of roughly 2 millimeters used in the precordial leads V2 and V3, where a slightly elevated baseline is more common even in healthy people. This simulation uses the 1-millimeter limb-lead figure as an illustrative threshold and lifts the ST segment of the drawn waveform correspondingly, while explicitly noting that a genuine STEMI reading also requires that the elevation appear consistently across multiple contiguous leads on a real 12-lead ECG, something one simplified single-lead-style trace cannot fully demonstrate.
From Individual Thresholds to a Combined Classification
Real ECG interpretation, whether performed by a cardiologist or an algorithm trained on data like PTB-XL, rarely comes down to a single isolated measurement. A trace can show a wide QRS complex and a long PR interval at the same time, or an elevated ST segment sitting inside an otherwise near-normal rhythm; the four features in this simulation are not mutually exclusive, and the classification readout is built to reflect that, flagging every real threshold that is crossed at once rather than forcing an artificial single answer. Heart rate itself is treated a little differently here: rates below 60 beats per minute (bradycardia) or above 100 beats per minute (tachycardia) are noted as rhythm context, since they are genuinely meaningful observations, but they are not folded into the four headline classification categories the way QRS duration, PR interval and ST elevation are, since a fast or slow rate alone does not, by itself, indicate a bundle branch block, AV block or STEMI pattern the way those three specific interval and segment abnormalities do.
Augmenting Cardiologists, Not Replacing Them
It is worth being direct about what datasets like PTB-XL have and have not enabled. They have made it realistic to build automated systems that flag likely-abnormal ECGs quickly, help triage which traces in a busy emergency department or telehealth queue deserve the fastest expert review, and occasionally surface subtle patterns a rushed or fatigued reader might miss. Research in this space is consistently framed around augmenting clinical workflows rather than replacing the clinician: automated ECG classification models are trained against, validated against, and generally deployed alongside continued cardiologist over-reading, and real-world clinical practice still requires a qualified professional to confirm any diagnostically significant finding before it drives patient care. That same spirit carries over to this simulation, on a much smaller and purely educational scale. It exists to make the logic behind ECG feature thresholds tangible and explorable, not to function as a diagnostic instrument. Nothing about crossing a threshold on these sliders, or in a real automated classifier's output, is meant to stand in for the judgment of a qualified clinician looking at an actual patient's full clinical picture.
Frequently asked questions
What is PTB-XL and why does it matter for ECG AI?
PTB-XL is a large, publicly released dataset of clinical 12-lead ECG recordings, over 21,000 in total, each annotated by expert cardiologists with one or more diagnostic labels covering rhythm and morphology categories. Its scale and the quality of its multi-label expert annotations made it practical for researchers to train deep learning models directly on raw ECG waveform signals rather than on a small set of hand-engineered features, which is a large part of why it became a standard benchmark for automated ECG classification research.
What exactly makes a QRS complex count as "wide"?
A normal QRS complex, the spike representing ventricular depolarization, typically lasts about 80 to 100 milliseconds. Standard ECG interpretation criteria flag a QRS duration of 120 milliseconds or more as wide, which is the threshold used to suspect a bundle branch block, a delay in the heart's electrical conduction pathway through the ventricles. This calculator uses that same 120-millisecond cut-off rather than an invented number.
How is the PR interval defined and what does a long one mean?
The PR interval is measured from the start of the P wave, which represents atrial depolarization, to the start of the QRS complex, which represents ventricular depolarization; it captures how long the electrical signal takes to travel from the atria through the AV node into the ventricles. A normal PR interval is roughly 120 to 200 milliseconds. A PR interval beyond 200 milliseconds is the standard criterion for first-degree AV block, meaning conduction through the AV node is delayed, which is the threshold this simulation applies.
What ST-segment elevation threshold suggests a STEMI pattern?
Standard STEMI diagnostic criteria look for ST-segment elevation, measured at the J-point where the QRS complex ends and the ST segment begins, of at least 1 millimeter (0.1 millivolt) in at least two contiguous limb leads, or a higher 2-millimeter threshold in the precordial leads V2 and V3. This simulation uses the 1-millimeter limb-lead figure as its illustrative threshold, and explicitly notes that a real 12-lead reading additionally requires the elevation to appear in contiguous leads, something a single simplified waveform cannot show.
Does this mean AI can replace a cardiologist reading an ECG?
No. Research built on datasets like PTB-XL is generally framed around augmenting clinical workflows, flagging likely-abnormal traces for faster review, prioritizing urgent cases, or catching findings a busy reader might miss, rather than replacing expert interpretation outright. Real clinical ECG classification models are validated against, and typically deployed alongside, cardiologist over-reading, and regulatory and clinical practice standards still require human sign-off on diagnostic ECG findings.
Is this simulation a real diagnostic tool I can use on my own ECG?
No. This is an educational, simplified illustration built with a stylized waveform and a small set of rule-based thresholds for teaching purposes, not a validated diagnostic device and not a substitute for a real ECG reading by a qualified clinician. It cannot read or interpret any actual patient ECG data. Anyone experiencing real cardiac symptoms such as chest pain, palpitations, shortness of breath or fainting should seek prompt medical evaluation rather than relying on this or any similar educational tool.
Try it live
Everything above runs in your browser — open ECG Waveform Classifier Lab and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.
▶ Open ECG Waveform Classifier Lab simulation