Compute SSP (signal-space projection) vectors for ECG artifacts.
This function will:
Filter the ECG data channel.
Find ECG R wave peaks using mne.preprocessing.find_ecg_events()
.
Filter the raw data.
Create Epochs
around the R wave peaks, capturing the heartbeats.
Optionally average the Epochs
to produce an Evoked
if
average=True
was passed (default).
Calculate SSP projection vectors on that data to capture the artifacts.
Note
Raw data will be loaded if it hasn’t been preloaded already.
mne.io.Raw
Raw input file.
mne.io.Raw
or None
Raw file to use for event detection (if None, raw is used).
float
Time before event in seconds.
float
Time after event in seconds.
int
Number of SSP vectors for gradiometers.
int
Number of SSP vectors for magnetometers.
int
Number of SSP vectors for EEG.
float
| None
Filter low cut-off frequency for the data channels in Hz.
float
| None
Filter high cut-off frequency for the data channels in Hz.
Compute SSP after averaging. Default is True.
str
| int
| None
Number of taps to use for filtering.
int
| None
The number of jobs to run in parallel. If -1
, it is set
to the number of CPU cores. Requires the joblib
package.
None
(default) is a marker for ‘unset’ that will be interpreted
as n_jobs=1
(sequential execution) unless the call is performed under
a joblib.parallel_backend()
context manager that sets another
value for n_jobs
.
str
| None
Channel to use for ECG detection (Required if no ECG found).
dict
| None
Epoch rejection configuration (see Epochs).
dict
| None
Epoch flat configuration (see Epochs).
list
List with (additional) bad channels.
Add EEG average reference proj.
Exclude the SSP projectors currently in the fiff file.
int
ID to use for events.
float
Low pass frequency applied to the ECG channel for event detection.
float
High pass frequency applied to the ECG channel for event detection.
float
Start artifact detection after tstart seconds.
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).
str
Method for filtering (‘iir’ or ‘fir’).
dict
| None
Dictionary of parameters to use for IIR filtering. See mne.filter.construct_iir_filter for details. If iir_params is None and method=”iir”, 4th order Butterworth will be used.
If False, filtering raw data is done in place. Defaults to True.
If True, return the drop log.
New in version 0.15.
str
Can be ‘separate’ (default) or ‘combined’ to compute projectors
for magnetometers and gradiometers separately or jointly.
If ‘combined’, n_mag == n_grad
is required and the number of
projectors computed for MEG will be n_mag
.
New in version 0.18.
str
| int
| None
Control verbosity of the logging output. If None
, use the default
verbosity level. See the logging documentation and
mne.verbose()
for details. Should only be passed as a keyword
argument.
See also
Notes
Filtering is applied to the ECG channel while finding events using
ecg_l_freq
and ecg_h_freq
, and then to the raw
instance
using l_freq
and h_freq
before creation of the epochs used to
create the projectors.
mne.preprocessing.compute_proj_ecg
#Background on projectors and projections
Divide continuous data into equally-spaced epochs