R-R Intervals (RRI) / HRV¶
R-R interval (RRI) signals represent the beat-to-beat timing series extracted from cardiac peaks and are the core input for heart rate variability (HRV) analysis. RRI processing helps quantify autonomic modulation through temporal and spectral descriptors.
API quick links: biosppy.signals.hrv | biosppy.signals.hrv.hrv()
Quick Usage with biosppy.signals.hrv.hrv()¶
import numpy as np
from biosppy.signals import hrv
# RRI in milliseconds.
rri = np.loadtxt("examples/rri.txt")
out = hrv.hrv(rri=rri, sampling_rate=1000.0, show=False)
print(out.keys())
Inputs
rri: beat-to-beat intervals (ms), or alternativelyrpeakswithsampling_rateto derive RRI internally.rri_min/rri_max: optional physiological bounds for artifact control.parameters: which HRV feature families to compute.
Outputs
A
ReturnTuplewith HRV results (time-domain, frequency-domain, and non-linear descriptors, depending on selected parameters).Use
out.keys()to inspect all computed metrics.
Example of HRV summary plot: