|
| static BiquadCoeffs | makeLowPass (double sampleRate, double freq, double Q=0.7071067811865476) noexcept |
| | Low-pass filter.
|
| |
| static BiquadCoeffs | makeHighPass (double sampleRate, double freq, double Q=0.7071067811865476) noexcept |
| | High-pass filter.
|
| |
| static BiquadCoeffs | makeBandPass (double sampleRate, double freq, double Q=0.7071067811865476) noexcept |
| | Band-pass filter (constant 0 dB peak gain).
|
| |
| static BiquadCoeffs | makePeak (double sampleRate, double freq, double Q, double gainDb) noexcept |
| | Peak (parametric EQ) filter.
|
| |
| static BiquadCoeffs | makePeakMatched (double sampleRate, double freq, double Q, double gainDb) noexcept |
| | Analog-matched ("de-cramped") peaking filter (Vicanek design).
|
| |
| static BiquadCoeffs | makeLowShelf (double sampleRate, double freq, double gainDb, double slope=1.0) noexcept |
| | Low-shelf filter.
|
| |
| static BiquadCoeffs | makeHighShelf (double sampleRate, double freq, double gainDb, double slope=1.0) noexcept |
| | High-shelf filter.
|
| |
| static BiquadCoeffs | makeNotch (double sampleRate, double freq, double Q=0.7071067811865476) noexcept |
| | Notch (band-reject) filter.
|
| |
| static BiquadCoeffs | makeAllPass (double sampleRate, double freq, double Q=0.7071067811865476) noexcept |
| | All-pass filter.
|
| |
| static BiquadCoeffs | makeFirstOrderLowPass (double sampleRate, double frequency) noexcept |
| | First-order (6 dB/oct) low-pass filter.
|
| |
| static BiquadCoeffs | makeFirstOrderHighPass (double sampleRate, double frequency) noexcept |
| | First-order (6 dB/oct) high-pass filter.
|
| |
| static BiquadCoeffs | makeTilt (double sampleRate, double pivotFreq, double gainDb) noexcept |
| | Creates a first-order tilt filter.
|
| |
| static BiquadCoeffs | makeKWeightingShelf (double sampleRate) noexcept |
| | ITU-R BS.1770 K-weighting, stage 1: the head-related high shelf.
|
| |
| static BiquadCoeffs | makeKWeightingHighPass (double sampleRate) noexcept |
| | ITU-R BS.1770 K-weighting, stage 2: the RLB high-pass.
|
| |
Stores normalised biquad coefficients (b0, b1, b2, a1, a2), always double.
Coefficients are pre-normalised by a0 in every factory method, so the filter processing loop never needs to divide by a0. Memory is aligned to 32 bytes to facilitate explicit SIMD vectorisation and CPU cache optimal loads.
All factory methods clamp frequency, Q and slope to safe ranges, so any finite parameter combination yields a stable filter. NaN parameters are not sanitised (they propagate into the coefficients), and the sample rate is trusted as-is: the framework contract is a valid AudioSpec upstream.
There is no float instantiation and no coefficient type parameter: a corner far below the sample rate is exact as a DESIGN but cannot be REALISED in float (see the file-level documentation for the measurements), and a coefficient set that cannot be realised is not a coefficient set. One precision, one rule, and the magnitude response drawn from these numbers is the response the audio path actually applies. For DC removal specifically, use DCBlocker, which is built for it.
Definition at line 105 of file Biquad.h.
| static BiquadCoeffs dspark::BiquadCoeffs::makePeakMatched |
( |
double |
sampleRate, |
|
|
double |
freq, |
|
|
double |
Q, |
|
|
double |
gainDb |
|
) |
| |
|
inlinestaticnoexcept |
Analog-matched ("de-cramped") peaking filter (Vicanek design).
The bilinear (cookbook) peaking filter cramps near Nyquist: high- frequency bells get narrower and their response is pinned to 0 dB at fs/2, deviating from the analog prototype above ~fs/6 (up to 11 dB in the audible band at 48 kHz). This design follows M. Vicanek, "Matched
Second Order Digital Filters" (2016): the poles are the analog prototype's poles mapped by impulse invariance (z = e^(sT), so the bell keeps its analog width at any frequency), and the minimum-phase numerator is solved in closed form for unity gain at DC, the exact peak gain at the centre frequency, and a response extremum there.
The prototype is the cookbook bell, H(s) = (s^2 + s*w0*sqrt(G)/Q + w0^2) / (s^2 + s*w0/(sqrt(G)*Q) + w0^2), so Q means the same as in makePeak() and both designs converge at low frequencies. Measured against that prototype over 20 Hz - 20 kHz (gains +/-3..24 dB, Q 0.5..4, centres up to 20 kHz): worst deviation 2.9 dB and mean 0.14 dB at 48 kHz (cookbook: 11 dB worst). Every finite parameter set yields a stable, minimum-phase filter, including centres close to Nyquist.
Falls back to identity for |gain| < 0.01 dB.
- Parameters
-
| sampleRate | Sample rate in Hz. |
| freq | Center frequency in Hz. |
| Q | Quality factor (bandwidth = freq / Q at the half-dB gain). |
| gainDb | Peak gain in decibels. |
Definition at line 247 of file Biquad.h.