← Tepna preprints

Three independent detectors, one tachogram: RR-, ECG- and optical rMSSD agree in bias, but the optical arm carries several-fold wider limits of agreement

Michal Planicka  ·  corresponding author — Tepna Project

PulseDex · ECGDex · PpgDex nodes, Tepna physiological-signal suite

Draft v2 · July 2026 · generator synth-gen 2.1 / cohort-gen 1.9 · Analysis tool: qrs-equiv-analysis.html · Detectors: real pulsedex-dsp.js · ecgdex-dsp.js · ppgdex-dsp.js · FULL lane · 100% local, reproducible

Revision note: re-run on the broadband RR texture (synth-gen 2.1). The earlier draft's headline optical divergence (bias +32%, r 0.57) did not survive the realistic texture: with richer true beat-to-beat variability, the fixed pulse-arrival-time jitter adds a far smaller relative offset. The optical bias collapses to ≈+1% and the correlation rises to 0.92; the surviving optical signature is wider limits of agreement, not a bias.

Abstract

Background. The suite derives the same time-domain HRV metric, rMSSD, from three different inputs — recorded RR intervals (PulseDex), the raw ECG (ECGDex, Pan–Tompkins), and the optical pulse (PpgDex). Whether those numbers are interchangeable determines whether they can be pooled, substituted, or fused. Methods. On the FULL-lane waveform harness, one ~9-minute apnea-cluster window per synthetic patient (240 patients, 220 valid windows) was scored for rMSSD by all three production detectors on the same co-generated beats: PulseDex reads the ground-truth RR (the reference), ECGDex re-derives it from the raw int16 ECG at 130 Hz, and PpgDex from the 176 Hz optical pulse. We report pairwise Bland–Altman agreement. Results. ECGDex and PulseDex were statistically interchangeable: bias −0.02 ms (−0.04%), 95% limits of agreement −0.4…+0.3 ms, Pearson r 0.9999 — two detectors sharing no code, signal, or sampling rate recover the identical tachogram, the 130 Hz + QRS-detection floor adding only ≈0.18 ms SD. PpgDex was essentially unbiased but noisier: bias +0.3 ms (+0.7%), limits −7.5…+8.1 ms (≈22× wider than the electrical floor), r 0.93. The optical-only dispersion — the quadrature excess over the electrical floor — was ≈4.0 ms, i.e. essentially all of the PPG disagreement is pulse-arrival-time jitter that inflates the scatter of the optical estimate without shifting its centre. Conclusion. RR- and ECG-derived rMSSD are interchangeable and may be pooled or cross-validated; optical rMSSD is now unbiased on average and strongly correlated, so it can be used as an HRV estimate, but its several-fold wider limits of agreement mean an individual optical reading is materially less precise — it should be down-weighted (not equally averaged) in fusion and its per-window uncertainty carried through. Synthetic ground truth: this certifies cross-detector agreement and quantifies each modality's intrinsic dispersion — it is not a real-patient equivalence study.

Keywords: heart-rate variability · rMSSD · pulse-rate variability · photoplethysmography · QRS detection · Bland–Altman · pulse-arrival-time · method comparison · sensor fusion

0. Layman overview (delete before submission)

The app calculates the same heart-rhythm score (“rMSSD”) from three different sources: a recorded list of heartbeat intervals, a raw ECG trace, and the optical (blood-flow) pulse. The question: are those three numbers the same number, so they can be mixed and matched?

Answer: the ECG and the interval-list agree almost perfectly — different code, different signal, yet essentially identical results, so they're interchangeable. The optical pulse now lands on the same average number — within about 1% — but it is much shakier reading to reading: the time it takes blood to reach your wrist wobbles beat to beat, which spreads its score out (its beat-to-beat error band is roughly 22 times wider than the ECG's) even though it no longer runs high. This is a change from our earlier draft: once we made the simulated heart rhythm more realistically textured, the optical score stopped being systematically too high. The takeaway for the software: the optical heart-rhythm number is usable as an HRV estimate, but because a single reading is noisier, give it less weight when combining sensors and carry its wider uncertainty through. (Simulation with shared, known beats — it proves which detectors agree and why, not exact human magnitudes.)

1. Introduction

rMSSD — the root mean square of successive RR differences — is the suite's workhorse short-term HRV metric, and three nodes compute it from three different front ends: PulseDex from a recorded RR series, ECGDex from the raw electrocardiogram, and PpgDex from the wrist/finger optical pulse. Downstream code routinely treats these as one number: pooling them across a cohort, substituting whichever is available, or fusing them into a single autonomic estimate. That is only valid if the three agree. Two of them recover beats electrically or from the interval stream; the third recovers them from a peripheral pressure wave whose timing, relative to the heartbeat, varies beat to beat (pulse-arrival-time, a function of blood pressure and vascular tone). rMSSD is by construction maximally sensitive to exactly that beat-to-beat timing jitter, so the optical estimate may not be interchangeable with the electrical ones even when both detectors are working perfectly.

We test interchangeability directly. Because all three detectors here score the same underlying beats, any disagreement is attributable to the front end — sampling rate, detector behaviour, or (for the optical arm) pulse-arrival-time jitter — rather than to different recordings. Bland–Altman quantifies the bias and the limits of agreement for each pair, and contrasting the optical pair against the electrical pair isolates the pulse-arrival-time component.

2. Methods

2.1 Shared-beat design

The FULL lane renders, per patient, one ~9-minute window centred on an apnea cluster, in each modality's native raw form, from one shared master event timeline — so the RR beat train is identical across modalities. PulseDex is given the window's ground-truth RR (artifact-cleaned) and serves as the reference. ECGDex re-derives beats from a raw int16 µV ECG at 130 Hz with its production Pan–Tompkins pipeline; the renderer places each R-peak at its true beat time, so detected R-to-R intervals equal the true RR up to 130 Hz quantization. PpgDex re-derives beats from the 176 Hz optical pulse with its production foot/peak detector. No detector parameters were altered; timestamps follow the suite Clock Contract. Each detector is loaded in its own realm (PulseDex in the shipped single-node harness; ECGDex and PpgDex in a FULL-lane worker) so the plain-global DSP files never share scope.

2.2 Agreement statistics

For each detector pair we compute Bland–Altman agreement on the per-window rMSSD: the mean difference (bias), its standard deviation, the 95% limits of agreement (bias ± 1.96 SD), the percentage bias relative to the reference mean, and the Pearson correlation. The optical-only dispersion is the quadrature excess of the PPG−Pulse standard deviation over the ECG−Pulse standard deviation, √(SD²₍PPG−Pulse₎ − SD²₍ECG−Pulse₎), which removes the sampling-plus-detection floor common to both and leaves the pulse-arrival-time component. The run reported here covers 240 sampled patients (220 valid windows with all three rMSSD values).

3. Results

Table 1. Pairwise rMSSD agreement (Bland–Altman; 220 shared-beat windows; real detectors, synthetic ground truth).
PairnBias (ms)Bias (%)SD (ms)95% LoA (ms)Pearson r
ECGDex − PulseDex220−0.02−0.04%0.18−0.37 … +0.340.9999
PpgDex − PulseDex220+0.29+0.71%3.96−7.48 … +8.060.925
PpgDex − ECGDex220+0.31+0.75%3.96−7.46 … +8.070.925

3.1 RR and ECG are interchangeable

ECGDex and PulseDex agreed almost exactly: a bias of −0.02 ms (−0.04% of the reference mean), 95% limits of agreement of just −0.4 to +0.3 ms, and a Pearson correlation of 0.9999. These are two detectors that share no source code, no input signal (raw ECG vs an RR list), and no sampling model, yet they recover the identical tachogram; the 130 Hz sampling and the Pan–Tompkins detection together inject only ≈0.18 ms of beat-to-beat dispersion. RR- and ECG-derived rMSSD are, for practical purposes, the same number — they can be pooled across the two nodes and used to cross-validate one another.

Agreement scatter vs PulseDex; Bland–Altman PPG−Pulse; Bland–Altman ECG−Pulse
Figure 1. Three-way rMSSD agreement on shared beats (live output of qrs-equiv-analysis.html, synth-gen 2.1 / cohort-gen 1.9). Top: each detector's rMSSD vs the PulseDex reference — ECGDex (blue) lies on the identity line, PpgDex (amber) now scatters symmetrically about it rather than sitting systematically above. Middle: Bland–Altman PpgDex − PulseDex — bias +0.3 ms centred on zero with wide limits of agreement (−7.5…+8.1 ms), the signature of pulse-arrival-time jitter as a variance term. Bottom: Bland–Altman ECGDex − PulseDex on a much finer axis — a tight cluster on zero (±0.4 ms), the sampling-plus-detection floor. The ≈22× difference in limit width between the two panels is the optical-only dispersion. Dark theme is the tool's native rendering.

3.2 The optical pulse is unbiased on average but several-fold noisier

PpgDex agreed with both electrical detectors in the mean (it agrees with whichever electrical arm, since those agree with each other): a bias of +0.3 ms (+0.7%) — negligible — and a correlation of 0.93. What separates it from the electrical arm is scatter, not offset: its 95% limits of agreement were −7.5 to +8.1 ms, roughly twenty-two times wider than the ECG–RR limits. The optical-only dispersion, after removing the sampling-plus-detection floor in quadrature, was ≈4.0 ms: essentially the entire PPG disagreement is pulse-arrival-time jitter, and it now shows up as a symmetric variance term around zero rather than a systematic inflation. Beat-to-beat variation in how long the pulse takes to reach the periphery adds real per-beat timing noise to the optical inter-beat series that is absent from the electrical one; it widens the optical rMSSD distribution without, on this texture, shifting its centre.

Change from the earlier draft. On the previous single-relaxor RR texture the true beat-to-beat variability was small, so the fixed pulse-arrival-time jitter dominated the optical rMSSD and inflated it by ≈+32% (r 0.57). Under the realistic broadband texture (synth-gen 2.1) the true successive-difference variance is much larger, so the same PAT jitter adds a far smaller relative quantity: in quadrature, √(true² + PAT²) − true shrinks as the true term grows. The optical bias therefore collapses to ≈+1% and correlation rises to 0.93, while the absolute PAT-jitter dispersion (≈4.0 ms) persists as wider limits of agreement. The robust conclusion is unchanged in kind — the optical arm carries an extra PAT-jitter dispersion the electrical arm does not — but its practical severity is now a precision penalty, not a bias.

4. Discussion

The practical rule is asymmetric. RR- and ECG-derived rMSSD are interchangeable: a fusion layer can treat them as one measurement, pool them, or use either to validate the other (the 0.9999 agreement is, in effect, a cross-node regression test for the HRV pipeline). Optical rMSSD is now unbiased on average and strongly correlated (r 0.93), so it is a usable HRV estimate rather than a foreign quantity — but it is not equivalent in precision: its limits of agreement are several-fold wider, so a single optical reading carries materially more uncertainty. In fusion it should therefore be down-weighted relative to an available electrical arm (weighted by its wider variance, not averaged in as an equal), and its per-window uncertainty propagated rather than discarded; and because the label matters, it should still be reported as pulse-rate variability. The earlier finding that the optical arm also mildly over-detects and loses beats under apnea (companion preprint, qrs-yield.html) adds a second, yield-driven error term on top of the PAT-jitter dispersion, so the electrical arm remains the clean HRV reference.

Limitations. This is synthetic ground truth. The pulse-arrival-time jitter that drives the PPG dispersion is the magnitude built into the generator's optical model, so the exact ≈4.0 ms PAT-jitter SD (and hence the ≈22× limit-width ratio) is not a measured human figure — the robust results are the near-perfect RR–ECG equivalence and the qualitative optical penalty that is a variance term (wider limits) rather than a bias. The disappearance of the earlier +32% optical bias is itself a demonstration that a bias which looks like a fixed property of the sensor can in fact be an artifact of how much true beat-to-beat variability the reference carries. A residual optical over-detection (precision ≈92%; companion preprint) contributes a small part of the PPG dispersion alongside PAT jitter. One ~9-minute window per patient bounds runtime but limits per-window precision. A real equivalence study needs simultaneous chest-ECG and finger/wrist-PPG with a shared clock under a range of autonomic states; this harness certifies the cross-detector pipeline and motivates that measurement rather than replacing it.

5. Reproducibility

6. Sample size & statistical power

Like its companion, this is a FULL-lane waveform pilot — raw ECG + optical rendered and scored per patient — so runtime, not statistics, is the constraint and 100k-scale is impractical. The agreement estimates (bias, limits of agreement, Pearson r) are per-window comparisons; their precision improves as ~1/√N_windows. Because the RR–ECG agreement is near-perfect and the optical precision penalty (its several-fold wider limits) is large, both conclusions are unmistakable at modest N.

Table 2. Sample-size guidance for this FULL-lane pilot (patients → ~1 shared-beat window each).
TierPatientsWhat it buys
Minimum (acceptable)~30Both verdicts clear: RR–ECG limits of agreement <±1 ms, optical bias ≈0 with ≈22× wider limits. Pearson r stable to ≈±0.03.
Recommended~100–240Bland–Altman limits and r to ≈±0.01; clean three-panel agreement figure. This run used 240 (220 valid shared-beat windows).
This run240220 windows with all three rMSSD values; RR–ECG r = 0.9999, optical r = 0.93.
Diminishing returns> ~200The two limits-of-agreement bands are already separated by ~22×; more single windows only add FULL-lane hours. Greater value comes from varying autonomic state / window length than from more patients.

Practical reading: ~30 patients to settle interchangeability, ~60–100 for tight published limits of agreement; beyond ~200 the FULL-lane cost dominates — vary autonomic state and window length rather than adding patients.

References

  1. Project documentation: CLAUDE.md (Clock Contract, evidence-grade system), COHORT-VALIDATION-README.md, PAPERS-AND-FIXES-BRIEF.md, Tepna suite.
  2. Bland JM, Altman DG. Statistical methods for assessing agreement between two methods of clinical measurement (full citation to be added at submission).
  3. Standard references on pulse-rate variability vs heart-rate variability and pulse-arrival-time / pulse-transit-time variability — to be added at submission.
  4. Companion preprints: qrs-yield.html (modality-asymmetric beat-yield), cgm-hrv-coupling.html (cross-node coherence), Tepna working preprint series.
T © 2026 Michal Planicka ·Tepna v1.0.0 ·Apache-2.0 ·◈ Asheville, NC ·not a medical device