Lesson 5 of 15 · Level 1: Foundations

How HRV Is Measured: From Beats to a Number

Every HRV number is made in the same four steps: find each heartbeat, measure the gaps between them, throw out bad beats, and turn the remaining gaps into a number. This lesson walks through each step, with a calculation you can do on paper.

Key takeaways

  • Every HRV number comes from the gaps between heartbeats.
  • Chest straps read the heart's electrical signal. Rings and watches read the pulse with light.
  • Bad beats must be removed first, or the number can be badly wrong.
  • RMSSD is the typical size of the change from one gap to the next, in milliseconds.
  • Five minutes is the research standard, but RMSSD holds up well in much shorter recordings.

After this lesson you can

  • Describe how a chest strap (ECG) and a watch or ring (PPG) each find a heartbeat.
  • Calculate RMSSD by hand from five gaps between beats.
  • Explain why bad beats must be removed before HRV is calculated.
  • Explain why the length of a recording matters.

Every HRV number is made in the same four steps: find each heartbeat, measure the gaps between beats, throw out the bad beats, and turn the remaining gaps into one number. This lesson walks through each step, with a calculation you can do on paper.

In lesson 2 you saw the picture behind HRV: a line of gaps between beats that wiggles up and down. In lesson 4 you saw how one bad beat can throw the number off. Now you will see how a device gets from your heartbeat to the number on your screen.

Step 1: find each heartbeat

A device first has to know exactly when each beat happens. There are two main ways to do this.

ECG ECG A recording of the heart's electrical activity, taken with electrodes on the skin. ECG-based RR intervals are the reference standard for measuring HRV. More about ECG (chest straps and medical ECGs). Electrodes on the skin pick up the heart’s electrical signal. Every beat makes a tall, sharp spike called the R peak. Because the spike is so sharp, software can time it very precisely. That is why the ECG is the gold standard for HRV.

PPG PPG An optical method that shines light into the skin and detects the pulse of blood with each heartbeat. Most watches, rings and phone-camera apps use it to estimate HRV. More about PPG (watches, rings and phone cameras). An optical sensor shines light into the skin and measures how much comes back. With each heartbeat, a pulse of blood passes under the sensor and changes the signal. The device times each pulse wave instead of each electrical beat.

The pulse wave reaches your wrist or finger a moment after the heart beats. So, strictly speaking, optical devices measure pulse rate variability Pulse rate variability Variation in the time between pulse beats, measured optically by watches, rings and phone cameras. It closely tracks HRV at rest but drifts from it during movement. More about Pulse rate variability , not heart rate variability. At rest, the two agree well enough for most uses. Optical readings tend to show slightly more short-term variability than the ECG does, partly because breathing affects the pulse on its way to the skin. The match gets much worse when you move. Phone camera apps work on the same principle; see can a phone camera measure HRV.

Step 2: measure the gaps

Next, the device measures the time from each beat to the next, in milliseconds (ms). These are the RR intervals RR interval The time from one heartbeat to the next, measured in milliseconds between the R peaks of an ECG. HRV is calculated from a series of these intervals. More about RR interval you met in lesson 1. A short list might look like this:

810, 830, 790, 850, 820 ms

That is five gaps between six beats. The average gap is 820 ms, which works out to about 73 beats per minute.

Step 3: clean the list

Real recordings are messy. A device can:

  • miss a beat (one gap looks twice as long as it should)
  • count a beat that wasn’t there (one gap is split into two short ones)
  • catch a real extra beat from outside the normal pacemaker, an ectopic beat Ectopic beat A heartbeat that starts outside the heart's normal pacemaker and usually comes early. Ectopic beats are common, but they distort HRV unless removed or corrected. More about Ectopic beat
  • pick up noise from movement or a loose strap

Each of these creates a false jump between neighbouring gaps. As you saw in lesson 4, one such jump can multiply RMSSD RMSSD Root mean square of successive differences: an HRV metric built from how much each heartbeat interval differs from the next. It mainly reflects vagal activity. More about RMSSD many times over. In short recordings, even a few edited beats (under 5% of them) can change the result.

So before calculating, software looks for gaps that don’t fit and either removes them or fills them in with a best guess. The gaps that are left, between normal beats, are called NN intervals NN interval An RR interval between two normal heartbeats, after extra beats and measurement errors are removed. Most HRV metrics are calculated from NN intervals. More about NN interval (“normal-to-normal”). One cleaning method published in 2019 caught about 97% of real ectopic beats, and after correction the error in HRV measures was usually under 2%.

You never see this step. Your app does it quietly, using its own method. That is one reason two devices can give different numbers for the same night.

Step 4: turn the gaps into a number

Now for the maths. The main short-term HRV measure is RMSSD, short for “root mean square of successive differences”. The name sounds hard, but it is just four small steps, done in reverse order of the words.

Take our five gaps:

Gap (ms)Difference from the gap before (ms)Difference squared
810
830+20400
790−401,600
850+603,600
820−30900
  1. Successive differences. Subtract each gap from the next one: +20, −40, +60, −30.
  2. Square. Multiply each difference by itself: 400, 1,600, 3,600, 900. Squaring makes every value positive, so a drop counts as much as a rise. It also gives big jumps extra weight.
  3. Mean. Average the squares: 6,500 ÷ 4 = 1,625.
  4. Root. Take the square root: √1,625 ≈ 40.

RMSSD for these five gaps is about 40 ms. In plain words, from one beat to the next, the gap changed by about 40 ms on a typical step.

You’ll often see a second measure next to it, SDNN SDNN The standard deviation of all NN intervals in a recording, in milliseconds. It measures overall variability, and its value depends strongly on how long the recording lasts. More about SDNN . It is the standard deviation of all the gaps, which shows how spread out they are around their average. For our five gaps, SDNN is about 22 ms. Lesson 6 compares the two.

Go deeper The RMSSD formula in symbols

Write the gaps as RR₁, RR₂, … RRₙ. The successive differences are dᵢ = RRᵢ₊₁ − RRᵢ, and there are n − 1 of them.

RMSSD = √( (d₁² + d₂² + … + dₙ₋₁²) ÷ (n − 1) )

With our five gaps, n − 1 = 4 differences, so we divide the sum of squares (6,500) by 4. Real software runs this on cleaned NN intervals, using its own cleaning and averaging, so its result may not match a hand calculation exactly.

SDNN uses the distance of every gap from the average gap instead: square each distance, add them up, divide by n − 1, and take the square root. For 810, 830, 790, 850 and 820, the distances from 820 are −10, +10, −30, +30 and 0. The squares add up to 2,000, and √(2,000 ÷ 4) ≈ 22 ms.

How long to record

So far we used five gaps. Real recordings use many more, and the length matters.

In research, the usual standard for a short-term HRV recording is 5 minutes. Anything shorter is called ultra-short-term. 24-hour recordings are the standard for medical assessment.

RMSSD holds up well in short recordings. In a study of 70 healthy adults, RMSSD from just 1 minute, or even 10 seconds, matched the 5-minute value well. SDNN did not. A much larger study of 3,387 adults found the same: a single 10-second ECG gave a valid RMSSD, averaging three 10-second stretches was better, and 2 minutes was almost as good as the full 5.

Rings and watches that measure while you sleep each pick their own recording windows and their own way of combining them. That is another reason their numbers differ, which lesson 8 covers.

Where errors creep in

The problems below show up at step 1 or step 3:

  • Movement. It adds noise to both ECG and PPG, and hurts PPG most.
  • Poor contact. A loose strap or electrode, or a ring that slips, can miss beats.
  • Extra beats. If cleaning misses them, RMSSD shoots up.
  • Sensor type. Optical sensors measure the pulse, not the electrical beat, so they drift further from the ECG during activity.

If you want to compare devices, read is wrist HRV as accurate as a chest strap. For the bigger picture on methods and devices, see how to measure HRV.

That completes Level 1. In the next lesson, RMSSD, SDNN and lnRMSSD, you will compare the main HRV measures and learn which one your app likely shows.

Try this

Use these six gaps between beats: 900, 950, 880, 940, 910 and 930 ms. Work out RMSSD on paper using the four steps in this lesson. (Answer: about 50 ms. The differences are +50, −70, +60, −30 and +20.)

Check your understanding

The questions below are readable without JavaScript. Checking your answers needs JavaScript.

Question 1 What does the optical sensor on the back of a watch or ring actually detect?
Question 2 Why do apps remove some beats before they calculate HRV?
Question 3 The differences between neighbouring gaps are +10, −20 and +10 ms. What is RMSSD?
Question 4 What is the standard length of a short HRV recording in research?

Course map
  1. What Your Heartbeat Is Really Doing6 min
  2. What HRV Is, in One Picture6 min
  3. The Nervous System Behind HRV6 min
  4. Why Higher HRV Is Not Always Better6 min
  5. How HRV Is Measured: From Beats to a Number (you are here)6 min
  6. RMSSD, SDNN and lnRMSSD Explained6 min
  7. Comparing Your HRV to Norms: Age, Sex, Fitness6 min
  8. Why Your Devices Disagree on HRV5 min
  9. How to Take a Good HRV Reading5 min
  10. Building Your HRV Baseline and Reading Trends7 min
  11. What Moves HRV: The Factors That Matter Most6 min
  12. HRV for Training and Recovery6 min
  13. HRV, Stress and Breathing6 min
  14. HRV Limits, Myths and Red Flags5 min
  15. HRV Course Final Quiz and Recap3 min

Sources

  1. An Overview of Heart Rate Variability Metrics and Norms Frontiers in Public Health, 2017
  2. Role of editing of R-R intervals in the analysis of heart rate variability Frontiers in Physiology, 2012
  3. A robust algorithm for heart rate variability time series artefact correction using novel beat classification Journal of Medical Engineering & Technology, 2019
  4. How accurate is pulse rate variability as an estimate of heart rate variability? A review on studies comparing photoplethysmographic technology with an electrocardiogram International Journal of Cardiology, 2013
  5. Reliability of Ultra-Short ECG Indices for Heart Rate Variability Annals of Noninvasive Electrocardiology, 2011
  6. Validity of (Ultra-)Short Recordings for Heart Rate Variability Measurements PLOS ONE, 2015