forked from stpaine/FERS
-
Notifications
You must be signed in to change notification settings - Fork 1
WGN Sample (Basic)
David Young edited this page Apr 30, 2025
·
1 revision
Provides a basic utility function, noise_utils::wgnSample, intended to generate a single sample drawn from a White Gaussian Noise (WGN) distribution. This function uses the standard C++ library's std::normal_distribution as the underlying random number generator for the Gaussian shape. This is often a fundamental building block for simulating thermal noise or other random Gaussian processes where individual samples are needed.
- Assumes that the physical noise process being modeled (e.g., thermal noise) is appropriately represented by a Gaussian (normal) distribution.
- Assumes the caller provides the correct standard deviation (
stddev) parameter, representing the desired noise intensity or power level in the appropriate units for the context where the sample will be used. - Assumes the underlying random number generator, initialized via
noise_utils::ensureInitialized(), provides sufficiently high-quality random numbers for thestd::normal_distribution.
-
Zero Output for Small Stddev: If the requested standard deviation (
stddev) is effectively zero (less than or equal to a small constantEPSILON), the function returns a deterministic0.0rather than a random sample. This prevents potential issues withstd::normal_distributionwhenstddevis zero but means no noise is generated in this edge case. - Single Sample Operation: This function generates only one noise sample per call. Generating a time series or block of noise requires calling this function repeatedly in a loop or using a higher-level generator class (like WGN Generator).
-
noise_utils.h,noise_utils.cpp(Implementation files) -
std::normal_distribution(Core C++ standard library component used) -
noise_utils::ensureInitialized()(Related function for RNG setup, usesnoise_utils::normal_dist) - RNG Initialization and Seeding (Overall RNG management)
- Used by
FAlphaBranchfor creating a new noise sample and methods for getting random phase/frequency offsets forTiming.
- Needs Verification: The statistical properties (mean, variance, distribution shape) of the generated samples have not been formally verified against theoretical expectations through dedicated tests within FERS. Relies on the correctness of the standard library implementation.
-
Key Areas for Validation:
- Verify that a large number of generated samples have a mean statistically close to zero.
- Verify that the variance of a large number of samples statistically matches the square of the input
stddev. - Perform goodness-of-fit tests (e.g., Chi-squared, Kolmogorov-Smirnov) to confirm the distribution shape matches a Gaussian profile across different
stddevvalues. - Explicitly test the edge case where
stddev <= EPSILONto ensure it returns0.0.
- Priority: Low (Assumed correct due to reliance on standard library, but basic checks are warranted as part of overall noise model validation).