HART  0.2.0
High level Audio Regression and Testing
Loading...
Searching...
No Matches
Spectrum::ColouredNoise Class Reference

Options for colouredNoise() method. More...

#include <hart_spectrum.hpp>

Public Member Functions

 ColouredNoise (float beta)
 Creates ColouredNoise with a custom beta value.
 
ColouredNoise withRandomSeed (uint_fast32_t randomSeed)
 Sets random seed.
 
ColouredNoise withLowCutoff (double lowCutoffFrequencyHz)
 Sets the lowest meaningful frequency in the spectrum.
 
ColouredNoise withNumChannels (size_t numChannels)
 Sets number of channels.
 
ColouredNoise withDuration (size_t signalDurationFrames)
 Sets duration of time-domain audio that spectrum will represent.
 
ColouredNoise withSampleRate (double sampleRateHz)
 Sets sample rate.
 

Static Public Member Functions

static ColouredNoise white ()
 Creates ColouredNoise instance with beta value for white noise.
 
static ColouredNoise pink ()
 Creates ColouredNoise instance with beta value for pink noise.
 
static ColouredNoise brown ()
 Creates ColouredNoise instance with beta value for brown (a.k.a. red, or Brownian) noise.
 
static ColouredNoise blue ()
 Creates ColouredNoise instance with beta value for blue noise.
 
static ColouredNoise violet ()
 Creates ColouredNoise instance with beta value for violet noise.
 

Detailed Description

Options for colouredNoise() method.

Definition at line 116 of file hart_spectrum.hpp.

Constructor & Destructor Documentation

◆ ColouredNoise()

ColouredNoise ( float  beta)
inlineexplicit

Creates ColouredNoise with a custom beta value.

For common noise types, use provided factory methods:

Noise type Method beta
White white() 0
Pink pink() −1
Brown/Red/Brownian brown() −2
Blue blue() +1
Violet violet() +2
Parameters
betaPower-spectrum exponent (slope):
Returns
Chainable ColouredNoise options instance

Definition at line 132 of file hart_spectrum.hpp.

Member Function Documentation

◆ white()

static ColouredNoise white ( )
inlinestatic

Creates ColouredNoise instance with beta value for white noise.

Returns
Chainable ColouredNoise options instance

Definition at line 139 of file hart_spectrum.hpp.

◆ pink()

static ColouredNoise pink ( )
inlinestatic

Creates ColouredNoise instance with beta value for pink noise.

Returns
Chainable ColouredNoise options instance

Definition at line 146 of file hart_spectrum.hpp.

◆ brown()

static ColouredNoise brown ( )
inlinestatic

Creates ColouredNoise instance with beta value for brown (a.k.a. red, or Brownian) noise.

Returns
Chainable ColouredNoise options instance

Definition at line 153 of file hart_spectrum.hpp.

◆ blue()

static ColouredNoise blue ( )
inlinestatic

Creates ColouredNoise instance with beta value for blue noise.

Returns
Chainable ColouredNoise options instance

Definition at line 160 of file hart_spectrum.hpp.

◆ violet()

static ColouredNoise violet ( )
inlinestatic

Creates ColouredNoise instance with beta value for violet noise.

Returns
Chainable ColouredNoise options instance

Definition at line 167 of file hart_spectrum.hpp.

◆ withRandomSeed()

ColouredNoise withRandomSeed ( uint_fast32_t  randomSeed)
inline

Sets random seed.

Parameters
randomSeedRNG seed. While magnitudes will have ideal values, the real and imaginary parts of bins will be randomized.

Defaults to global default random seed.

Returns
Chainable ColouredNoise options instance

Definition at line 178 of file hart_spectrum.hpp.

◆ withLowCutoff()

ColouredNoise withLowCutoff ( double  lowCutoffFrequencyHz)
inline

Sets the lowest meaningful frequency in the spectrum.

Parameters
lowCutoffFrequencyHzThe starting frequency of the noise. Defaults to 20 Hz.
Note
Bins below it will be zero. Must be at least 1 Hz.
Returns
Chainable ColouredNoise options instance

Definition at line 189 of file hart_spectrum.hpp.

◆ withNumChannels()

ColouredNoise withNumChannels ( size_t  numChannels)
inline

Sets number of channels.

Note
Each channel will contain a difference noise instance
Parameters
numChannelsNumber of channels in the generated spectrum

Defaults to global default number of input channels.

Definition at line 203 of file hart_spectrum.hpp.

◆ withDuration()

ColouredNoise withDuration ( size_t  signalDurationFrames)
inline

Sets duration of time-domain audio that spectrum will represent.

Parameters
signalDurationFramesDesired duration of the signal this noise represents. Can be arbitrary. If not a power of 2, the spectrum will be padded to the next power of 2, but if converted to time domain via toAudioBuffer(), the desired duration will be respected.

Defaults to global default render duration.

Returns
Chainable ColouredNoise options instance

Definition at line 218 of file hart_spectrum.hpp.

◆ withSampleRate()

ColouredNoise withSampleRate ( double  sampleRateHz)
inline

Sets sample rate.

Parameters
sampleRateHzSample rate of the generated spectrum in Hertz.

Defaults to global default sample rate.

Returns
Chainable ColouredNoise options instance

Definition at line 229 of file hart_spectrum.hpp.


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