pyntbci.eeg.generate_white_noise
- pyntbci.eeg.generate_white_noise(n_trials: int, n_channels: int, n_samples: int, amplitude: float = 1.0, random_state: int | Generator = None, dtype: str | dtype = 'float32') NDArray[source]
Generate white sensor / measurement noise, i.e., independent and identically distributed Gaussian noise per channel and sample. Because it is independent across channels, this noise source guarantees that data it is added to remains full rank across channels (see generate_noise).
- Parameters:
n_trials (int) – The number of trials to generate.
n_channels (int) – The number of channels to generate.
n_samples (int) – The number of samples per trial.
amplitude (float (default: 1.0)) – The standard deviation of the noise.
random_state (int | np.random.Generator (default: None)) – A seed or numpy random number generator to draw the noise from. If None, a new one is used.
dtype (str | np.dtype (default: "float32")) – The dtype of the returned array. Computation is always done in float64 internally; this only controls the precision of the final result.
- Returns:
noise – The white noise of shape (n_trials, n_channels, n_samples).
- Return type:
NDArray