Heart Rate Variability (HRV)
Heart rate variability (HRV) is the variation in the time interval between consecutive heartbeats. HRV is a measure of the autonomic nervous system (ANS) and is often used as a proxy for stress. HRV is also used to assess the risk of cardiovascular disease and sudden cardiac death.
physiokit.hrv.defines
HrvFrequencyBandMetrics
dataclass
HRV Frequency domain metrics dataclass.
Source code in physiokit/hrv/defines.py
HrvFrequencyMetrics
dataclass
HrvNonlinearMetrics
dataclass
Non-linear HRV metric dataclass.
Source code in physiokit/hrv/defines.py
HrvTimeMetrics
dataclass
Time domain HRV metric dataclass.
Source code in physiokit/hrv/defines.py
physiokit.hrv.time
compute_hrv_time(rr_intervals, sample_rate=1000)
Compute time domain HRV metrics.
Parameters:
-
rr_intervals
(NDArray
) –RR intervals.
-
sample_rate
(float
, default:1000
) –Sampling rate. Defaults to 1000 Hz.
Returns:
-
HrvTimeMetrics
(HrvTimeMetrics
) –Time domain HRV metrics.
Source code in physiokit/hrv/time.py
physiokit.hrv.frequency
compute_hrv_frequency(peaks, rri, bands, sample_rate=1000)
Compute the frequency domain HRV features.
Parameters:
-
peaks
(array
) –R peaks.
-
rri
(array
) –RR intervals.
-
bands
(list
) –List of frequency bands.
-
sample_rate
(float
, default:1000
) –Sampling rate in Hz. Defaults to 1000 Hz.
Returns:
-
HrvFrequencyMetrics
(HrvFrequencyMetrics
) –Frequency domain HRV features.