23#ifndef SBL_DSP_PRIMITIVES_ONE_POLE_HPP_
24#define SBL_DSP_PRIMITIVES_ONE_POLE_HPP_
36struct OnePoleTestAccess;
53 octaves_ = std::log2(max_hz / min_hz);
81 state_ += coeff_ * (x - state_);
90 void process(
float* buf, uint16_t frames) {
91 for (uint16_t i = 0; i < frames; ++i) {
97 float value()
const {
return state_; }
106 void reset(
float initial) { state_ = initial; }
115 void set_frequency(
float freq_hz) {
121 float min_hz_ = 20.0f;
122 float octaves_ = 9.965784f;
134struct OnePoleHPTestAccess;
155 for (uint16_t i = 0; i < frames; ++i) {
Clamping (Cross-cutting — Math)
One-pole highpass filter (complement of OnePole LP)
float coefficient() const
void set_cutoff_su(float su)
void process(float *buf, uint16_t frames)
void set_range(float min_hz, float max_hz)
void reset(float initial)
void set_coefficient(float a)
void set_coefficient(float a)
Set filter coefficient directly.
void reset(float initial)
Reset filter state to a specific value.
void reset()
Reset filter state to zero.
void process(float *buf, uint16_t frames)
Process a block of samples in-place.
void set_range(float min_hz, float max_hz)
Set frequency range for _su mapping (configuration, not a signal)
float process(float x)
Process a single sample.
float value() const
Current filter state (last output)
float coefficient() const
Current coefficient.
void set_cutoff_su(float su)
Set cutoff frequency via signal unit.
The numbers every layer reaches for.
Fast analytical approximations (Audio Stack — Atoms)
Fixed-point constants and audio sample types.
constexpr float clamp01(float x)
x held to [0, 1]; NaN → 0.
constexpr float one_minus_exp_neg(float x)
float su_to_hz(float su, float min_hz, float octaves)
Stateful, single-concern building blocks.
Test access for OnePoleHP engineering-unit API.
static void set_frequency(OnePoleHP &f, float hz)
Test access for OnePole engineering-unit API.
static void set_frequency(OnePole &f, float hz)