systole.utils.input_conversion#

systole.utils.input_conversion(x: Union[List, ndarray], input_type: str, output_type: str, sfreq: int = 1000) ndarray[source]#

Convert input time series to the desired output format.

This function is called by functions to convert time series to a different format. The input and outputs can be: * peaks: a boolean vector where 1 denote the detection of an event in the time-series. * peaks_idx: a 1d NumPy array of integers where each item is the sample index of an event in the time series. * rr_ms: a 1d NumPy array (integers or floats) of RR /peak-to-peak intervals in milliseconds. * rr_s: a 1d NumPy array (integers or floats) of RR /peak-to-peak intervals in seconds.

Parameters
x

The input time series.

input_type

The type of input provided (can be “peaks”, “peaks_idx”, “rr_ms”, “rr_s”).

output_type

The type of desired output (can be “peaks”, “peaks_idx”, “rr_ms”, “rr_s”).

sfreq

The sampling frequency (default is 1000 Hz). Only applies when iput_type is “peaks” or “peaks_idx”.

Returns
output

The time series converted to the desired format.