HomeMedical Devices & Diagnostics HardwareWearable ECG Arrhythmia Detector

🩻 Wearable ECG Arrhythmia Detector

Continuous ECG monitoring and machine learning-based detection of atrial fibrillation in real-time.

Medical Devices & Diagnostics Hardware2DModerate60 FPS
wearable-ecg-afib-screening ↗ Open standalone

Electrode Contact — Building a Lead I Vector from Two Points of Skin

A standard 12-lead ECG uses 10 electrodes placed on the limbs and chest to reconstruct the heart's electrical activity from many angles. A smartwatch has none of that — instead it turns the user's own body into the missing wire. Touching the digital crown with a finger from the opposite hand closes a circuit that approximates Lead I: right arm to left wrist.

  • 2: Electrodes used (back crystal + crown/bezel)
  • Lead I: Approximated vector (right arm → left wrist)
  • 30 sec: Contact time required (steady, still contact)
  • 2018: FDA clearance (De Novo, Class II OTC)

From 10 electrodes to 2 — the single-lead simplification

A hospital 12-lead ECG places electrodes on both wrists, the left ankle, and six points across the chest, mathematically combining them into 12 different views (leads) of the heart's depolarization wavefront. This spatial coverage is what lets cardiologists localize ischemia, chamber enlargement, and conduction blocks.

A smartwatch ECG app collapses this down to a single vector. The watch back-crystal, resting against the wrist, acts as one electrode. The digital crown (or a side button on some devices) is the second electrode. When the user touches the crown with a finger on the opposite hand, current from the heart's electrical field flows through that arm, across the chest, and into the wrist under the watch — completing a circuit that approximates standard Lead I (right arm to left arm) of the Einthoven triangle, just rerouted through the wrist instead of the shoulder.

This is enough to capture rhythm (timing and shape of each heartbeat) but not enough to reliably localize structural or ischemic disease the way a 12-lead recording can — a distinction the classification stage later depends on.

The Apple Watch Series 4 ECG app received FDA De Novo clearance in September 2018 — the first ECG-generating software offered directly to consumers over the counter, without a prescription.

Signal acquisition chain — from skin to samples

Once contact is made, the raw microvolt-level potential difference between the two electrodes passes through a short but critical analog and digital pipeline before it ever becomes a waveform on screen:

• Differential amplifier: boosts the ~0.5-2 mV cardiac signal while rejecting common-mode noise picked up equally by both electrodes • Analog-to-digital conversion: ~16-bit resolution at roughly 500-512 Hz sampling rate (Apple Watch), fast enough to resolve a QRS complex that is only 80-100 ms wide • Bandpass filtering: typically 0.5-40 Hz, removing baseline wander (respiration, slow drift) below and muscle/EMG noise above • Powerline notch filter: suppresses 50/60 Hz mains interference picked up from nearby electronics

The result is a clean digitized single-channel trace ready for the 30-second recording window.

Why contact quality matters before a single sample is analyzed

Because there is only one lead and no redundancy, a poor electrode-skin interface (sweat, movement, a loose grip, tattoo ink over the wrist) directly degrades the only signal available. Unlike a 12-lead system, where a noisy lead can sometimes be cross-checked against others, a single-lead wearable has no fallback channel.

Manufacturers mitigate this by requiring the arm to rest on a stable surface, prompting the user to stay still, and running a real-time signal-quality check during acquisition — if contact is lost or the trace is too noisy, the recording restarts rather than proceeding to a possibly wrong classification.

30-Second Raw ECG Recording — Anatomy of the P-QRS-T Complex

Once the circuit is closed, the watch records a continuous 30-second single-lead strip — roughly 25 to 45 heartbeats depending on heart rate. Each beat traces the same three-part signature: a small P wave, a sharp QRS spike, and a rounded T wave, repeating with a rhythm that itself carries diagnostic information.

  • 30 sec: Recording duration (~15,360 samples at 512 Hz)
  • 120–200 ms: Normal PR interval (AV node conduction delay)
  • <120 ms: Normal QRS duration (ventricular depolarization)
  • 25–45: Beats captured (typical) (at 50–90 bpm)

The P-QRS-T complex — one heartbeat, three electrical events

Every normal heartbeat produces the same three-part waveform on an ECG:

• P wave: a small, rounded deflection (~0.1–0.25 mV) caused by depolarization spreading across the atria as they contract. Its consistent presence before every QRS complex is the hallmark of a coordinated atrial rhythm.

• QRS complex: a sharp, tall spike (the largest deflection on the trace) representing rapid depolarization of the much larger ventricular muscle mass. Normal duration is under 120 ms — a wide QRS suggests a conduction abnormality.

• T wave: a broader, lower-amplitude wave representing ventricular repolarization — the electrical "reset" before the next beat.

Between beats, the trace should return to a flat, quiet isoelectric baseline. It is precisely this quiet baseline, and the sharp discrete P wave, that atrial fibrillation erases.

On-device signal processing before classification

Raw voltage samples are not fed directly into a classifier. A short processing pipeline runs first:

• Baseline wander removal: a high-pass or wavelet filter strips slow drift caused by breathing or minor arm movement • R-peak detection: a Pan-Tompkins-style algorithm (derivative + squaring + moving-window integration) locates each QRS spike with millisecond precision • Beat segmentation: the trace is cut into individual P-QRS-T windows anchored to each detected R peak • Amplitude normalization: beat-to-beat gain differences from skin contact variability are normalized before feature extraction

Only after this cleanup does the algorithm move to counting intervals and searching for P waves.

Why 30 seconds, and not less

A shorter recording would be faster and more comfortable, but rhythm classification depends on statistics across many beats, not a single complex. At a typical resting heart rate of 60–80 bpm, 30 seconds captures roughly 30–40 consecutive R-R intervals — enough to compute a stable estimate of beat-to-beat variability and to average out the occasional single irregular beat (e.g. a benign premature contraction) that would otherwise look alarming in isolation.

This is a deliberate engineering trade-off: long enough for statistical confidence, short enough that users reliably hold still for the full recording.

R-R Interval Irregularity and the Missing P Wave — the AFib Signature

Atrial fibrillation replaces the atria's single coordinated electrical wave with hundreds of chaotic micro-wavelets firing at 350-600 times per minute. Two consequences follow directly: no discrete P wave ever forms, and the AV node lets ventricular beats through at unpredictable, "irregularly irregular" intervals — a pattern that is visually and statistically distinct from normal sinus rhythm.

  • ~50 ms: Normal RR variability (SDNN) (healthy sinus rhythm)
  • 350–600/min: AFib fibrillatory rate (chaotic atrial wavelets)
  • "Irregularly irregular": AFib RR pattern (no repeating pattern)
  • 0.97: Stanford DNN AFib AUC (Hannun et al., Nat. Med. 2019)

Two detection strategies: background tachogram vs. on-demand waveform

Wearables actually run two different AFib-screening algorithms:

• Background irregular-rhythm notifier (PPG-based): continuously samples pulse intervals from the optical heart-rate sensor between deliberate ECG readings. It only measures timing, not waveform shape, so it flags irregularity but cannot itself confirm AFib — it is a trigger to take an ECG.

• On-demand single-lead ECG classifier: analyzes the actual waveform captured during a 30-second recording, extracting both R-R interval statistics and searching for P waves — a much richer feature set than pulse timing alone.

Both converge on the same two core features: how irregular are the beat-to-beat intervals, and is a clean P wave present before each QRS.

Quantifying irregularity — from SDNN to Poincaré geometry

Algorithms typically summarize R-R interval irregularity with statistical measures borrowed from heart-rate-variability research:

• SDNN: the standard deviation of all R-R intervals in the recording — low and stable in sinus rhythm, elevated and unstable in AFib • Coefficient of variation (CV = SD/mean): normalizes variability against heart rate, since faster rates naturally have shorter, less variable intervals • Poincaré plot: each R-R interval is plotted against the interval that follows it (RRₙ vs RRₙ₊₁). Sinus rhythm — even with mild respiratory variation — clusters into a narrow, comet- or cigar-shaped ellipse along the diagonal. AFib scatters into a wide, structureless cloud because consecutive intervals share no predictable relationship.

This geometric fingerprint is one of the most robust, easily visualized features used in both classical rule-based detectors and modern learned classifiers.

P-wave detection is the harder, more fragile signal

The P wave is small — typically 5 to 10 times lower amplitude than the QRS spike — and easily buried in baseline noise, muscle artifact, or the fibrillatory "f waves" that AFib produces in its place. Detecting its confirmed absence (rather than just failing to find it due to noise) requires a high-quality, low-noise recording.

This is why irregularity-based screening (which only needs reliable R-peak timing) is used for always-on background monitoring, while P-wave-dependent waveform classification is reserved for deliberate, held-still, 30-second on-demand recordings.

Sinus Rhythm, AFib, or Inconclusive — Scoring the Recording

The final on-device step condenses 30 seconds of waveform into one of three outcomes plus a confidence estimate. Getting this right means the algorithm must be willing to say "inconclusive" rather than force a wrong answer on a noisy or ambiguous trace — a design choice that trades some sensitivity for trustworthiness.

  • ~98.3%: On-demand ECG sensitivity (AFib vs. sinus, validation study)
  • ~99.6%: On-demand ECG specificity (AFib vs. sinus, validation study)
  • 10–20%: Real-world inconclusive rate (noise / motion / low amplitude)
  • 22 yrs: Minimum labeled age (FDA-cleared indication)

From features to a decision: thresholds and confidence

Conceptually — and in the simplified model driving this simulation — the classifier combines two feature families into a decision:

• Low R-R variability + a clear P wave before every QRS → Sinus Rhythm • High, irregularly-irregular R-R variability + no discernible P wave → Atrial Fibrillation • Everything in between, or a signal too noisy to trust → Inconclusive

Production systems (Apple's, Fitbit's, AliveCor's KardiaMobile) use trained classifiers — historically rule-based and increasingly deep neural networks trained on large labeled ECG datasets — rather than a single hard threshold, but the underlying discriminating features are the same: interval regularity and P-wave morphology, each contributing to a confidence score rather than a binary cutoff.

Noise rejection — refusing to guess

A single noisy or motion-corrupted 30-second strip can mimic AFib's irregularity (motion artifact) or mask AFib's missing P wave (baseline wander). Rather than risk a false classification, cleared consumer ECG algorithms include an explicit signal-quality gate: if amplitude is too low, artifact too high, or heart rate outside a supported range, the result is reported as "Inconclusive" and the user is prompted to retake the recording.

In real-world deployment this inconclusive rate is meaningful — reported figures across studies range roughly 10-20% of attempted recordings, disproportionately in older users, those with tremor, or during motion.

What a single lead still cannot tell apart

Even a clean, high-confidence recording has structural limits. A single lead cannot reliably distinguish AFib from several look-alike rhythms:

• Atrial flutter: a regular "sawtooth" atrial rhythm that can appear irregular if AV conduction varies, sometimes misclassified either direction • Frequent premature atrial or ventricular contractions (PACs/PVCs): isolated extra beats that create short-term irregularity without being AFib • Multifocal atrial tachycardia: irregular P waves of varying morphology, easily confused with absent P waves at low signal quality • Sinus arrhythmia: a normal, regular pattern of heart rate rising and falling with breathing, which can register as mild irregularity

This is precisely why every cleared wearable ECG app carries labeling stating it is not a diagnostic replacement for clinical evaluation.

The FDA clearance for consumer ECG apps explicitly states the software "is not intended to replace traditional methods of diagnosis or treatment" and is indicated only as an adjunct for adults 22 and older who have not been previously diagnosed with AFib.

Clinical Validation and the Downstream Pathway to Diagnosis

A "possible AFib" tag on a wrist is a population-scale screening signal, not a clinical diagnosis. Two of the largest digital-health studies ever run — the Apple Heart Study and the Fitbit Heart Study — measured exactly how often these notifications are right, and clinical guidelines are explicit that confirmation with a 12-lead ECG or an ambulatory monitor must happen before any treatment decision, including starting anticoagulation.

  • 419,297: Apple Heart Study cohort (Perez et al., NEJM 2019)
  • 0.52%: Received irregular notification (~2,161 participants)
  • 0.84: Tachogram vs. ECG-patch PPV (irregular pulse notification)
  • 34%: AFib confirmed on ECG patch (of notified, patch-wearing group)

The Apple Heart Study — headline numbers and context

The Apple Heart Study (Perez et al., New England Journal of Medicine, 2019) enrolled 419,297 self-selected Apple Watch users over roughly 8 months and passively monitored their pulse for irregularity using the PPG-based tachogram algorithm.

Key results: • Only 0.52% of participants (~2,161 people) ever received an irregular pulse notification — a low rate reflecting a relatively young, self-selected, low cardiovascular-risk cohort rather than a general clinical population • Among the subset who then wore a 1-week ECG patch monitor, 34% showed AFib confirmed by the patch • The positive predictive value of the irregular-pulse tachogram algorithm against a simultaneous ECG-patch reading was 0.84 — meaning when the watch and a reference ECG were recording at the same moment, 84% of watch-flagged irregular readings corresponded to true AFib

The gap between the 34% eventual-confirmation figure and the 0.84 simultaneous-agreement figure illustrates an important nuance: AFib is often paroxysmal (comes and goes), so a notification today does not guarantee it will be captured in a monitor worn afterward, and a monitor capturing it later does not mean every notification was a true positive at the instant it fired.

A "possible AFib" notification is a screening trigger, not a diagnosis: it prompts confirmatory clinical testing — never a treatment decision — on its own.

The Fitbit Heart Study and cross-platform consistency

The Fitbit Heart Study (2022) enrolled roughly 455,000 participants using the same PPG-tachogram screening concept on Fitbit devices. It reported an irregular-rhythm notification rate of around 1% of participants, with a positive predictive value for AFib confirmation via a subsequent ECG patch reported near the high-90s percent range in the notified, confirmed subgroup — broadly consistent with the Apple Heart Study's conclusion that PPG-based screening, while imperfect, meaningfully enriches for true AFib compared to unscreened chance.

Both studies also underline the same statistical reality: because AFib prevalence is low in a broadly healthy screened population, even a specific test produces many notifications that never pan out clinically — a core reason clinical guidelines require confirmation rather than acting on the notification alone.

The clinical pathway after a positive screen

Professional cardiology guidelines (including AHA/ACC/HRS statements on wearable-detected arrhythmias) converge on the same downstream pathway:

1. Wearable flags irregular rhythm or records a possible-AFib ECG → the result is reviewed by the user, ideally shared with a clinician 2. Confirmatory 12-lead ECG: if the patient is symptomatic or the irregularity is currently present, a 10-second 12-lead recording in clinic can confirm AFib directly — but only captures rhythm at that instant 3. Ambulatory monitoring: if AFib is paroxysmal (comes and goes) and not present at the clinic visit, a Holter monitor (24-48 hours) or extended patch monitor (up to 14 days, e.g. Zio Patch) is used to catch an episode 4. Only after confirmation does a clinician consider treatment — rate or rhythm control medication, and critically, anticoagulation to prevent stroke, which carries real bleeding risk and should never be started from a wearable notification alone

The wearable's real clinical value is catching asymptomatic, otherwise-undetected AFib early enough to start this pathway — not replacing any step within it.

Screening and diagnostic modalities compared

ProductIndicationTrial DesignKey Result
Single-Lead Wearable ECG (on-demand)Sensitivity ~98%, Specificity ~99% vs. cardiologist readSpot-check, 30 sec, user-triggeredHigh accuracy per-reading, but only a snapshot
PPG Irregular Rhythm NotificationPPV ~0.84–0.98 vs. simultaneous ECG patchContinuous background pulse-timing analysisAlways-on population screening, not diagnostic
Clinical 12-Lead ECGReference-standard accuracy at moment of recording10 sec, 10 electrodes, in-clinicDiagnostic gold standard, but only a 10-second window
Ambulatory Holter / Patch MonitorSensitivity rises with wear duration (24 h–14 days)Continuous multi-day recordingBest at catching paroxysmal AFib missed by spot checks
⚙ Under the hood

Continuous ECG monitoring and machine learning-based detection of atrial fibrillation in real-time.

CanvasBiomedicine

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)