Skip to content

Missing-event gap filling

What it does

This method reconstructs plausible event timestamps inside abnormally long intervals before interval-based HRV or pulse-rate variability analysis.

When to use it

Use it after false-positive detections have been removed and when missed beats or pulses have merged several physiological intervals into one long observed interval.

Canonical ID: hrv.fillgaps

Inputs

Name Meaning Type Unit Requirements
tk Strictly increasing event occurrence times after false-positive removal. real vector s minimum length: 1; no NaN; finite

Parameters

Name Meaning Type Unit Default Requirements
gap_detection_factor Multiplier that marks an observed interval as locally long. real scalar 1 1.5 greater than: 0
correction_upper_factor Upper acceptance bound for reconstructed intervals. real scalar 1 1.15 greater than: 0
correction_lower_factor Lower acceptance bound used while choosing insertion counts. real scalar 1 0.75 greater than: 0
minimum_interval Smallest physiologically accepted reconstructed interval. real scalar s 0.5 minimum: 0
max_gap_duration Longest gap duration that the method will attempt to reconstruct. real scalar s 10 greater than: 0

Outputs

Name Meaning Type Unit
tn Event occurrence times including accepted reconstructed events. real vector s
dtn Intervals between output events, with unresolved spans kept explicit. real vector s

How it works

Locally long intervals are detected against a median-based adaptive baseline. The method tries increasing insertion counts and uses shape-preserving interpolation from surrounding valid intervals. Reconstructions must remain inside local acceptance bounds and preserve the duration between observed events.

Interpretation and limitations

Inserted timestamps are deterministic estimates, not observed events. Abrupt rhythm changes, insufficient context, or long missing spans may remain unresolved; those spans stay explicit in the interval output.

References

  • Diego Cajal et al. (2022). Effects of Missing Data on Heart Rate Variability Metrics. Sensors. doi:10.3390/s22155774

Implementations and technical resources

Python source | MATLAB source

Normative JSON | Validation cases