42 float w = 6.2831853f * freq_hz /
static_cast<float>(sr);
48 float denom = 1.0f + w + x2 * 0.5f + x2 * w * 0.166667f;
49 coeff_ = 1.0f - 1.0f / denom;
60 state_ += coeff_ * (x - state_);
69 void process(
float* buf, uint16_t frames) {
70 for (uint16_t i = 0; i < frames; ++i) {
76 float value()
const {
return state_; }
85 void reset(
float initial) { state_ = initial; }
void reset(float initial)
Reset filter state to a specific value.
float value() const
Current filter state (last output)
void reset()
Reset filter state to zero.
void process(float *buf, uint16_t frames)
Process a block of samples in-place.
float process(float x)
Process a single sample.
float coefficient() const
Current coefficient.
void set_coefficient(float a)
Set filter coefficient directly.
void set_frequency(float freq_hz, uint32_t sr=48000)
Compute coefficient from cutoff frequency (cold path)
DSP atoms for audio signal processing.