systole.hrv.frequency_domain#
- systole.hrv.frequency_domain(rr: Union[List, ndarray], sfreq: int = 5, method: str = 'welch', fbands: Optional[Dict[str, Tuple[str, Tuple[float, float], str]]] = None, input_type: str = 'rr_ms') DataFrame [source]#
Extract the frequency domain features of heart rate variability.
- Parameters
- rr
R-R interval time-series, peaks or peaks index vectors. The default expected vector is R-R intervals in milliseconds. Other data format can be provided by specifying the “input_type” (can be “rr_s”, “peaks” or “peaks_idx”).
- sfreq
The sampling frequency (Hz) used to interpolate the instantaneous heart rate for PSD computation.
- method
The method used to extract the power of the different frequency bands. Default is
'welch'
(only one method is implemented for now).- fbands
Dictionary containing the names of the frequency bands of interest (str), their range (tuples) and their color in the PSD plot. Default is >>> {‘vlf’: (‘Very low frequency’, (0.003, 0.04), ‘b’), >>> ‘lf’: (‘Low frequency’, (0.04, 0.15), ‘g’), >>> ‘hf’: (‘High frequency’, (0.15, 0.4), ‘r’)}
- input_type
The type of input provided. Can be “peaks”, “peaks_idx”, “rr_ms” or “rr_s”. Defaults to “rr_ms”.
- Returns
- stats
Frequency domain summary statistics. * ‘vlf_peak’ : Very low frequency peak (HZ). * ‘vlf_power’ : Very low frequency power (ms²). * ‘lf_peak’ : Low frquency peak (Hz). * ‘lf_power’ : Low frequency power (ms²). * ‘hf_peak’ : High frequency peak (Hz). * ‘hf_power’ : High frequency power (ms²). * ‘vlf_power_per’ : Very low frequency power (%). * ‘lf_power_per’ : Low frequency power (%). * ‘hf_power_per’ : High frequency power (%). * ‘lf_power_nu’ : Low frequency power (normalized units). * ‘hf_power_nu’ : High frequency power (normalized units). * ‘total_power’ : Total frequency power (ms²). * ‘lf_hf_ratio’ : Low / high frequency ratio (normalized units).
See also
time_domain
,nonlinear
Notes
The dataframe containing the summary statistics is returned in the long format to facilitate the creation of group summary data frame that can easily be transferred to other plotting or statistics library. You can easily convert it into a wide format for a subject-level inline report using the:py:func:pandas.pivot_table function: >>> pd.pivot_table(stats, values=’Values’, columns=’Metric’)
Warning
All frequency-domain results have been tested against Kubios HVR 2.2 (<https://www.kubios.com>). These results can slightly differ due to different parametrization of the PSD estimation. We recommend to always check your results against another software.