Detrending

Also called detrend, smoothness priors, trend removal

Removing the slow drift from a series of beat intervals before a spectrum is calculated, so the drift does not pile up as false power in the lowest frequencies.

Over a few minutes, your heart rate rarely holds perfectly level. It creeps down as you settle, or up as you shift position. On a chart of the gaps between beats that shows as a slow slope or bend under the faster breathing wave. Detrending finds that slow part and subtracts it.

The simplest method takes away a straight line. The HRV calculator on this site uses the smoothness-priors method of Tarvainen, Ranta-aho and Karjalainen (2002), which works like a high-pass filter that bends with the data: it follows the drift and leaves faster rhythms alone. The calculator sets its smoothing parameter λ to 500.

Why it matters for HRV. A spectrum splits the series into rhythms of different speeds. A drift is the slowest rhythm of all, so if it stays in, it lands as false power in VLF 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 and spills into 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 . 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 , NN50 NN50 The number of pairs of neighbouring NN intervals that differ by more than 50 milliseconds. Dividing it by the number of intervals gives pNN50. More about NN50 and 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 hardly notice trends, because they only compare neighbouring beats (Shaffer and Ginsberg, 2017), which is one more reason RMSSD is the everyday measure. Too strong a detrend removes real slow rhythms, so two programs with different settings can report different LF power for the same recording.

Taking the trend out

The teaching recording, altered

Top: the teaching recording with a slow wander added, and the trend the smoothness-priors method finds in it (dashed). Bottom: the same recording with the trend taken away. The breathing wave is untouched; only the drift that would spill into the lowest frequencies is gone.

Two line charts of the gap between beats over five minutes. The top one wanders slowly up and down with a dashed trend line following the wander; the bottom one is flat around zero with only the fast breathing wave left.

The page on stationarity explains the assumption that detrending tries to protect.

Sources

  1. An advanced detrending method with application to HRV analysis IEEE Transactions on Biomedical Engineering, 2002
  2. An Overview of Heart Rate Variability Metrics and Norms Frontiers in Public Health, 2017

All glossary terms