Gin
Loading...
Searching...
No Matches
WhiteNoise Class Reference

White noise generator using a normal distribution. More...

#include <gin_noise.h>

Public Member Functions

 WhiteNoise ()
float nextSample ()

Detailed Description

White noise generator using a normal distribution.

WhiteNoise produces random samples with a flat frequency spectrum (equal power across all frequencies). Uses C++ standard library's normal distribution with mean 0.0 and standard deviation 0.1.

White noise characteristics:

  • Flat frequency spectrum (equal energy at all frequencies)
  • Gaussian amplitude distribution
  • Mean of 0.0, standard deviation of 0.1
  • No correlation between samples

Usage:

WhiteNoise noise;
// In audio processing loop
for (int i = 0; i < numSamples; ++i)
{
float sample = noise.nextSample();
audioBuffer[i] = sample;
}
WhiteNoise()
Definition gin_noise.h:50
float nextSample()
Definition gin_noise.h:56

Note: Each instance is seeded with a random device, ensuring different sequences across instances.

See also
PinkNoise

Constructor & Destructor Documentation

◆ WhiteNoise()

WhiteNoise::WhiteNoise ( )

Member Function Documentation

◆ nextSample()

float WhiteNoise::nextSample ( )

The documentation for this class was generated from the following file: