PNoiseGenerator¶
- class acoular.signals.PNoiseGenerator¶
Bases:
NoiseGenerator
Generate pink noise signal.
The
PNoiseGenerator
class generates pink noise signals, which exhibit a \(1/f\) power spectral density. Pink noise is characterized by equal energy per octave, making it useful in various applications such as audio testing, sound synthesis, and environmental noise simulations.The pink noise simulation is based on the Voss-McCartney algorithm, which iteratively adds noise with increasing wavelength to achieve the desired \(1/f\) characteristic.
See also
acoular.signals.WNoiseGenerator
For white noise generation.
acoular.sources.UncorrelatedNoiseSource
For per-channel noise generation.
References
S.J. Orfanidis: Signal Processing (2010), pp. 729-733 [18]
Online discussion: http://www.firstpr.com.au/dsp/pink-noise/
- depth = Int(16, desc='octave depth')¶
“Octave depth” of the pink noise generation. Higher values result in a better approximation of the \(1/f\) spectrum at low frequencies but increase computation time. The maximum allowable value depends on the
number of samples
. Default is16
.
- digest = Property(depends_on=['rms', 'seed', 'sample_freq', 'num_samples', 'depth'])¶
A unique checksum identifier based on the object properties. (read-only)
- signal()¶
Generate and deliver the pink noise signal.
The signal is computed using the Voss-McCartney algorithm, which generates noise with a \(1/f\) power spectral density. The method ensures that the output has the desired
RMS
amplitude and spectrum.- Returns:
numpy.ndarray
A 1D array of floats containing the generated pink noise signal. The length of the array is equal to
num_samples
.
Notes
The “depth” parameter controls the number of octaves included in the pink noise simulation. If the specified depth exceeds the maximum possible value based on the number of samples, it is automatically adjusted, and a warning is printed.
The output signal is scaled to have the same overall level as white noise by dividing the result by
sqrt(depth + 1.5)
.