Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
Public Member Functions | List of all members
sbl::dsp::OnePole Class Reference

#include <one_pole.hpp>

Collaboration diagram for sbl::dsp::OnePole:

Public Member Functions

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)
 
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.
 

Detailed Description

Definition at line 21 of file one_pole.hpp.

Member Function Documentation

◆ coefficient()

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

Current coefficient.

Definition at line 79 of file one_pole.hpp.

◆ process() [1/2]

void sbl::dsp::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 69 of file one_pole.hpp.

References process().

Here is the call graph for this function:

◆ process() [2/2]

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

Process a single sample.

Parameters
xInput sample
Returns
Filtered output

Definition at line 58 of file one_pole.hpp.

Referenced by process(), sbl::widgets::proc::Delay::process(), and sbl::widgets::proc::PlateReverb::process().

Here is the caller graph for this function:

◆ reset() [1/2]

void sbl::dsp::OnePole::reset ( )
inline

Reset filter state to zero.

Definition at line 82 of file one_pole.hpp.

Referenced by sbl::widgets::proc::Delay::reset(), and sbl::widgets::proc::PlateReverb::reset().

Here is the caller graph for this function:

◆ reset() [2/2]

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

Reset filter state to a specific value.

Definition at line 85 of file one_pole.hpp.

◆ set_coefficient()

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

Set filter coefficient directly.

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

a = 0.0 → no filtering (hold previous output), 1.0 → full passthrough. For audio-rate smoothing: ~0.03-0.12. For parameter smoothing: ~0.002-0.008.

Definition at line 31 of file one_pole.hpp.

Referenced by sbl::widgets::proc::PlateReverb::set_damping(), and sbl::widgets::proc::Delay::set_tone().

Here is the caller graph for this function:

◆ set_frequency()

void sbl::dsp::OnePole::set_frequency ( float  freq_hz,
uint32_t  sr = 48000 
)
inline

Compute coefficient from cutoff frequency (cold path)

Uses approximation of 1 - exp(-2pi * fc / sr).

Parameters
freq_hzCutoff frequency in Hz
srSample rate

Definition at line 41 of file one_pole.hpp.

Referenced by sbl::widgets::proc::PlateReverb::set_sample_rate().

Here is the caller graph for this function:

◆ value()

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

Current filter state (last output)

Definition at line 76 of file one_pole.hpp.


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