Deterministic discrete-time Poisson impulse source. More...
#include <dust.hpp>
Public Member Functions | |
| DustT () | |
| bool | prepare (double sample_rate) noexcept |
| bool | set_density_hz (double density_hz) noexcept |
| bool | set_level (SampleType level) noexcept |
| bool | set_distribution (DustAmplitudeDistribution distribution) noexcept |
| void | set_seed (std::uint32_t seed) noexcept |
| void | reset () noexcept |
| SampleType | process () noexcept |
| void | process (SampleType *output, std::size_t frames) noexcept |
| double | sample_rate () const noexcept |
| double | density_hz () const noexcept |
| SampleType | level () const noexcept |
| DustAmplitudeDistribution | distribution () const noexcept |
| std::uint32_t | seed () const noexcept |
| bool | triggered () const noexcept |
Static Public Member Functions | |
| static constexpr int | latency_samples () noexcept |
| static constexpr int | tail_samples () noexcept |
Static Public Attributes | |
| static constexpr double | kDefaultSampleRate = 48000.0 |
| static constexpr std::uint32_t | kDefaultSeed = 0xD0571234u |
Deterministic discrete-time Poisson impulse source.
Each sample is an independent Bernoulli trial with probability density_hz / sample_rate. This is the sample-grid form of a homogeneous Poisson process: its expected event rate is exactly density_hz, intervals are geometrically distributed, and at most one event can occupy a sample. Density is therefore legal on [0, sample_rate] Hz. Output level is a dimensionless magnitude on [0, 1]; bipolar amplitudes occupy [-level, level), while the other laws occupy [0, level]. Event timing and amplitude use independent streams derived from the same public seed, so changing the amplitude law or level never moves an event.
The public seed is the complete initial random condition. set_seed() selects it and reset() rewinds to it; no clock or device entropy is read. Identical parameter histories therefore produce identical samples under every block partition.
RT contract: process() and its block overload are bounded, allocation-free scalar work. There is no recursive floating-point state, so denormals cannot accumulate. Every generated value is finite. Latency and tail are zero.
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinestaticconstexprnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinestaticconstexprnoexcept |
|
inlinenoexcept |
|
staticconstexpr |
|
staticconstexpr |