Skip to content

Estimate respiratory amplitude per cycle

What it does

Estimates the peak-to-valley amplitude of each complete respiratory cycle and returns an interpolated amplitude trajectory alongside the upper and lower envelopes.

When to use it

Use a uniformly sampled respiration signal with slow baseline drift already removed. Amplitudes retain the units of the input. A recording in arbitrary units can track changes in breathing depth; volume in litres requires an appropriate volume calibration.

Canonical ID: resp.tidalvolume

Inputs

Name Meaning Type Unit Requirements
resp Uniformly sampled respiratory signal. real vector a.u. minimum length: 1; NaN allowed; finite
sampling_frequency Sampling frequency in Hz. real scalar Hz greater than: 0; no NaN; finite

Parameters

Name Meaning Type Unit Default Requirements
mindist Minimum separation from the previous raw zero-crossing candidate, in seconds. real scalar s 0 minimum: 0
max_gap Time in seconds between consecutive anchors at which a new group begins. real scalar s not applicable greater than: 0

Outputs

Name Meaning Type Unit
tdvol Peak-to-following-valley amplitudes interpolated at respiratory cycle midpoints. real vector a.u.
upper_envelope Interpolated detrended peak amplitudes. real vector a.u.
lower_envelope Interpolated detrended valley amplitudes. real vector a.u.

How it works

Following linear detrending, zero crossings delimit the search for peaks and valleys. Set mindist in seconds to suppress closely spaced crossings. Each peak pairs with the next valley in the same observed segment. Their amplitude difference is placed halfway between the two extrema in time. Each output is interpolated from its own points using PCHIP.

Interpretation and limitations

Missing samples interrupt respiratory-cycle detection. Set max_gap to limit interpolation across time without valid points. With a limit of 15 s, two consecutive cycle midpoints 14 s apart can support interpolation, while midpoints exactly 15 s apart belong to different groups. The envelopes can have different support because peaks and valleys occur at different times.

References

  • Jesús Lázaro et al. (2020). Electrocardiogram Derived Respiration for Tracking Changes in Tidal Volume from a Wearable Armband. 42nd Annual International Conference of the IEEE Engineering in Medicine and Biology Society. doi:10.1109/EMBC44109.2020.9175486
  • Jesús Lázaro et al. (2024). Tracking Tidal Volume From Holter and Wearable Armband Electrocardiogram Monitoring. IEEE Journal of Biomedical and Health Informatics. doi:10.1109/JBHI.2024.3383232

Implementations and technical resources

Python source | MATLAB source

Normative JSON | Validation cases