Add ECG noise to raw data.
The raw instance to modify.
Name of the position estimates file. Should be in the format of
the files produced by MaxFilter. If dict, keys should
be the time points and entries should be 4x4
matrices. If None, the original head position (from
info['dev_head_t']) will be used. If tuple, should have the
same format as data returned by
If array, should be of the form returned by
Either ‘hann’, ‘cos2’ (default), ‘linear’, or ‘zero’, the type of forward-solution interpolation to use between forward solutions at different head positions.
The number of jobs to run in parallel. If
-1, it is set
to the number of CPU cores. Requires the
None (default) is a marker for ‘unset’ that will be interpreted
n_jobs=1 (sequential execution) unless the call is performed under
joblib.parallel_backend() context manager that sets another
int| instance of
A seed for the NumPy random number generator (RNG). If
the seed will be obtained from the operating system
RandomState for details), meaning it will most
likely produce different output every time this function or method is run.
To achieve reproducible results, pass a value here to explicitly initialize
the RNG with a defined state.
The random generator state used for blink, ECG, and sensor noise
The instance, modified in place.
The ECG artifacts are generated by:
Random inter-beat intervals are drawn from a uniform distribution of times corresponding to 40 and 80 beats per minute.
The activation function is the sum of three Hanning windows with varying durations and scales to make a more complex waveform.
The activated dipole is located one (estimated) head radius to the left (-x) of head center and three head radii below (+z) head center; this dipole is oriented in the +x direction.
Activations only affect MEG channels.
The scale-factor of the activation function was chosen based on visual inspection to yield amplitudes generally consistent with those seen in experimental data. Noisy versions of the activation will be stored in the first EOG channel in the raw instance, if it exists.
New in version 0.18.