Skip to content

Make beat segmentation and waveform extrema robust to missed peaks and motion artifacts #28

Description

@sslnevefocusrite

Summary

The waveform pipeline is vulnerable to two related failure modes:

  1. A missed systolic boundary causes two cardiac cycles to be treated as one long beat.
  2. Motion-related spikes or dips can become the global maximum, minimum, or derivative extremum of a beat.

This is not limited to heart-rate reporting. It can propagate into per-beat waveform averaging, timing endpoints, RI/PI, and most waveform-shape metrics.

Current behavior

Systoles are detected from peaks in the arterial-velocity derivative using a global 95th-percentile height threshold. A weaker but valid upstroke can be missed. The detected indexes are then used directly as beat boundaries and the intervals between them are accepted without period or morphology validation.

A missed boundary therefore produces a double-length beat containing two physiological cycles. That malformed beat is resampled and passed to the metric calculator as a valid single beat.

Several metrics also use unconstrained global extrema or derivative extrema within the beat:

  • vmax = nanmax(v), vmin = nanmin(v)
  • t_max/T = nanargmax(v) / n
  • t_min/T = nanargmin(v) / n
  • Rise/fall slopes and their timing use the global maximum/minimum of dv/dt

A short motion dip can therefore be interpreted as the physiological trough, while a spike or rebound can be interpreted as the systolic maximum or steepest slope.

Affected outputs

Directly affected by missed beat boundaries

  • Heart rate and beat-period counts
  • Average-cycle construction
  • Arterial time from peak to descent and venous time from minimum to peak
  • Phase and distribution metrics: MuTOverT, SigmaTOverT, GammaT, T10/T25/T50/T75/T90OverT, QtWidth, and QtSkew
  • Cumulative-distance metrics: DeltaDTI, D10/D25/D50/D75/D90OverD, QdWidth, QdSkew, RVTI, and SFVTI
  • Extrema and kinetics metrics: TMaxOverT, TMinOverT, SRise, SFall, TRiseOverT, TFallOverT, ESlope, and VEndOverVbar
  • Spectral metrics, especially ELFOverEHF, because the true cardiac fundamental moves from the first to the second harmonic of a double-cycle interval

Some amplitude-distribution metrics such as RI, PI, CF, W50OverT, W80OverT, NEffOverT, and NtOverT may be approximately invariant when the malformed beat contains two identical, artifact-free cycles. They are still affected when the two cycles differ or contain motion.

Particularly sensitive to motion-driven extrema

  • Full-trace velocity maximum and minimum
  • Waveform RI and PI
  • W50OverT, W80OverT, and CF
  • TMaxOverT and especially TMinOverT
  • SRise, SFall, TRiseOverT, TFallOverT, and ESlope
  • Peak-to-trough timing endpoints
  • ELFOverEHF and EtaH through added broadband energy

Integral and cumulative metrics are generally less sensitive to a single-sample artifact, but remain vulnerable to multi-sample motion disturbances and incorrect beat boundaries.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions