mne.simulation.add_eog#
- mne.simulation.add_eog(raw, head_pos=None, interp='cos2', n_jobs=None, verbose=None, *, rng=None, random_state=None)[source]#
Add blink noise to raw data.
- Parameters:
- rawinstance of
Raw The raw instance to modify.
- head_pos
None| path-like |dict|tuple|array Path to 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
dev_head_tmatrices. If None, the original head position (frominfo['dev_head_t']) will be used. If tuple, should have the same format as data returned byhead_pos_to_trans_rot_t. If array, should be of the form returned bymne.chpi.read_head_pos().- interp
str Either
'hann','cos2'(default),'linear', or'zero', the type of forward-solution interpolation to use between forward solutions at different head positions.- n_jobs
int|None The number of jobs to run in parallel. If
-1, it is set to the number of CPU cores. Requires thejoblibpackage.None(default) is a marker for ‘unset’ that will be interpreted asn_jobs=1(sequential execution) unless the call is performed under ajoblib.parallel_configcontext manager that sets another value forn_jobs.- verbosebool |
str|int|None Control verbosity of the logging output. If
None, use the default verbosity level. See the logging documentation andmne.verbose()for details. Should only be passed as a keyword argument.- rng
None|int| instance ofGenerator|RandomState The random number generator (RNG). If
None(default), a newnumpy.random.Generatorseeded from entropy is used. Pass an int or anumpy.random.Generatorfor reproducible results, or a legacyRandomStateto control the random-number stream or for interoperability with third-party code such as scikit-learn that does not accept generators. An integer seed usesnumpy.random.default_rng()and therefore produces a different stream than the same integer passed to a legacyrandom_stateorseedparameter.New in v1.13.
- random_state
None|int| instance ofRandomState Supported for compatibility. New code should use
rng. IfNone, NumPy’s globalRandomStateis used. The random generator state used for blink, ECG, and sensor noise randomization.
- rawinstance of
- Returns:
- rawinstance of
Raw The instance, modified in place.
- rawinstance of
See also
Notes
The blink artifacts are generated by:
Random activation times are drawn from an inhomogeneous poisson process whose blink rate oscillates between 4.5 blinks/minute and 17 blinks/minute based on the low (reading) and high (resting) blink rates from [1].
The activation kernel is a 250 ms Hanning window.
Two activated dipoles are located in the z=0 plane (in head coordinates) at ±30 degrees away from the y axis (nasion).
Activations affect MEG and EEG 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.
References