6. Deriving physiological metrics

Once you’ve processed your physiological data, chances are you want to use it to calculate some derived metrics. peakdet currently only support metrics related to heart rate variability, accessible through the peakdet.HRV class.

Assuming you have a Physio object that contains some sort of heart data and you’ve performed peak detection on it, you can provide it directly to the HRV class:

>>> from peakdet import HRV
>>> metrics = HRV(data)
>>> print(f'{metrics.rmssd:.2f} ms')
26.61 ms

The HRV class contains many common heart rate variability metrics including the root mean square of successive differences, as shown above. It also calculates the R-R interval time series from the provided data, which can be accessed via the rrint attribute. The corresponding HRV.rrtime attribute details the times at which these intervals occurred.

Take a look at the API for more information.