Lesson 16 of 20 · Level 4: Analyst

From electrode to number: the signal chain

Every HRV number is the end of a chain: a sensor records a signal, a clock samples it, software finds each beat, cleaning removes the beats that are not normal, and what is left is the NN series every metric is computed from. Each link adds its own error, and the choices made at each link explain why two programs can disagree about one recording.

Key takeaways

  • An ECG at 1000 Hz times each beat to about 1 ms; at 250 Hz the error is about 4 ms. The error matters most when HRV is small.
  • A PPG wave is broad and its timing shifts with the vessels, so pulse intervals give pulse rate variability, close to HRV at rest and worse with movement.
  • One premature beat in a five-minute recording can raise RMSSD by more than half. Cleaning is not optional.
  • Deletion, interpolation and threshold rules each change the result in their own way. Reports should name the method and the share of beats changed.
  • Only normal sinus beats belong in the NN series. Every metric in the rest of this level starts from it.
After this lesson you can
  • Name the five links of the chain from sensor to NN series and the error each one adds.
  • Work out the timing error of a given sampling rate and judge when it matters.
  • Tell deletion, interpolation, threshold rules and automatic beat classification apart, and say what each does to RMSSD and to a spectrum.
  • Read a device or software description and spot which links it leaves out.

Every HRV number is the end of a chain. A sensor records a signal, a clock samples it, software finds each beat, a cleaning step removes the beats that are not normal, and what is left is the NN series every metric is computed from. Each link adds its own error, and the choices made at each link explain why two programs can disagree about one recording.

Levels 1 to 3 treated most of this chain as a black box. This level opens it. The worked examples use the teaching recording: five minutes of resting beats, 341 intervals, mean 881 ms (68 beats a minute), RMSSD RMSSD Root mean square of successive differences: an HRV metric built from how much each heartbeat interval differs from the next, in milliseconds. It mainly reflects vagal activity. More about RMSSD 33.4 ms, 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 28.7 ms. The same recording runs through lessons 17 to 19.

An 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 records the voltage between electrodes on the skin. Each beat produces a sharp spike, the R wave, whose peak makes a clear time stamp. A chest strap is a two-electrode ECG with the detection done on the strap.

0.98 s 1.06 s 0.95 s
An ECG of four heartbeats. The gap from one R peak to the next is the RR interval; HRV describes how much these gaps change.

An electrocardiogram trace with four tall spikes, the R peaks. The gaps between them are labelled 0.98, 1.06, 0.95 seconds, so no two gaps are the same.

A 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 sensor, the green or red light in a watch, ring or phone camera, measures how much light the blood under the skin absorbs. Each beat sends a pressure wave down the arteries, and the sensor sees it as a broad hump that arrives after the beat, once the wave has travelled down the arteries. The hump has no sharp edge, and the delay between the beat and the hump changes with vessel stiffness, posture and temperature. So the interval between two pulses is not quite the interval between two beats. The 2024 Psychophysiology guidelines describe PPG’s signal-to-noise ratio as much lower than ECG’s, with agreement at rest “good to acceptable” and worse during physical activity, varying between devices (Quigley and colleagues, 2024). The result is 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 , a close cousin of HRV. Our PPG guide goes through the wave, the sensor and what goes wrong.

1 2 3 4 1.00 s
  1. Systolic peak
  2. Dicrotic notch
  3. Diastolic peak
  4. Pulse-to-pulse interval, from one systolic peak to the next
Two pulse waves as a PPG sensor sees them. Each heartbeat makes a systolic peak (1), then the dicrotic notch (2) and a smaller diastolic peak (3) as the pressure wave reflects back from the lower body. A watch times the gap from one systolic peak to the next (4) to get the pulse-to-pulse interval. A teaching model, not a recording.

A smooth wave with two pulses. Each pulse rises steeply to a systolic peak, falls to a small dip called the dicrotic notch, rises again to a lower diastolic peak, and then settles back to the baseline. The gap between the two systolic peaks is marked as 1.00 seconds.

A digital recorder reads the signal at a fixed rate, the sampling rate Sampling rate How many times a second a sensor measures the signal, in hertz (Hz). It sets how precisely each beat can be timed: about ±1 ms at 1000 Hz, ±4 ms at 250 Hz and ±20 ms at a 25 Hz camera. More about Sampling rate , in samples a second (Hz). Between two samples nothing is known, so a peak can only be placed on the sample grid. The timing error of a single beat is about half the gap between samples:

Δt≈12fs\Delta t \approx \frac{1}{2 f_s}

Read it as: one second divided by the sampling rate is the gap between samples, and half of that is how far a true peak can sit from the nearest sample. An interval has two ends, so its error can reach a full gap. Quigley and colleagues (2024, section 3.1) quote that cautious figure, ±1 ms at 1000 Hz and ±4 ms at 250 Hz, and recommend 1000 Hz. Accounts of the Task Force (1996) figure differ: Catai and colleagues (2020), citing it, call 250 to 500 Hz the ideal range, while Peltola (2012) reads it as at least 500 to 1000 Hz. Laborde and colleagues (2017) advise at least 125 Hz, with 500 Hz as a conservative floor when the breathing swing is small, and note that interpolating the peak between samples lets the rate go lower still.

The error matters in proportion to the variability it hides. Here is the teaching recording with its intervals read off coarser and coarser clocks:

ClockGrid (ms)RMSSD (ms)SDNN (ms)
ECG, 1000 Hz133.428.7
ECG, 250 Hz433.528.8
Recorder, 125 Hz833.729.0
Camera, 25 frames4037.531.3

The last row is a phone camera at 25 frames a second with no interpolation between frames. With an RMSSD of 33.4 ms, a 4 ms grid changes almost nothing. A 40 ms grid adds about 4 ms of false variability, because rounding errors behave like extra noise. For a person whose RMSSD is 12 ms, that same noise would be a third of the signal. This is why camera and watch apps interpolate the peak between frames instead of using the raw frame time.

How finely each beat is timed

The teaching recording, resampled

Timing resolution
±0.5 ms
RMSSD, measured
33.4 ms
RMSSD, true
33.4 ms
SDNN
28.7 ms
pNN50
8.2 %

At 1000 Hz each beat is timed to the nearest millisecond. RMSSD matches the true value.

Shape of each beat

The controls work when JavaScript is on.

The teaching recording timed at different sampling rates. A device can only place a beat on one of its samples, so a slow rate rounds every beat time and adds jumps the heart never made; RMSSD measures exactly those jumps. Interpolating between samples helps when the beat's shape is wide enough to span several of them.

A line of the gap between beats over the first 60 seconds of the teaching recording, with the true timing dashed and the device's timing solid. Readouts give the timing resolution in milliseconds, RMSSD as measured and as it truly is, SDNN and pNN50. A slider sets the sampling rate from 1000 down to 25 Hz, two radio buttons choose a narrow ECG spike or a wide pulse wave, and a checkbox turns on interpolation between samples. At 1000 Hz the numbers match; at 25 Hz without interpolation RMSSD reads about a third too high.

Detection software marks a point on each beat. On an ECG that point is the top of the R wave, found by rules about height and slope, then refined by fitting a curve through the samples around the peak so the time stamp can fall between samples. On a PPG the point is the foot of the wave, its peak, or the steepest point of its rise, and the choice changes the intervals by a few milliseconds.

The guidelines agree that automatic detection should be followed by a look at the trace. Quigley and colleagues (2024) describe detection “followed by interactive visual inspection”, and Laborde and colleagues (2017) advise recording the ECG itself rather than relying on the intervals a strap or watch reports, so that the beats can be checked. A consumer device skips this step. That is one reason a research protocol can trust a number a watch cannot.

Three things go wrong in a beat series. A missed detection leaves one interval about twice as long as its neighbours. An extra detection splits one interval into two short ones. A premature (ectopic) beat, which comes from the heart rather than the software, gives a short interval followed by a long compensatory pause. All three must be found and dealt with, because the metrics assume every interval is a normal beat.

Here is what one premature 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 does. The teaching recording’s interval number 171 was 910 ms, followed by 877 ms. Making that beat come early at 60% of its interval gives 546 ms, and the next interval absorbs the rest, 1241 ms. The total time does not change. The metrics do:

SeriesRMSSD (ms)SDNN (ms) pNN50 pNN50 The percentage of neighbouring NN intervals that differ by more than 50 milliseconds. It tracks fast, vagally driven changes, like RMSSD, but as a share rather than a size. More about pNN50 (%)
Clean33.428.78.2
One premature beat57.939.29.1
Pair deleted33.628.88.3
Pair interpolated33.428.88.2
Local-median rule33.628.88.3

“Pair deleted” drops the two disturbed intervals; “pair interpolated” replaces both with the mean of their neighbours, 909 ms; the local-median rule is the one this site’s calculator uses, and here it dropped 2 intervals, 0.6% of the recording. One beat in 341 raised RMSSD by three quarters, because RMSSD squares each jump and a jump of 695 ms outweighs hundreds of jumps of 20 or 30 ms. Laborde and colleagues (2017) quote the same lesson from Berntson and Stowell: one heartbeat makes a difference. The methods for handling it have names, and a report should use them.

Deletion removes the bad intervals and closes the gap. It is tolerable for SDNN but it joins two intervals that were never neighbours, so the successive-difference measures and the spectrum see a false step. Peltola (2012) describes the step-like shape deletion leaves and the false LF LF power The variance of the heartbeat intervals that falls in the 0.04 to 0.15 Hz band, in ms²: rhythms repeating every 7 to 25 seconds. Once read as sympathetic activity, which is now disputed. More about LF power and HF HF power The variance of the heartbeat intervals that falls in the 0.15 to 0.40 Hz band, in ms²: the range of normal breathing. It mainly reflects vagal activity when breathing is 9 to 24 breaths a minute. More about HF power components it adds, and calls it unsuitable for the slow bands.

Interpolation replaces the bad intervals with values made from their neighbours: their mean (degree zero), a straight line (linear) or a smooth curve through the surrounding points (cubic spline). It keeps the beat count and the timing, which spectra need. Its cost is that it acts as a low-pass filter: every interpolated stretch is smoother than real beats, and linear and spline fills have been reported to raise LF and VLF power VLF power The variance of the heartbeat intervals in the 0.003 to 0.04 Hz band, in ms²: rhythms repeating every 25 seconds to 5 minutes. It needs at least a 5-minute recording and is best read over 24 hours. More about VLF power (Peltola, 2012). Salo and colleagues, cited in the same review, preferred interpolation to deletion for RMSSD and pNN50.

Threshold rules decide which intervals to replace. Kubios HRV’s threshold correction compares each interval with a local median and flags any that differ by more than a set amount: 0.45 s at the “very low” setting, 0.35 s “low”, 0.25 s “medium”, 0.15 s “strong” and 0.05 s “very strong”, scaled to the mean heart rate Mean RR The average time between heartbeats in a recording, in milliseconds. Heart rate is the same number upside down: 60,000 divided by the mean RR. More about Mean RR , then fills the flagged intervals by cubic spline (Kubios HRV User’s Guide, 2021). The setting matters, and so does checking it. Laborde and colleagues (2017) show a recording in which the automatic threshold correction, even at “very low”, flagged real beats as artifacts Artifact An error in a heartbeat recording, such as a missed, extra or mistimed beat, often caused by movement or poor sensor contact. Artifacts can badly distort HRV numbers. More about Artifact and shifted a vagal measure by 11%, and advise inspecting the ECG rather than trusting automatic correction alone. The HRV calculator on this site uses a range rule (300 to 2000 ms) and a local-median rule that drops any interval more than 25% from the median of its neighbours; in the table above it caught both disturbed intervals and nothing else. Dropping rather than filling is a choice made for a tool that reports time-domain measures; a spectrum would want the fill.

Automatic beat classification looks at the differences between successive intervals (the dRR series) instead of the intervals themselves. Kubios’s method, in the Premium edition, sets a threshold for each beat from the quartile deviation of the surrounding 90 beats multiplied by 5.2, then looks for the shapes an artifact makes in the dRR series: an ectopic beat gives a negative-positive-negative or positive-negative-positive pattern, a long interval positive-negative and a short one negative-positive. Missed and extra beats are found by comparing intervals with the median of the surrounding 10 (Kubios HRV User’s Guide, 2021). On recordings with real atrial and ventricular ectopic beats the published algorithm found 96.96% of them with a specificity of 99.94%. With simulated missed and extra beats, the error in HRV measures after correction was below 2%, rising to just under 8% for the smallest timing displacements (Lipponen and Tarvainen, 2019).

Clean one bad beat

The teaching recording, 341 intervals

Flagged: 1 of 341 intervals

Measure Clean Bad beat Fixed
RMSSD (ms) 33.4 70.2 70.2
SDNN (ms) 28.7 51.7 51.7
pNN50 (%) 8.2 8.8 8.8
LF power (ms²) 120 1241 1241
HF power (ms²) 635 2314 2314

A missed beat makes one interval about twice as long as its neighbours. Left in, it lifts RMSSD from 33.4 to 70.2 ms, 2.1 times the true value, while SDNN moves less.

The buttons work when JavaScript is on.

One bad beat in the five-minute teaching recording. The rule flags any interval more than 250 ms from the median of its neighbours; the method you pick repairs it. Compare the numbers before and after with the clean recording.

A line of the gap between beats over the first 60 seconds of the teaching recording, with the planted artifact as a spike, a circle on each flagged interval and the corrected line drawn over it. A table gives RMSSD, SDNN, pNN50, LF power and HF power for the clean recording, with the artifact left in, and after correction, plus how many intervals were flagged. One group of buttons plants a missed beat, an extra beat or an ectopic beat, or restores the clean recording; another chooses the correction method: leave it in, delete, mean of neighbours, linear interpolation or cubic spline. A missed beat left in roughly doubles RMSSD; every method brings it back within a few percent.

Go deeper How much editing is too much?

There is no agreed limit. Peltola (2012) reports that most investigators require at least 80% normal intervals, that published studies edited anywhere from 1% to 30% of beats, and that in short recordings even under 5% of edited intervals measurably shifts HF, LF, pNN50 and RMSSD. Quigley and colleagues (2024) ask authors to report the number of beats deleted or replaced and any gap longer than 5 seconds, and to test the effect of editing whenever it exceeds 1%. Catai and colleagues (2020) ask for the number of beats omitted and interpolated to be stated. In a study that used HRV to find an exercise threshold, two of 17 participants were excluded for frequent ectopy and the analysed segments held 0 to 3% artifacts (Rogers and colleagues, 2021, cited in lesson 19). The practical rule: a recording with more than a few percent of corrected beats should be read with suspicion, whatever the software did to it.

What survives cleaning is a list of intervals between normal sinus beats, the NN series (Task Force, 1996). “NN” rather than “RR” makes the point that only normal sinus beats remain (Peltola, 2012); apps use the two labels loosely, and Kubios calls the same thing the IBI 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 (inter-beat interval) series.

Two properties of this list shape everything that follows. First, it is indexed by beat, not by time: interval 100 happened about 88 seconds in, interval 200 about 176 seconds in, and a faster heart packs more intervals into a minute. Time-domain measures (lesson 17) do not care. Frequency measures (lesson 18) do, which is why the series is resampled onto a regular clock before a spectrum is made. Second, its length depends on heart rate: five minutes at 68 beats a minute gives 341 intervals; at 50 beats a minute it would give about 250. A rule stated in beats and a rule stated in seconds are not the same rule.

What this means for a wearable

A watch, a ring and a chest strap on the same person run three different chains: different sensor, different sampling rate, different detection point and different cleaning, none of it visible to you. Lesson 8 listed the reasons devices disagree; this lesson is the mechanism behind two of them. When a maker says its HRV is “validated”, the question is which links of the chain were tested against what. Lesson 20 shows how to read such a claim.

Next, lesson 17 takes the NN series and works through every time-domain, geometric and Poincaré measure built on it.

Try this

Open the HRV calculator, paste the sample recording, and note RMSSD. Then edit one interval in the text to 60% of its value and add the difference to the next one. Run it again and compare the number before and after the calculator's own cleaning.

Check your understanding

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

Question 1 An ECG samples at 250 Hz. How precisely can it time each R peak without interpolation?
Question 2 In the worked example, one premature beat was added to the five-minute teaching recording. What happened to RMSSD before any cleaning?
Question 3 Why do guidelines advise against simply deleting a bad interval before a frequency analysis?
Question 4 Which beats belong in the NN series that HRV metrics are computed from?
Question 5 A watch measures HRV from its light sensor. Compared with an ECG, when does its pulse-based estimate hold up best?

Course map
  1. What your heartbeat is really doing6 min
  2. What HRV is, in one picture6 min
  3. The nervous system behind HRV8 min
  4. Why higher HRV is not always better8 min
  5. How HRV is measured: from beats to a number10 min
  6. RMSSD, SDNN and lnRMSSD explained9 min
  7. Comparing your HRV to norms: age, sex, fitness8 min
  8. Why your devices disagree on HRV6 min
  9. How to take a good HRV reading7 min
  10. Building your HRV baseline and reading trends8 min
  11. What moves HRV: the factors that matter most7 min
  12. HRV for training and recovery6 min
  13. HRV, stress and breathing9 min
  14. HRV limits, myths and red flags6 min
  15. HRV course final quiz and recap3 min
  16. From electrode to number: the signal chain (you are here)10 min
  17. The whole metric family9 min
  18. Frequency analysis without the fog10 min
  19. Nonlinear measures: DFA, entropy and what they add8 min
  20. How to read an HRV study or a device validation10 min

Sources

  1. Heart rate variability: standards of measurement, physiological interpretation and clinical use Circulation (Task Force of the European Society of Cardiology and the North American Society of Pacing and Electrophysiology), 1996
  2. Publication guidelines for human heart rate and heart rate variability studies in psychophysiology, Part 1: physiological underpinnings and foundations of measurement Psychophysiology, 2024
  3. Heart rate variability: are you using it properly? Standardisation checklist of procedures Brazilian Journal of Physical Therapy, 2020
  4. Heart rate variability and cardiac vagal tone in psychophysiological research: recommendations for experiment planning, data analysis, and data reporting Frontiers in Psychology, 2017
  5. Role of editing of R-R intervals in the analysis of heart rate variability Frontiers in Physiology, 2012
  6. A robust algorithm for heart rate variability time series artefact correction using novel beat classification Journal of Medical Engineering and Technology, 2019
  7. Kubios HRV User's Guide, version 3.5 Kubios Oy, 2021