ECG Basics & R-Peaks

How we detect heartbeats

The ECG Signal

An electrocardiogram (ECG) records the electrical activity of your heart. Each heartbeat produces a characteristic waveform with distinct components:

P Q R S T R RR Interval
A typical ECG waveform showing the P-QRS-T complex. The R-peak is the tallest point.

The PQRST Complex

WaveWhat it represents
P waveAtrial depolarization (the atria contract)
QRS complexVentricular depolarization (the ventricles contract)
T waveVentricular repolarization (ventricles recover)

The R-peak is the most prominent feature and easiest to detect. It marks the moment of ventricular contraction — essentially, a heartbeat.

From R-Peaks to RR Intervals

By detecting each R-peak in the ECG signal, we measure the time between consecutive beats. These RR intervals (also called NN intervals for "normal-to-normal") are the raw data for all HRV calculations.

R R R R R 810 ms 950 ms 820 ms 945 ms
Five R-peaks produce four RR intervals — these are the inputs to all HRV metrics

How Your Chest Strap Works

A BLE ECG chest strap uses two electrodes pressed against your skin to pick up the tiny electrical signals from your heart. The strap:

  1. Records raw ECG voltage over time
  2. Detects R-peaks using a peak-detection algorithm
  3. Calculates RR intervals from the peak timestamps
  4. Transmits data via Bluetooth Low Energy to your app
Why chest straps? Chest-mounted electrodes sit close to the heart and pick up a strong, clean signal. This makes R-peak detection much more reliable than wrist-based optical sensors (PPG).

Artifacts & Cleaning

Not every detected beat is a real normal heartbeat. Common artifacts include:

These are typically filtered out before HRV analysis, keeping only NN intervals (normal-to-normal).