systole.correction.correct_missed_rr#

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

Correct missed heartbeat(s) by adding new RR intervals. Will also update the artefacts array accordingly if this one is provided.

Parameters
rr

RR intervals (ms).

missed_idx

Index of the extra RR interval.

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 added.

Returns
clean_rr

Corrected RR intervals.

artefacts

If the artefacts dictionary was provided, also return the updated version of this dictionary with the new artifacts idexes.