code: def simulate_evoked(
      fwd,
      stc,
      info,
      cov=None,
      nave=30,
      iir_filter=None,
      random_state=None,
      use_cps=True,
      verbose=None,
  ):
      """Generate noisy evoked data.
  
      .. note:: No projections from ``info`` will be present in the
                output ``evoked``. You can use e.g.
                :func:`evoked.add_proj <mne.Evoked.add_proj>` or
                :func:`evoked.set_eeg_reference <mne.Evoked.set_eeg_reference>`
                to add them afterward as necessary.
  
      Parameters
      ----------
      fwd : instance of Forward
          A forward solution.
      stc : SourceEstimate object
          The source time courses.
      %(info_not_none)s Used to generate the evoked.
      cov : Covariance object | None
          The noise covariance. If None, no noise is added.
      nave : int
          Number of averaged epochs (defaults to 30).
  
          .. versionadded:: 0.15.0
      iir_filter : None | array
          IIR filter coefficients (denominator) e.g. [1, -1, 0.2].
      %(random_state)s
      %(use_cps)s
  
          .. versionadded:: 0.15
      %(verbose)s
  
      Returns
      -------
      evoked : Evoked object
          The simulated evoked data.
  
      See Also
      --------
      simulate_raw
      simulate_stc
      simulate_sparse_stc
  
      Notes
      -----
      To make the equivalence between snr and nave, when the snr is given
      instead of nave::
  
          nave = (1 / 10 ** ((actual_snr - snr)) / 20) ** 2
  
      where actual_snr is the snr to the generated noise before scaling.
  
      .. versionadded:: 0.10.0
      """
      evoked = apply_forward(fwd, stc, info, use_cps=use_cps)
      if cov is None:
          return evoked
  
      if nave < np.inf:
          noise = _simulate_noise_evoked(
              evoked, cov, iir_filter, random_state
          )
          evoked.data += noise.data / math.sqrt(nave)
          evoked.nave = np.int64(nave)
      if cov.get("projs", None):
          evoked.add_proj(cov["projs"]).apply_proj()
      return evoked
  
file_path: mne-python/mne/simulation/evoked.py
imports: import math
  import numpy
  from scipy.signal import lfilter
  from .._fiff.pick import pick_info
  from ..cov import Covariance, compute_whitener
  from ..epochs import BaseEpochs
  from ..evoked import Evoked
  from ..forward import apply_forward
  from ..io import BaseRaw
  from ..utils import _check_preload, _validate_type, check_random_state, logger, verbose
label_desc: Use image node_id 1 for calling a global function with example usage: simulate_evoked(fwd, stc, info, cov, nave, iir_filter, random_state, use_cps, verbose) and returns: evoked, evoked