Time Domain Analysis Methodology in LensHRV

Engineering decisions behind BPM, RMSSD, SDNN, and SI

Capturing Heart Rate Variability (HRV) with photoplethysmography (PPG) is highly susceptible to beat loss. This document details the technical path and engineering decisions behind LensHRV for time-domain metrics.

LensHRV reports BPM, RMSSD, SDNN and Baevsky’s Stress (SI).

1. The Zaragoza study and what it means for time domain

LensHRV anchors missing-data decisions in the work of Cajal and colleagues (University of Zaragoza / I3A, 2022) on the effect of missing data on HRV metrics.

In that study, clean signals are subjected to controlled losses and common corrections are compared—from outlier removal without filling gaps, to linear and nonlinear interpolations (including Hermite), and model-based approaches where relevant.

The key discovery for time domain is the opposite emphasis of the frequency case:

Frequency domain: gap filling is mandatory so the spectrum is not destroyed by holes in the series.

Time domain: any method of interpolation is not beneficial. Removing outliers / discarding bad intervals and working with the remaining joined series is superior.

2. Validation and choice of a practical loss limit

The acceptance contract is the same as in the frequency methodology and taken from Zaragoza: for each metric, relative error is measured against the clean reference signal, errors are summarized with the third quartile (Q3 / 75th percentile), and a condition is accepted only when Q3 stays below 20%.

To avoid adopting a product threshold only from bibliography, that contract was reapplied on the same control set used for frequency: 16 clean PPG sessions free of missing beats and with full 120 s coverage. On each session, scattered losses were injected with independent Bernoulli trials at fixed deletion probabilities of 15%, 20%, 25%, and 30%—like flipping a coin on every beat—with 10 independent random repetitions per session. Time-domain metrics were recomputed on each trial, percentage errors ranked, and Q3 extracted under the same pass rule (Q3 < 20%).

A) Evaluation at 15% loss (p = 0.15)

runs = 10 · sessions = 16 · Q3 (p75) · pass if Q3 < 20%

id RMSSD SDNN SI BPM
19.4(P)3.3(P)4.9(P)0.0(P)
214.4(P)2.1(P)8.7(P)0.0(P)
312.2(P)2.2(P)7.8(P)1.7(P)
49.4(P)1.9(P)11.0(P)0.0(P)
518.3(P)2.7(P)6.0(P)0.0(P)
612.4(P)3.2(P)11.2(P)1.5(P)
75.8(P)1.7(P)6.0(P)0.0(P)
85.3(P)2.2(P)5.4(P)0.0(P)
98.0(P)4.3(P)7.3(P)0.0(P)
107.9(P)2.4(P)10.6(P)1.3(P)
118.9(P)2.0(P)5.6(P)0.0(P)
129.1(P)3.3(P)6.2(P)1.4(P)
1315.5(P)2.3(P)3.7(P)0.0(P)
1411.7(P)2.6(P)4.4(P)0.0(P)
1510.1(P)1.6(P)2.8(P)1.1(P)
165.1(P)2.0(P)9.1(P)0.0(P)

(P) pass · (F) fail · Q3 relative error (%)

BPM, SDNN, and SI (100% pass): absolute precision is retained at 15% loss, with Q3 errors of 0.0%–1.7% in BPM, 1.6%–4.3% in SDNN, and 2.8%–11.2% in SI versus the clean signal. RMSSD also passed 100% of sessions, ranging from 5.1% to 18.3% with no failures.

B) Evaluation at 20% loss (p = 0.20)

id RMSSD SDNN SI BPM
112.9(P)1.8(P)6.0(P)0.0(P)
220.2(F)1.6(P)14.3(P)0.0(P)
315.5(P)2.7(P)7.0(P)1.7(P)
413.3(P)2.3(P)11.8(P)0.0(P)
525.7(F)3.5(P)8.3(P)0.9(P)
617.0(P)3.8(P)9.5(P)1.5(P)
79.0(P)3.1(P)7.7(P)0.0(P)
88.4(P)3.0(P)6.0(P)0.0(P)
96.8(P)5.9(P)18.2(P)0.0(P)
1011.0(P)2.7(P)9.3(P)0.0(P)
1112.1(P)2.4(P)7.0(P)0.0(P)
1212.3(P)3.8(P)7.4(P)1.4(P)
1323.5(F)1.7(P)5.1(P)0.0(P)
1414.4(P)2.5(P)5.1(P)0.0(P)
1512.4(P)2.1(P)3.2(P)1.1(P)
167.4(P)2.3(P)34.2(F)0.0(P)

(P) pass · (F) fail · Q3 relative error (%)

BPM and SDNN retain absolute precision versus the clean signal, with Q3 errors of only 0.0%–1.7% in BPM and 1.6%–5.9% in SDNN. SI (93.8% pass) keeps high tolerance with only one failure, while RMSSD (81.3% pass) is the most sensitive metric, with three failures.

C) Evaluation at 25% loss (p = 0.25)

id RMSSD SDNN SI BPM
116.7(P)3.6(P)4.7(P)0.0(P)
225.0(F)2.9(P)18.8(P)0.0(P)
319.8(P)2.3(P)10.1(P)1.7(P)
417.7(P)4.0(P)12.0(P)0.0(P)
531.4(F)3.7(P)8.7(P)0.9(P)
621.8(F)5.0(P)8.9(P)1.5(P)
712.0(P)3.5(P)6.3(P)0.0(P)
811.6(P)3.0(P)6.4(P)0.0(P)
912.0(P)5.4(P)17.5(P)0.0(P)
1013.7(P)3.0(P)10.2(P)0.0(P)
1113.5(P)2.8(P)7.9(P)0.0(P)
1214.5(P)3.8(P)17.6(P)1.0(P)
1326.4(F)1.9(P)4.4(P)0.0(P)
1416.2(P)3.1(P)5.0(P)0.0(P)
1515.8(P)2.7(P)2.8(P)1.1(P)
1610.3(P)3.5(P)33.7(F)0.0(P)

(P) pass · (F) fail · Q3 relative error (%)

BPM and SDNN (100% pass): absolute precision is retained at 25% loss, with Q3 errors of only 0.0%–1.7% in BPM and 1.9%–5.4% in SDNN versus the clean signal. SI (93.8% pass) holds stability with only one failure, while RMSSD (75.0% pass) continues to decline.

D) Evaluation at 30% loss (p = 0.30)

runs = 10 · sessions = 16 · Q3 (p75) · pass if Q3 < 20%

id RMSSD SDNN SI BPM
117.1(P)2.2(P)5.9(P)0.0(P)
227.5(F)2.6(P)19.1(P)1.3(P)
319.4(P)2.9(P)11.6(P)1.7(P)
420.2(F)4.2(P)13.0(P)0.0(P)
539.2(F)3.4(P)7.2(P)1.2(P)
628.0(F)4.6(P)11.4(P)1.5(P)
710.4(P)3.3(P)8.0(P)0.0(P)
813.0(P)3.3(P)8.8(P)0.0(P)
913.6(P)5.1(P)16.4(P)0.0(P)
1019.6(P)3.4(P)12.8(P)1.0(P)
1117.1(P)2.8(P)10.2(P)0.0(P)
1217.9(P)4.0(P)11.7(P)1.4(P)
1332.3(F)2.1(P)10.6(P)1.5(P)
1420.4(F)4.1(P)5.6(P)0.0(P)
1521.3(F)2.9(P)4.5(P)0.8(P)
1611.8(P)5.1(P)36.2(F)0.0(P)

(P) pass · (F) fail · Q3 relative error (%)

BPM and SDNN (100% pass): absolute precision is retained at 30% loss, with Q3 errors of only 0.0%–1.7% in BPM and 2.1%–5.1% in SDNN versus the clean signal. RMSSD collapses to only 56.3% pass (7 failures), while SI still holds a 93.8% pass rate.

Design conclusion

While the benchmark study by Cajal et al. (University of Zaragoza, 2022) established a theoretical acceptance limit of 25% missing data for time-domain metrics, empirical evaluations revealed higher sensitivity.

At 20% scattered beat loss, RMSSD already began to show instability—failing the Q3 < 20% contract in 3 of 16 sessions (81.3% pass rate). Even at 15% loss, RMSSD’s maximum error reached 18.3%, hovering close to the rejection threshold.

Mean heart rate (BPM) and SDNN maintained 100% pass rates across all sessions even at 30% missing data, with Q3 relative errors remaining below 1.7% and 5.1%, respectively.

Baevsky’s Stress Index (SI): the original Zaragoza study did not evaluate SI. This work extends that scope with an empirical SI check—a geometric metric. Tests showed remarkable geometric resilience, maintaining a flat 93.8% pass rate across 20%, 25%, and 30% loss levels.

Additionally, as in the frequency methodology, a lighter evaluation was run at 5% artifact loss to check where error is still far more acceptable inside the valid range. Empirical evaluations at 5% artifact loss (p = 0.05) demonstrated that relative errors across all time- and frequency-domain metrics remain strictly proportional to or below 6% relative to the clean baseline.

Based on these results, LensHRV establishes the same two quality indicators used for frequency metrics:

Excellent grade (< 5% artifact loss): relative error is up to 6%.

Good grade (< 15% artifact loss): good fidelity of metrics.

Although metrics such as SDNN, mean BPM, and Stress Index remain technically valid up to 25%–30% beat loss, displaying partial reports—where certain metrics are shown while others are hidden or flagged—creates user friction and forces complex cross-metric interpretation.

To ensure a seamless user experience and uncompromised mathematical rigor, LensHRV adopts a single, unified rejection policy: any recording exceeding 15% missing beats is completely discarded by design.

Conclusions

Time-domain HRV in LensHRV follows the Zaragoza missing-data philosophy, with the time-domain discovery front and center: do not over-interpolate; remove outliers, keep real beats, and trust that BPM, SDNN, and SI are far more robust than fragile spectral bands—while RMSSD is the first time metric to feel pressure.

Evaluation contract: same as frequency—Q3 relative error < 20% on 16 clean PPG sessions, 10 repetitions per loss level.

Hard quality gate: operational limit at 15% missing data—above that the recording is discarded. Inside the valid range: excellent grade below 5% artifacts, and good grade below 15%, matching the frequency methodology.