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

#include <allpass.hpp>

Collaboration diagram for sbl::dsp::AllpassFilter:

Public Member Functions

 AllpassFilter (float *buffer, uint32_t delay)
 Construct with caller-provided buffer.
 
 AllpassFilter ()=default
 Default constructor for array initialization (must call init() before use)
 
void init (float *buffer, uint32_t delay)
 Initialize after default construction.
 
float process (float x)
 Process a single sample.
 
void set_feedback (float g)
 Set feedback coefficient.
 
float feedback () const
 Current feedback coefficient.
 
void clear ()
 Zero the buffer and reset write position.
 
uint32_t delay () const
 Delay length in samples.
 
uint32_t write_pos () const
 Current write position (for external tap reads)
 

Detailed Description

Definition at line 24 of file allpass.hpp.

Constructor & Destructor Documentation

◆ AllpassFilter() [1/2]

sbl::dsp::AllpassFilter::AllpassFilter ( float *  buffer,
uint32_t  delay 
)
inline

Construct with caller-provided buffer.

Note
All public methods are ISR-safe — bounded computation, no I/O.
Parameters
bufferFloat buffer (must outlive the AllpassFilter)
delayDelay length in samples (buffer size)

Definition at line 33 of file allpass.hpp.

◆ AllpassFilter() [2/2]

sbl::dsp::AllpassFilter::AllpassFilter ( )
default

Default constructor for array initialization (must call init() before use)

Member Function Documentation

◆ clear()

void sbl::dsp::AllpassFilter::clear ( )
inline

Zero the buffer and reset write position.

Definition at line 85 of file allpass.hpp.

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

Here is the caller graph for this function:

◆ delay()

uint32_t sbl::dsp::AllpassFilter::delay ( ) const
inline

Delay length in samples.

Definition at line 93 of file allpass.hpp.

Referenced by init().

Here is the caller graph for this function:

◆ feedback()

float sbl::dsp::AllpassFilter::feedback ( ) const
inline

Current feedback coefficient.

Definition at line 82 of file allpass.hpp.

◆ init()

void sbl::dsp::AllpassFilter::init ( float *  buffer,
uint32_t  delay 
)
inline

Initialize after default construction.

Parameters
bufferFloat buffer (must outlive the AllpassFilter)
delayDelay length in samples

Definition at line 44 of file allpass.hpp.

References delay().

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ process()

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

Process a single sample.

Schroeder allpass: y = -g*x + x[n-d] + g*y[n-d] where the buffer stores the output history.

Parameters
xInput sample in [-1.0, 1.0]
Returns
Allpass-filtered output in [-1.0, 1.0]

Definition at line 59 of file allpass.hpp.

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

Here is the caller graph for this function:

◆ set_feedback()

void sbl::dsp::AllpassFilter::set_feedback ( float  g)
inline

Set feedback coefficient.

Parameters
gFeedback gain, typically 0.5–0.7 for reverb diffusion

Definition at line 79 of file allpass.hpp.

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

Here is the caller graph for this function:

◆ write_pos()

uint32_t sbl::dsp::AllpassFilter::write_pos ( ) const
inline

Current write position (for external tap reads)

Definition at line 96 of file allpass.hpp.

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

Here is the caller graph for this function:

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