arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
PeakFilter< T > Class Template Reference

Second-order peaking EQ filter (BiQuad DF2). Boosts or cuts a band around the center frequency by the specified gain (in dB) while leaving the other frequencies unchanged. Commonly used in tone controls and equalization (e.g. the mid control of a guitar amplifier). Coefficients are derived from the Audio EQ Cookbook. More...

#include <Filter.h>

Inheritance diagram for PeakFilter< T >:
Inheritance graph
[legend]
Collaboration diagram for PeakFilter< T >:
Collaboration graph
[legend]

Public Member Functions

 PeakFilter ()=default
 
 PeakFilter (float frequency, float sampleRate, float q, float gain)
 
void begin (float frequency, float sampleRate, float q, float gain)
 
T process (T value) override
 Processes the input value and returns the filtered output value.
 
void reset () override
 

Protected Attributes

T a_1 = 0
 
T a_2 = 0
 
T b_0 = 0
 
T b_1 = 0
 
T b_2 = 0
 
T w_0 = 0
 
T w_1 = 0
 

Detailed Description

template<typename T = float>
class audio_tools::PeakFilter< T >

Second-order peaking EQ filter (BiQuad DF2). Boosts or cuts a band around the center frequency by the specified gain (in dB) while leaving the other frequencies unchanged. Commonly used in tone controls and equalization (e.g. the mid control of a guitar amplifier). Coefficients are derived from the Audio EQ Cookbook.

Parameters
frequencycenter frequency in Hz
sampleRatesample rate in Hz
qquality factor: higher values give a narrower band
gainboost/cut in dB (positive = boost, negative = cut)
Author
pschatzmann
Template Parameters
Tsample type (use float or double)

Constructor & Destructor Documentation

◆ PeakFilter() [1/2]

template<typename T = float>
PeakFilter ( )
default

◆ PeakFilter() [2/2]

template<typename T = float>
PeakFilter ( float  frequency,
float  sampleRate,
float  q,
float  gain 
)
inline

Member Function Documentation

◆ begin()

template<typename T = float>
void begin ( float  frequency,
float  sampleRate,
float  q,
float  gain 
)
inline

◆ process()

template<typename T = float>
T process ( T  in)
inlineoverridevirtualinherited

Processes the input value and returns the filtered output value.

Implements Filter< T >.

◆ reset()

template<typename T = float>
void reset ( )
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 >.

Member Data Documentation

◆ a_1

template<typename T = float>
T a_1 = 0
protectedinherited

◆ a_2

template<typename T = float>
T a_2 = 0
protectedinherited

◆ b_0

template<typename T = float>
T b_0 = 0
protectedinherited

◆ b_1

template<typename T = float>
T b_1 = 0
protectedinherited

◆ b_2

template<typename T = float>
T b_2 = 0
protectedinherited

◆ w_0

template<typename T = float>
T w_0 = 0
protectedinherited

◆ w_1

template<typename T = float>
T w_1 = 0
protectedinherited

The documentation for this class was generated from the following file: