Second-order low-shelf filter (BiQuad DF2). Boosts or cuts frequencies below the shelf frequency by the specified gain (in dB) while leaving higher frequencies unchanged. Commonly used in tone controls and equalization. Coefficients are derived from the Audio EQ Cookbook.
More...
#include <Filter.h>
|
| | LowShelfFilter ()=default |
| |
| | LowShelfFilter (float frequency, float sampleRate, float gain, float slope=1.0f) |
| |
| void | begin (float frequency, float sampleRate, float gain, float slope=1.0f) |
| |
| T | process (T value) override |
| | Processes the input value and returns the filtered output value.
|
| |
| void | reset () override |
| |
template<typename T = float>
class audio_tools::LowShelfFilter< T >
Second-order low-shelf filter (BiQuad DF2). Boosts or cuts frequencies below the shelf frequency by the specified gain (in dB) while leaving higher frequencies unchanged. Commonly used in tone controls and equalization. Coefficients are derived from the Audio EQ Cookbook.
- Parameters
-
| frequency | shelf transition frequency in Hz |
| sampleRate | sample rate in Hz |
| gain | boost/cut in dB (positive = boost, negative = cut) |
| slope | shelf slope (default 1.0; values < 1.0 give a gentler slope) |
- Author
- pschatzmann
- Copyright
- GNU General Public License v3.0
- Template Parameters
-
| T | sample type (use float or double). NOTE: unlike the other filters here, LowShelfFilterDF1 is NOT a reliable fix for bounded fixed-point types like q1_14_t: shelf coefficients scale with the linear gain factor 10^(gain_dB/40) and can exceed a bounded type's range even at modest gain settings, independent of DF1 vs DF2 – this is a coefficient headroom limitation, not the DF2 state-headroom issue DF1 solves for the other filter types. begin() logs an error (LOGE) via checkCoeffRange() if this happens; check for that warning rather than assuming it works. |
◆ LowShelfFilter() [1/2]
template<typename T = float>
◆ LowShelfFilter() [2/2]
template<typename T = float>
| LowShelfFilter |
( |
float |
frequency, |
|
|
float |
sampleRate, |
|
|
float |
gain, |
|
|
float |
slope = 1.0f |
|
) |
| |
|
inline |
◆ begin()
template<typename T = float>
| void begin |
( |
float |
frequency, |
|
|
float |
sampleRate, |
|
|
float |
gain, |
|
|
float |
slope = 1.0f |
|
) |
| |
|
inline |
◆ process()
template<typename T = float>
|
|
inlineoverridevirtualinherited |
Processes the input value and returns the filtered output value.
Implements Filter< T >.
◆ reset()
template<typename T = float>
|
|
inlineoverridevirtualinherited |
Clears the internal state (delay lines) without changing the coefficients. Call after reconfiguring filter parameters via begin() to avoid transients from stale state.
Reimplemented from Filter< T >.
◆ a_1
template<typename T = float>
◆ a_2
template<typename T = float>
◆ b_0
template<typename T = float>
◆ b_1
template<typename T = float>
◆ b_2
template<typename T = float>
◆ w_0
template<typename T = float>
◆ w_1
template<typename T = float>
The documentation for this class was generated from the following file:
- src/AudioTools/CoreAudio/AudioFilter/Filter.h