|
| | SaturatorT () |
| void | prepare (double sample_rate) |
| | Sizes the oversampler and the dry-path alignment delay. May allocate.
|
| void | set_shape (Shape shape) |
| Shape | shape () const |
| void | set_drive_db (double db) |
| double | drive_db () const |
| void | set_bias (double normalized) |
| | Bias as a normalised [-1, +1].
|
| double | bias () const |
| | The bias actually in force after any shape-specific clamp — exposed so a caller can show the effective value rather than the requested one.
|
| void | set_tone_pre_hz (double hz) |
| | Pre-emphasis corner in Hz. 0 disables the pre/de pair.
|
| void | set_tone_tracking (bool tracking) |
| | When true (the default) the de-emphasis corner follows the pre-emphasis corner, so the pair cancels exactly.
|
| void | set_tone_de_hz (double hz) |
| | De-emphasis corner, used only when tracking is off.
|
| void | set_pre_boost_db (double db) |
| void | set_alias_policy (AliasPolicy policy) |
| | Select the alias policy.
|
| AliasPolicy | alias_policy () const |
| void | set_mix (double wet01) |
| void | set_output_trim_db (double db) |
| int | latency_samples () const noexcept |
| | The integer delay the host should compensate, matched on the dry path.
|
| double | group_delay_samples () const noexcept |
| | The wet path's exact delay on the linear part of the curve, in samples: 0.5 for adaa (its two-tap average), 1 for adaa2, the oversampler's exact figure for oversample_2x, 0 for off.
|
| void | reset () |
| | Never allocates; a zero-initialised instance is already in this state.
|
| SampleType | process (SampleType input) |
| | One sample through the full chain: pre-emphasis, alias-safe shaping, de-emphasis, latency-aligned dry/wet, trim.
|
| double | worst_case_gain () const |
| | The supremum of |shaped(x) / x| over every input, at the current shape and bias — the bound Forge's registry cites (series law 8), and a tested invariant rather than an estimate.
|
| double | shaped (double x) const |
| | The normalised shaper itself, exposed so a caller (or a test) can evaluate the curve without running it through the alias policy or the tone pair.
|
|
| static constexpr double | kDriveDbMin = -12.0 |
| | Drive range in dB.
|
| static constexpr double | kDriveDbMax = 36.0 |
| static constexpr double | kDriveDbDefault = 0.0 |
| static constexpr double | kBiasMax = 1.0 |
| | Bias magnitude ceiling. [design parameter] default 1.0, fixed.
|
| static constexpr double | kCubicBiasClamp = 0.98 |
| | The cubic's own clip boundary is at |u| = 1, where f'(b) = 1 − b² reaches zero — and the bias normaliser divides by it.
|
| static constexpr double | kTonePreHzDefault = 3000.0 |
| | Pre-emphasis corner.
|
| static constexpr double | kTonePreHzMax = 8000.0 |
| static constexpr double | kTonePreHzFloor = 20.0 |
| | Lowest corner the shelf will actually be placed at.
|
| static constexpr double | kPreBoostDbDefault = 9.0 |
| | Shelf gain magnitude: boost before the shaper, cut after.
|
| static constexpr double | kPreBoostDbMax = 18.0 |
| static constexpr double | kShelfQ = 0.70710678118654752 |
| | Shelf Q.
|
| static constexpr double | kAdaaEpsilon = 1e-6 |
| | ADAA's near-degenerate-denominator guard.
|
| static constexpr double | kOutputTrimDbMax = 24.0 |
| | Output trim range. [design parameter] default 0 dB, range ±24 dB.
|
template<typename SampleType = float>
class pulp::signal::SaturatorT< SampleType >
The memoryless saturation stage.
template<typename SampleType = float>
The integer delay the host should compensate, matched on the dry path.
One sample for adaa2, whose three-point stencil is centred one sample back; the composed oversampler's own reported latency for oversample_2x; zero for off, and zero for adaa, whose half sample is below what an integer delay can express (group_delay_samples()).
template<typename SampleType = float>
The supremum of |shaped(x) / x| over every input, at the current shape and bias — the bound Forge's registry cites (series law 8), and a tested invariant rather than an estimate.
It is f'(0) / f'(b) = 1 / f'(b): the shaper's steepest slope (always at the origin, for all four members) divided by the slope at the operating point that the bias construction normalises by. Exactly 1.0 unbiased. Independent of drive, because the drive law divides by the same d it multiplies the argument by.
template<typename SampleType = float>
ADAA's near-degenerate-denominator guard.
When two consecutive samples are this close, the difference quotient loses precision and the direct evaluation at their midpoint is used instead.
Honest gap: no citable literature pins this value. Bilbao et al. establish the method and the need for a fallback branch, not a threshold. Any value far below a typical sample-to-sample delta and far above float rounding noise works. [design parameter] default 1e-6, range 1e-9 .. 1e-3.