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.
Link 1: the signal, electrical or optical
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.
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.
- Systolic peak
- Dicrotic notch
- Diastolic peak
- Pulse-to-pulse interval, from one systolic peak to the next
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.
Link 2: the clock
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:
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:
| Clock | Grid (ms) | RMSSD (ms) | SDNN (ms) |
|---|---|---|---|
| ECG, 1000 Hz | 1 | 33.4 | 28.7 |
| ECG, 250 Hz | 4 | 33.5 | 28.8 |
| Recorder, 125 Hz | 8 | 33.7 | 29.0 |
| Camera, 25 frames | 40 | 37.5 | 31.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.
The controls work when JavaScript is on.
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.
Link 3: finding each beat
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.
Link 4: cleaning, with the methods named
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:
| Series | RMSSD (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 (%) |
|---|---|---|---|
| Clean | 33.4 | 28.7 | 8.2 |
| One premature beat | 57.9 | 39.2 | 9.1 |
| Pair deleted | 33.6 | 28.8 | 8.3 |
| Pair interpolated | 33.4 | 28.8 | 8.2 |
| Local-median rule | 33.6 | 28.8 | 8.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.
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.
Link 5: the NN series
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.