|
Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
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) |
|
inline |
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().
|
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().
|
inline |
Process a block in-place with constant or per-sample fold depth
| buf | Float audio buffer (modified in-place) |
| frames | Number of samples |
| depth | Constant fold depth (used when depth_buf is nullptr) |
| depth_buf | Per-sample depth buffer (nullptr = use constant depth) |
Definition at line 156 of file wavefold_aa.hpp.
References process().