|
DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
|
The lookahead as a ramp (LookaheadShape::Ramp). More...
#include <Compressor.h>
Public Member Functions | |
| void | prepare (int maxLength) |
| Allocates for a longest ramp. | |
| void | clear () noexcept |
| void | setLength (int wanted) noexcept |
Moves the ramp's length to wanted, a sample at a time (the sums follow, each step in constant time). | |
| T | process (T gr) noexcept |
| One gain change in dB in, the ramped one out. | |
Public Attributes | |
| std::vector< T > | deepVal |
| std::vector< T > | boxA |
| std::vector< T > | boxB |
| The queue of the sliding window; the histories of the two averages. | |
| std::vector< uint32_t > | deepPos |
| When each queued value came. | |
| uint32_t | t = 0 |
| Values taken so far (wraps). | |
| int | mask = 0 |
| int | head = 0 |
| int | count = 0 |
| int | length = 0 |
| int | lenA = 1 |
| int | lenB = 1 |
| int | zerosA = 0 |
| int | zerosB = 0 |
| double | sumA = 0.0 |
| double | sumB = 0.0 |
The lookahead as a ramp (LookaheadShape::Ramp).
Each gain change is replaced by the deepest of the last length + 1 (an exact sliding window: a queue in falling order of depth), and that runs through two moving averages whose lengths add up to length + 2. A reduction that the gain computer asks for at one sample is so reached, exactly, length samples later, when that sample leaves the lookahead's delay, along an S-shaped ramp; and it stays for length samples after the last sample that asked for it. With no gain change for as long as the window the output is exactly 0 dB.
Definition at line 3583 of file Compressor.h.
|
inlinenoexcept |
Definition at line 3604 of file Compressor.h.
|
inline |
Allocates for a longest ramp.
Definition at line 3592 of file Compressor.h.
|
inlinenoexcept |
One gain change in dB in, the ramped one out.
Definition at line 3636 of file Compressor.h.
|
inlinenoexcept |
Moves the ramp's length to wanted, a sample at a time (the sums follow, each step in constant time).
Definition at line 3616 of file Compressor.h.
| std::vector<T> dspark::Compressor< T >::LookaheadRamp::boxA |
Definition at line 3585 of file Compressor.h.
| std::vector<T> dspark::Compressor< T >::LookaheadRamp::boxB |
The queue of the sliding window; the histories of the two averages.
Definition at line 3585 of file Compressor.h.
| int dspark::Compressor< T >::LookaheadRamp::count = 0 |
Definition at line 3588 of file Compressor.h.
| std::vector<uint32_t> dspark::Compressor< T >::LookaheadRamp::deepPos |
When each queued value came.
Definition at line 3586 of file Compressor.h.
| std::vector<T> dspark::Compressor< T >::LookaheadRamp::deepVal |
Definition at line 3585 of file Compressor.h.
| int dspark::Compressor< T >::LookaheadRamp::head = 0 |
Definition at line 3588 of file Compressor.h.
| int dspark::Compressor< T >::LookaheadRamp::lenA = 1 |
Definition at line 3588 of file Compressor.h.
| int dspark::Compressor< T >::LookaheadRamp::lenB = 1 |
Definition at line 3588 of file Compressor.h.
| int dspark::Compressor< T >::LookaheadRamp::length = 0 |
Definition at line 3588 of file Compressor.h.
| int dspark::Compressor< T >::LookaheadRamp::mask = 0 |
Definition at line 3588 of file Compressor.h.
| double dspark::Compressor< T >::LookaheadRamp::sumA = 0.0 |
Definition at line 3589 of file Compressor.h.
| double dspark::Compressor< T >::LookaheadRamp::sumB = 0.0 |
Definition at line 3589 of file Compressor.h.
| uint32_t dspark::Compressor< T >::LookaheadRamp::t = 0 |
Values taken so far (wraps).
Definition at line 3587 of file Compressor.h.
| int dspark::Compressor< T >::LookaheadRamp::zerosA = 0 |
Definition at line 3588 of file Compressor.h.
| int dspark::Compressor< T >::LookaheadRamp::zerosB = 0 |
Definition at line 3588 of file Compressor.h.