.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/Artefacts/plot_PeaksCorrection.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_Artefacts_plot_PeaksCorrection.py: Detecting and correcting artefacts in peaks vector ================================================== This example describes artefacts correction peaks vectors. The function `correct_rr()` automatically detect artefacts using the method proposed by Lipponen & Tarvainen (2019) [#]_. At each iteration, extra and missed peaks are corrected replacement or removal of peaks. The detection procedure is run again using cleaned intervals. When using this method, the signal length stays constant, which makes it more appropriate for event-related designs where the occurrence of certain events must be controlled. .. GENERATED FROM PYTHON SOURCE LINES 15-19 .. code-block:: default # Author: Nicolas Legrand # Licence: GPL v3 .. GENERATED FROM PYTHON SOURCE LINES 20-28 .. code-block:: default import numpy as np import pandas as pd from systole import import_dataset1 from systole.detection import ecg_peaks from systole.correction import correct_peaks from systole.plots import plot_rr, plot_evoked import matplotlib.pyplot as plt .. GENERATED FROM PYTHON SOURCE LINES 29-31 .. code-block:: default ecg_df = import_dataset1(modalities=['ECG', 'Stim']) .. rst-class:: sphx-glr-script-out .. code-block:: none 0%| | 0/2 [00:00` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_PeaksCorrection.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_