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::ThiranAllpass< N > Class Template Reference

Order-N Thiran allpass: fractional delay by phase, not interpolation. More...

Detailed Description

template<uint8_t N = 1>
class sbl::dsp::primitives::ThiranAllpass< N >

Order-N Thiran allpass: fractional delay by phase, not interpolation.

Template Parameters
NFilter order; the delay it can express is N ± 0.5 samples.
Note
All public methods are ISR-safe — bounded computation, no I/O.

Definition at line 56 of file thiran_allpass.hpp.

#include <thiran_allpass.hpp>

Inheritance diagram for sbl::dsp::primitives::ThiranAllpass< N >:
[legend]

Public Member Functions

 ThiranAllpass ()
 
void set_delay (float delay_samples)
 Set the total phase delay in samples.
 
float process (float x)
 Process one sample.
 
float group_delay_samples () const
 Phase delay the filter is tuned to, in samples (flat at DC by design).
 
void reset ()
 

Static Public Member Functions

static constexpr uint8_t order ()
 
static constexpr float min_delay ()
 Smallest and largest delay this order can express.
 
static constexpr float max_delay ()
 

Constructor & Destructor Documentation

◆ ThiranAllpass()

template<uint8_t N = 1>
sbl::dsp::primitives::ThiranAllpass< N >::ThiranAllpass ( )
inline

Member Function Documentation

◆ set_delay()

template<uint8_t N = 1>
void sbl::dsp::primitives::ThiranAllpass< N >::set_delay ( float  delay_samples)
inline

Set the total phase delay in samples.

Clamped to [N - 0.5, N + 0.5]. Coefficients are recomputed here, so call it when the pitch changes (block rate), not per sample.

Definition at line 69 of file thiran_allpass.hpp.

References sbl::dsp::primitives::detail::binomial(), and sbl::dsp::math::clamp().

Referenced by sbl::dsp::primitives::ThiranAllpass< N >::ThiranAllpass().

◆ process()

template<uint8_t N = 1>
float sbl::dsp::primitives::ThiranAllpass< N >::process ( float  x)
inline

Process one sample.

Numerator coefficients are the denominator's, reversed — that is what makes the magnitude response unity.

Definition at line 92 of file thiran_allpass.hpp.

Referenced by sbl::dsp::pm::StringLoop::tick().

◆ group_delay_samples()

template<uint8_t N = 1>
float sbl::dsp::primitives::ThiranAllpass< N >::group_delay_samples ( ) const
inline

Phase delay the filter is tuned to, in samples (flat at DC by design).

Definition at line 112 of file thiran_allpass.hpp.

Referenced by sbl::dsp::pm::StringLoop::allpass_delay_samples(), and sbl::dsp::pm::StringLoop::describe().

◆ reset()

template<uint8_t N = 1>
void sbl::dsp::primitives::ThiranAllpass< N >::reset ( )
inline

Definition at line 114 of file thiran_allpass.hpp.

Referenced by sbl::dsp::pm::StringLoop::reset().

◆ order()

template<uint8_t N = 1>
static constexpr uint8_t sbl::dsp::primitives::ThiranAllpass< N >::order ( )
inlinestaticconstexpr

Definition at line 121 of file thiran_allpass.hpp.

◆ min_delay()

template<uint8_t N = 1>
static constexpr float sbl::dsp::primitives::ThiranAllpass< N >::min_delay ( )
inlinestaticconstexpr

Smallest and largest delay this order can express.

Definition at line 124 of file thiran_allpass.hpp.

◆ max_delay()

template<uint8_t N = 1>
static constexpr float sbl::dsp::primitives::ThiranAllpass< N >::max_delay ( )
inlinestaticconstexpr

Definition at line 125 of file thiran_allpass.hpp.


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