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=True, verbose=None)[source]¶ Find ECG peaks.
- Parameters
- rawinstance 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 to apply to the ECG channel while finding events.
- h_freq
float
High pass frequency to apply to the ECG channel while finding events.
- 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_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 bad segments from the data before fitting. If
True
(default), annotated segments whose description begins with'bad'
are omitted. IfFalse
, no rejection based on annotations is performed.New in version 0.18.
- verbosebool,
str
,int
, orNone
If not None, override default verbose level (see
mne.verbose()
and Logging documentation for more). If used, it should be passed as a keyword-argument only.
- rawinstance of
- Returns
See also