myogen.simulator.IntramuscularEMG.add_noise#
- IntramuscularEMG.add_noise( ) INTRAMUSCULAR_EMG__Block[source]#
Add noise to the electrode array.
This method adds realistic noise to the simulated intramuscular EMG signals based on a specified signal-to-noise ratio. The noise is calculated and applied independently for each electrode channel to ensure that channels with different signal amplitudes maintain the specified SNR.
- Parameters:
snr__dB (float) – Signal-to-noise ratio in dB. Higher values result in cleaner signals. Typical intramuscular EMG has SNR ranging from 15-50 dB. The SNR is applied independently to each electrode channel.
noise_type (str, default="gaussian") – Type of noise to add. Currently supports “gaussian” for white noise.
- Returns:
Noisy intramuscular EMG signals for the electrode array as a neo.Block. Results are stored in the noisy_intramuscular_emg__Block property after execution.
- Return type:
- Raises:
ValueError – If intramuscular EMG has not been simulated. Call simulate_intramuscular_emg() first.
Notes
The noise is computed per-channel (per electrode) to maintain the specified SNR independently across all channels. This ensures that electrodes with different signal amplitudes receive appropriately scaled noise.