|
Sound Byte Libs 0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
The correction buffer behind a band-limited edge, over a BLEP kernel. More...
The correction buffer behind a band-limited edge, over a BLEP kernel.
Holds the pending corrections for the frames an event touches and emits each frame once its corrections are complete, so the output trails the naive waveform by Kernel::LATENCY frames. Corrections from events closer than the kernel's span add linearly, which is exact. History and pending corrections are rings, so a frame moves an index and not the buffers; the pending ring wraps by a mask, so a kernel's FRAMES is a power of two.
Per frame, in this order: step() or corner() for each event that fell in the frame, with its sub-frame time from math::polyblep_time(), then process() with the frame's naive sample. An oscillator core, a hard clipper or an audio-rate sample-and-hold owns one of these; it is below the signal transport and has no ports.
The kernel is a policy type (the contract is in dsp/math/polyblep.hpp and checked below): math::Sinc16, the cores' default, math::Bspline4 and math::Linear2.
| Kernel | A BLEP kernel whose FRAMES is a power of two |
In a build with profiling, blep_correction_count() is the number of step() and corner() calls on every corrector, for an app that reports its events.
Definition at line 103 of file blep_corrector.hpp.
#include <blep_corrector.hpp>
Public Member Functions | |
| void | step (float t, float height) |
| A value step at a sub-frame time within the frame about to be pushed. | |
| void | corner (float t, float delta) |
| A slope change at a sub-frame time within the frame about to be pushed. | |
| float | process (float naive) |
| Push the frame's naive sample; return the corrected sample LATENCY frames back. | |
| void | reset () |
| Forget history and pending corrections. | |
Static Public Attributes | |
| static constexpr uint8_t | LATENCY = Kernel::LATENCY |
| Frames the output trails the naive waveform. | |
|
inline |
A value step at a sub-frame time within the frame about to be pushed.
| t | Fraction of a frame since the step, read at the frame about to be pushed, in [0, 1) |
| height | Height of the step |
Definition at line 126 of file blep_corrector.hpp.
|
inline |
A slope change at a sub-frame time within the frame about to be pushed.
| t | Fraction of a frame since the corner, read at the frame about to be pushed, in [0, 1) |
| delta | Change of slope, per frame |
Definition at line 135 of file blep_corrector.hpp.
|
inline |
Push the frame's naive sample; return the corrected sample LATENCY frames back.
The first LATENCY outputs after a reset are zero.
| naive | The frame's naive sample |
Definition at line 146 of file blep_corrector.hpp.
|
inline |
Forget history and pending corrections.
Definition at line 161 of file blep_corrector.hpp.
|
staticconstexpr |
Frames the output trails the naive waveform.
Definition at line 117 of file blep_corrector.hpp.