Class thl::dsp::utils::BrownianNoise#

class BrownianNoise#

Brownian motion (random walk) noise generator with one-pole smoothing.

Integrates a velocity state that receives random impulses at rate Hz. A spring-like restoring force and velocity damping keep the output bounded in approximately [-1, 1] without hard clipping.

Call prepare() before use.

Parameters: rate – impulse rate in Hz (controls how fast the value wanders) momentum – spring/damping strength [0, 1] (higher = stronger mean reversion)

Public Functions

BrownianNoise()#
void prepare(float rate, float sample_rate, float momentum = 0.3f)#
void set_rate(float rate)#
void set_momentum(float momentum)#
void reset()#
float process()#
float process_block(size_t num_samples)#