systole.correction.correct_peaks#

systole.correction.correct_peaks(peaks: List | ndarray, input_type: str = 'peaks', extra_correction: bool = True, missed_correction: bool = True, n_iterations: int = 1, verbose: bool = True) Dict[str, int | ndarray][source]#

Correct long, short, extra, missed and ectopic beats in peaks vector.

Parameters:
peaks

Boolean vector of peaks.

input_type

The type of input vector. Defaults to “rr_ms” for vectors of RR intervals, or interbeat intervals (IBI), expressed in milliseconds. Can also be a boolean vector where 1 represents the occurrence of R waves or systolic peakspeaks vector “rr_s” or IBI expressed in seconds.

extra_correction

If True (default), correct extra peaks in the peaks time series.

missed_correction

If True (default), correct missed peaks in the peaks time series.

n_iterations

How many time to repeat the detection-correction process. Defaults to 1.

verbose

Control the verbosity of the function. Defaults to True.

Returns:
correction

The corrected RR time series and the number of artefacts corrected: - clean_peaks: The corrected boolean time-serie. - extra: The number of extra beats corrected. - missed: The number of missed beats corrected.

See also

correct_rr

Notes

This function wil operate at the peaks vector level to keep the length of the signal constant after peaks correction.