Skip to content

WGN Sample (Basic)

David Young edited this page Apr 30, 2025 · 1 revision

Description

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.

Assumptions

  • 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 the std::normal_distribution.

Limitations

  • Zero Output for Small Stddev: If the requested standard deviation (stddev) is effectively zero (less than or equal to a small constant EPSILON), the function returns a deterministic 0.0 rather than a random sample. This prevents potential issues with std::normal_distribution when stddev is 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).

Related Components

  • 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, uses noise_utils::normal_dist)
  • RNG Initialization and Seeding (Overall RNG management)
  • Used by FAlphaBranch for creating a new noise sample and methods for getting random phase/frequency offsets for Timing.

Validation Status

  • 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 stddev values.
    • Explicitly test the edge case where stddev <= EPSILON to ensure it returns 0.0.
  • Priority: Low (Assumed correct due to reliance on standard library, but basic checks are warranted as part of overall noise model validation).

Clone this wiki locally