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

Detailed Description

Definition at line 21 of file dc_blocker.hpp.

#include <dc_blocker.hpp>

Public Member Functions

float process (float x)
 Process one sample through the DC blocker.
 
void process (float *buf, uint16_t frames)
 Process a block of float samples in-place.
 
void set_coefficient (float r)
 Set the pole coefficient.
 
void reset ()
 Reset filter state to zero.
 

Static Public Attributes

static constexpr float DEFAULT_POLE = 0.995f
 

Member Function Documentation

◆ process() [1/2]

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

Process one sample through the DC blocker.

Note
All public methods are ISR-safe — bounded computation, no I/O.
Parameters
xInput sample
Returns
Output with DC removed

Definition at line 30 of file dc_blocker.hpp.

Referenced by process(), and sbl::dsp::modules::TapeDelay::process().

◆ process() [2/2]

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

Process a block of float samples in-place.

Parameters
bufSample buffer
framesNumber of samples

Definition at line 42 of file dc_blocker.hpp.

References process().

◆ set_coefficient()

void sbl::dsp::primitives::DcBlocker::set_coefficient ( float  r)
inline

Set the pole coefficient.

Higher values (closer to 1.0) = lower cutoff frequency. Default 0.995 ≈ 16 Hz at 48 kHz sample rate.

Parameters
rPole coefficient, typically 0.99-0.999

Definition at line 56 of file dc_blocker.hpp.

◆ reset()

void sbl::dsp::primitives::DcBlocker::reset ( )
inline

Reset filter state to zero.

Definition at line 59 of file dc_blocker.hpp.

Referenced by sbl::dsp::modules::TapeDelay::reset().

Member Data Documentation

◆ DEFAULT_POLE

constexpr float sbl::dsp::primitives::DcBlocker::DEFAULT_POLE = 0.995f
staticconstexpr

Definition at line 61 of file dc_blocker.hpp.


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