Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
sbl::dsp::primitives::Rng Class Reference

Detailed Description

Definition at line 22 of file rng.hpp.

#include <rng.hpp>

Public Member Functions

 Rng (uint32_t seed=1)
 
uint32_t next ()
 Advance state and return raw 32-bit value.
 
float bipolar ()
 Random float in [-1.0, 1.0].
 
float unipolar ()
 Random float in [0.0, 1.0].
 
void seed (uint32_t s)
 Set state directly (for test reproducibility).
 

Constructor & Destructor Documentation

◆ Rng()

sbl::dsp::primitives::Rng::Rng ( uint32_t  seed = 1)
inlineexplicit
Note
All public methods are ISR-safe — bounded computation, no I/O. Construct with seed. Each instance should use a different seed to ensure uncorrelated output.

Definition at line 28 of file rng.hpp.

Member Function Documentation

◆ next()

uint32_t sbl::dsp::primitives::Rng::next ( )
inline

Advance state and return raw 32-bit value.

Definition at line 31 of file rng.hpp.

Referenced by bipolar(), and unipolar().

◆ bipolar()

float sbl::dsp::primitives::Rng::bipolar ( )
inline

Random float in [-1.0, 1.0].

Definition at line 39 of file rng.hpp.

References next().

Referenced by sbl::dsp::modules::TapeDelay::process(), and sbl::dsp::comp::AnalogDrift::process().

◆ unipolar()

float sbl::dsp::primitives::Rng::unipolar ( )
inline

Random float in [0.0, 1.0].

Definition at line 45 of file rng.hpp.

References next().

◆ seed()

void sbl::dsp::primitives::Rng::seed ( uint32_t  s)
inline

Set state directly (for test reproducibility).

Definition at line 50 of file rng.hpp.

Referenced by sbl::dsp::comp::AnalogDrift::seed().


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