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, verbose=None)[source]

Find ECG peaks.

Parameters:

raw : instance of Raw

The raw data

event_id : int

The index to assign to found events

ch_name : None | 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.

tstart : float

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

l_freq : float

Low pass frequency.

h_freq : float

High pass frequency.

qrs_threshold : float | 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_length : str | int | None

Number of taps to use for filtering.

return_ecg : bool

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

verbose : bool, str, int, or None

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

Returns:

ecg_events : array

Events.

ch_ecg : string

Name of channel used.

average_pulse : float

Estimated average pulse.

Examples using mne.preprocessing.find_ecg_events