code: def simulate_data(
      freqs_sig=[9, 12],
      n_trials=100,
      n_channels=20,
      n_samples=500,
      samples_per_second=250,
      n_components=5,
      SNR=0.05,
      random_state=42,
  ):
      """Simulate data according to an instantaneous mixin model.
  
      Data are simulated in the statistical source space, where n=n_components
      sources contain the peak of interest.
      """
      rng = np.random.RandomState(random_state)
  
      filt_params_signal = dict(
          l_freq=freqs_sig[0],
          h_freq=freqs_sig[1],
          l_trans_bandwidth=1,
          h_trans_bandwidth=1,
          fir_design="firwin",
      )
  
      # generate an orthogonal mixin matrix
      mixing_mat = np.linalg.svd(rng.randn(n_channels, n_channels))[0]
      # define sources
      S_s = rng.randn(n_trials * n_samples, n_components)
      # filter source in the specific freq. band of interest
      S_s = filter_data(
          S_s.T, samples_per_second, **filt_params_signal
      ).T
      S_n = rng.randn(n_trials * n_samples, n_channels - n_components)
      S = np.hstack((S_s, S_n))
      # mix data
      X_s = np.dot(mixing_mat[:, :n_components], S_s.T).T
      X_n = np.dot(mixing_mat[:, n_components:], S_n.T).T
      # add noise
      X_s = X_s / np.linalg.norm(X_s, "fro")
      X_n = X_n / np.linalg.norm(X_n, "fro")
      X = SNR * X_s + (1 - SNR) * X_n
      X = X.T
      S = S.T
      return X, mixing_mat, S
  
file_path: mne-python/mne/decoding/tests/test_ssd.py
imports: import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from mne import create_info, io
  from mne.decoding import CSP
  from mne.decoding.ssd import SSD
  from mne.filter import filter_data
  from mne.time_frequency import psd_array_welch
label_desc: Use image node_id 1 for calling a global function with example usage: simulate_data(freqs_sig, n_trials, n_channels, n_samples, samples_per_second, n_components, SNR, random_state) and returns: X,  mixing_mat,  S