|
DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
|
One second-order section in normalized ladder form, per channel. More...
#include <NormalizedLadder.h>
Classes | |
| struct | Coeffs |
| The two rotations and the three taps (the identity by default). More... | |
Public Member Functions | |
| void | setCoeffs (const BiquadCoeffs &b) noexcept |
| Makes a biquad's response the section's own from the next sample; ends a ramp. | |
| void | setLadder (const Coeffs &l) noexcept |
| Sets rotations and taps directly from the next sample; ends a ramp. | |
| void | rampCoeffs (const BiquadCoeffs &target, int samples) noexcept |
| Moves the rotations and the taps linearly to those of a biquad. | |
| Coeffs | getLadder () const noexcept |
| Rotations and taps in use now (mid ramp, where the ramp is). | |
| bool | isRamping () const noexcept |
| Whether the coefficients are moving. | |
| void | reset () noexcept |
| Clears the memory of every channel. Coefficients and ramp are kept. | |
| double | getStateEnergy (int channel) const noexcept |
| The energy in a channel's memory, x1^2 + x2^2 (it only falls with no input). | |
| void | processBlock (AudioBufferView< T > buffer) noexcept |
| Runs a block through the section, in place. | |
| double | processSample (double input, int channel) noexcept |
| One sample of one channel, in double, with the coefficients as they are. | |
| void | processSegment (double *data, int numSamples, int channel) noexcept |
| Runs one channel's samples through the section, in double and in place, walking the ramp from where it stands without moving it on. | |
| void | advanceRamp (int samples) noexcept |
| Moves the ramp on by a number of samples (for processSample() callers). | |
Static Public Member Functions | |
| static Coeffs | fromBiquad (const BiquadCoeffs &b) noexcept |
| The ladder of a biquad. | |
| static BiquadCoeffs | toBiquad (const Coeffs &l) noexcept |
| The biquad a ladder realises (for curves and checks). | |
One second-order section in normalized ladder form, per channel.
| T | Sample type of the buffers (float or double); the recursion and its memory are double either way. |
| MaxChannels | Largest number of channels. |
Definition at line 71 of file NormalizedLadder.h.
|
inlinenoexcept |
Moves the ramp on by a number of samples (for processSample() callers).
| samples | Samples gone by; a ramp with fewer left lands on its target. |
Definition at line 275 of file NormalizedLadder.h.
|
inlinestaticnoexcept |
The ladder of a biquad.
A set whose poles are on or outside the unit circle has a reflection coefficient of magnitude one or more; it is brought just inside, so the section stays passive whatever it is given.
| b | Normalised biquad coefficients. |
Definition at line 92 of file NormalizedLadder.h.
|
inlinenoexcept |
Rotations and taps in use now (mid ramp, where the ramp is).
Definition at line 160 of file NormalizedLadder.h.
|
inlinenoexcept |
The energy in a channel's memory, x1^2 + x2^2 (it only falls with no input).
Definition at line 172 of file NormalizedLadder.h.
|
inlinenoexcept |
Whether the coefficients are moving.
Definition at line 163 of file NormalizedLadder.h.
|
inlinenoexcept |
Runs a block through the section, in place.
Channels beyond MaxChannels are left untouched; every channel walks the same ramp. A memory a non-finite sample has reached is cleared at the end of the block.
| buffer | Audio to filter. |
Definition at line 187 of file NormalizedLadder.h.
|
inlinenoexcept |
One sample of one channel, in double, with the coefficients as they are.
Ramps advance in processBlock(), or by the caller's advanceRamp() once per frame.
Definition at line 228 of file NormalizedLadder.h.
|
inlinenoexcept |
Runs one channel's samples through the section, in double and in place, walking the ramp from where it stands without moving it on.
For owners that run their channels one after another over the same frames: every channel walks the same coefficients, and advanceRamp() by the same count, once all of them have run, moves the ramp on (the result is processBlock()'s, to the bit).
| data | Samples of the channel, filtered in place. |
| numSamples | Number of samples. |
| channel | Channel whose memory the samples run through. |
Definition at line 249 of file NormalizedLadder.h.
|
inlinenoexcept |
Moves the rotations and the taps linearly to those of a biquad.
The ramp starts from the values in use and lands exactly on the target after samples samples. Along it each rotation stays on or inside the unit circle: the section never adds energy to its memory.
| target | Response to arrive at. |
| samples | Length of the ramp in samples; 0 or less sets it at once. |
Definition at line 147 of file NormalizedLadder.h.
|
inlinenoexcept |
Clears the memory of every channel. Coefficients and ramp are kept.
Definition at line 166 of file NormalizedLadder.h.
|
inlinenoexcept |
Makes a biquad's response the section's own from the next sample; ends a ramp.
Definition at line 127 of file NormalizedLadder.h.
|
inlinenoexcept |
Sets rotations and taps directly from the next sample; ends a ramp.
Definition at line 130 of file NormalizedLadder.h.
|
inlinestaticnoexcept |
The biquad a ladder realises (for curves and checks).
| l | Rotations and taps. |
Definition at line 115 of file NormalizedLadder.h.