mne.simulation.add_noise#
- mne.simulation.add_noise(inst, cov, iir_filter=None, verbose=None, *, rng=None, random_state=None)[source]#
Create noise as a multivariate Gaussian.
The spatial covariance of the noise is given from the cov matrix.
- Parameters:
- instinstance of
Evoked,Epochs, orRaw Instance to which to add noise.
- covinstance of
Covariance The noise covariance.
- iir_filter
None| array_like IIR filter coefficients (denominator).
- 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.
- instinstance of
- Returns:
- instsame
typeas the input data The instance, modified to have additional noise.
- instsame
Notes
Only channels in both
inst.info['ch_names']andcov['names']will have noise added to them.This function operates inplace on
inst.New in v0.18.0.