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::comp::WavefoldAA Class Reference

Detailed Description

Second-order ADAA wavefolder for real-time audio.

Uses the integrated linear interpolation formulation (Bilbao et al.):

d1(a, b) = (F2(a) - F2(b)) / (a - b) when |a - b| > ε = F1(a) when |a - b| ≤ ε

y[n] = 2 * (d1(x[n], x[n-1]) - d1(x[n-1], x[n-2])) / (x[n] - x[n-2])

The outer denominator spans two samples (x[n] - x[n-2]) for centered differencing. When well-conditioned, this gives ~12 dB/octave alias rejection — double first-order.

Near signal peaks where dx is small, the outer double-division suffers catastrophic cancellation. The fallback is first-order ADAA (single division of F1), which stays numerically stable and still antialiases.

Definition at line 99 of file wavefold_aa.hpp.

#include <wavefold_aa.hpp>

Public Member Functions

void reset ()
 
float process (float x)
 Process a single sample (pre-multiplied by depth)
 
void process (float *buf, uint16_t frames, float depth, const float *depth_buf=nullptr)
 

Member Function Documentation

◆ reset()

void sbl::dsp::comp::WavefoldAA::reset ( )
inline
Note
All public methods are ISR-safe — bounded computation, no I/O.

Definition at line 103 of file wavefold_aa.hpp.

References sbl::dsp::comp::wavefold_antideriv(), and sbl::dsp::comp::wavefold_antideriv2().

Referenced by sbl::dsp::widgets::Shaper::reset().

◆ process() [1/2]

float sbl::dsp::comp::WavefoldAA::process ( float  x)
inline

Process a single sample (pre-multiplied by depth)

Definition at line 112 of file wavefold_aa.hpp.

References sbl::dsp::primitives::Folder::fold(), sbl::dsp::comp::wavefold_antideriv(), and sbl::dsp::comp::wavefold_antideriv2().

Referenced by sbl::dsp::widgets::Shaper::process(), and process().

◆ process() [2/2]

void sbl::dsp::comp::WavefoldAA::process ( float *  buf,
uint16_t  frames,
float  depth,
const float *  depth_buf = nullptr 
)
inline

Process a block in-place with constant or per-sample fold depth

Parameters
bufFloat audio buffer (modified in-place)
framesNumber of samples
depthConstant fold depth (used when depth_buf is nullptr)
depth_bufPer-sample depth buffer (nullptr = use constant depth)

Definition at line 156 of file wavefold_aa.hpp.

References process().


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