systole.correction.correct_extra_rr#

systole.correction.correct_extra_rr(rr: ndarray, extra_idx: ndarray, artefacts: ndarray = array([], shape=(2, 0), dtype=bool)) Tuple[ndarray, ndarray][source]#

Correct extra heartbeat(s) by removing the RR interval(s). Will also update the artefacts array accordingly if this one is provided.

Parameters:
rr

1d array of RR intervals (ms).

extra_idx

1d array of the index(es) of the extra RR interval(s).

artefacts

A numpy array (artefacts x time) of artefacts logs, build form the dictionary returned by py:func:systole.detection.rr_artefacts(). This array will be updated as intervals are removed.

Returns:
clean_rr

Corrected RR intervals.

artefacts

The updated dictionary of artefacts logs originally returned by py:func:systole.detection.rr_artefacts().