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::OnePole Class Reference

Detailed Description

Definition at line 38 of file one_pole.hpp.

#include <one_pole.hpp>

Public Member Functions

void set_range (float min_hz, float max_hz)
 Set frequency range for _su mapping (configuration, not a signal)
 
void set_cutoff_su (float su)
 Set cutoff frequency via signal unit.
 
void set_coefficient (float a)
 Set filter coefficient directly.
 
float process (float x)
 Process a single sample.
 
void process (float *buf, uint16_t frames)
 Process a block of samples in-place.
 
float value () const
 Current filter state (last output)
 
float coefficient () const
 Current coefficient.
 
void reset ()
 Reset filter state to zero.
 
void reset (float initial)
 Reset filter state to a specific value.
 

Friends

struct OnePoleTestAccess
 

Member Function Documentation

◆ set_range()

void sbl::dsp::primitives::OnePole::set_range ( float  min_hz,
float  max_hz 
)
inline

Set frequency range for _su mapping (configuration, not a signal)

Note
All public methods are ISR-safe — bounded computation, no I/O.

Defines the Hz range that [0, 1] maps to exponentially. Default range is 20–20000 Hz.

Parameters
min_hzFrequency at su = 0.0
max_hzFrequency at su = 1.0

Definition at line 51 of file one_pole.hpp.

Referenced by sbl::dsp::pm::StringLoop::init(), and sbl::dsp::primitives::OnePoleHP::set_range().

◆ set_cutoff_su()

void sbl::dsp::primitives::OnePole::set_cutoff_su ( float  su)
inline

Set cutoff frequency via signal unit.

Maps [0, 1] exponentially across the configured frequency range. su = 0.0 → min_hz, su = 1.0 → max_hz.

Parameters
suUnipolar signal [0, 1]

Definition at line 64 of file one_pole.hpp.

References sbl::dsp::math::clamp01(), and sbl::dsp::math::su_to_hz().

Referenced by sbl::dsp::pm::StringLoop::init(), sbl::dsp::modules::AlgoReverb< ScalePercent >::process(), sbl::dsp::modules::TapeDelay::process(), sbl::dsp::primitives::OnePoleHP::set_cutoff_su(), and sbl::dsp::pm::StringLoop::set_damping_su().

◆ set_coefficient()

void sbl::dsp::primitives::OnePole::set_coefficient ( float  a)
inline

Set filter coefficient directly.

a = 0.0 → no filtering (hold previous output), 1.0 → full passthrough.

Definition at line 73 of file one_pole.hpp.

Referenced by sbl::dsp::modules::AlgoReverb< ScalePercent >::process(), and sbl::dsp::primitives::OnePoleHP::set_coefficient().

◆ process() [1/2]

float sbl::dsp::primitives::OnePole::process ( float  x)
inline

Process a single sample.

Parameters
xInput sample
Returns
Filtered output

Definition at line 80 of file one_pole.hpp.

Referenced by process(), sbl::dsp::modules::AlgoReverb< ScalePercent >::process(), sbl::dsp::modules::TapeDelay::process(), sbl::dsp::primitives::OnePoleHP::process(), and sbl::dsp::pm::StringLoop::tick().

◆ process() [2/2]

void sbl::dsp::primitives::OnePole::process ( float *  buf,
uint16_t  frames 
)
inline

Process a block of samples in-place.

Parameters
bufAudio buffer (modified in-place)
framesNumber of samples

Definition at line 90 of file one_pole.hpp.

References process().

◆ value()

float sbl::dsp::primitives::OnePole::value ( ) const
inline

Current filter state (last output)

Definition at line 97 of file one_pole.hpp.

◆ coefficient()

float sbl::dsp::primitives::OnePole::coefficient ( ) const
inline

Current coefficient.

Definition at line 100 of file one_pole.hpp.

Referenced by sbl::dsp::primitives::OnePoleHP::coefficient().

◆ reset() [1/2]

◆ reset() [2/2]

void sbl::dsp::primitives::OnePole::reset ( float  initial)
inline

Reset filter state to a specific value.

Definition at line 106 of file one_pole.hpp.

Friends And Related Symbol Documentation

◆ OnePoleTestAccess

friend struct OnePoleTestAccess
friend

Definition at line 109 of file one_pole.hpp.


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