Repository navigation
Add Alpha-SNR-Based Noise Model for Sensor Signal Simulation - #17
Merged
Merged
Conversation
…ain control parameter for noise level in DataSimulator class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5
Implemented an interpretable noise injection method based on the Alpha-SNR formulation. The approach allows to control signal-to-noise ratio (SNR) in a bounded and unitless manner during EEG/MEG simulation by specifying a single parameter:$\alpha \in (0, 1)$ .
Motivation
The traditional decibel-based SNR control using$\text{SNR}_{\text{dB}}$ can be unintuitive and difficult to interpret across varying signal strengths. The Alpha-SNR approach addresses this by defining noise level via the relative energy of the signal in the total signal-plus-noise mixture.
Mathematical Formulation
Let:
We define signal and noise power:
The Alpha-SNR parameter$\alpha \in (0, 1)$ defines the signal proportion:
$\alpha := \frac{P_{\text{signal}}}{P_{\text{signal}} + P_{\text{noise}}} = \frac{1}{1 + \eta^2 / P_{\text{signal}}}$
Solving for$\eta$ , we obtain:
$\eta = \left( \frac{1 - \alpha}{\alpha} \right) \cdot \frac{| \mathbf{Y}_{\text{signal}} |_F}{| \boldsymbol{\varepsilon} |_F}$
The final noisy signal is:
$\mathbf{Y}{\text{noisy}} = \mathbf{Y}{\text{signal}} + \eta \cdot \boldsymbol{\varepsilon}$
The noise variance per element is given by the variance of any entry$\varepsilon_{ij}^{\text{scaled}}$ :
Hence, the total noise variance (used in the simulation return value) is:
Changes Introduced
_add_noise()method.data_simulation.pybenchmark.pyrun_experiments.pyUsage
Notes
This PR only implements homoscedastic, white Gaussian noise.