mne.preprocessing.find_ecg_events

mne.preprocessing.find_ecg_events(raw, event_id=999, ch_name=None, tstart=0.0, l_freq=5, h_freq=35, qrs_threshold='auto', filter_length='10s', return_ecg=False, reject_by_annotation=None, verbose=None)[source]

Find ECG peaks.

Parameters
rawinstance of Raw

The raw data

event_idint

The index to assign to found events

ch_nameNone | str

The name of the channel to use for ECG peak detection. If None (default), a synthetic ECG channel is created from cross channel average. Synthetic channel can only be created from ‘meg’ channels.

tstartfloat

Start detection after tstart seconds. Useful when beginning of run is noisy.

l_freqfloat

Low pass frequency to apply to the ECG channel while finding events.

h_freqfloat

High pass frequency to apply to the ECG channel while finding events.

qrs_thresholdfloat | str

Between 0 and 1. qrs detection threshold. Can also be “auto” to automatically choose the threshold that generates a reasonable number of heartbeats (40-160 beats / min).

filter_lengthstr | int | None

Number of taps to use for filtering.

return_ecgbool

Return ecg channel if synthesized. Defaults to False. If True and and ecg exists this will yield None.

reject_by_annotationbool

Whether to omit data that is annotated as bad.

New in version 0.18.

verbosebool, str, int, or None

If not None, override default verbose level (see mne.verbose() and Logging documentation for more).

Returns
ecg_eventsarray

Events.

ch_ecgstr

Name of channel used.

average_pulsefloat

Estimated average pulse.

Examples using mne.preprocessing.find_ecg_events