The ECG Signal
An electrocardiogram (ECG) records the electrical activity of your heart. Each heartbeat produces a characteristic waveform with distinct components:
The PQRST Complex
| Wave | What it represents |
|---|---|
| P wave | Atrial depolarization (the atria contract) |
| QRS complex | Ventricular depolarization (the ventricles contract) |
| T wave | Ventricular 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.
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:
- Records raw ECG voltage over time
- Detects R-peaks using a peak-detection algorithm
- Calculates RR intervals from the peak timestamps
- Transmits data via Bluetooth Low Energy to your app
Artifacts & Cleaning
Not every detected beat is a real normal heartbeat. Common artifacts include:
- Ectopic beats — premature or delayed heartbeats
- Missed beats — the algorithm fails to detect an R-peak
- Motion artifacts — movement creates electrical noise
These are typically filtered out before HRV analysis, keeping only NN intervals (normal-to-normal).