Ardour  9.0-pre0-582-g084a23a80d
ARDOUR::DSP::Biquad Class Reference

#include <dsp_filter.h>

Public Types

enum  Type {
  LowPass , HighPass , BandPassSkirt , BandPass0dB ,
  Notch , AllPass , Peaking , LowShelf ,
  HighShelf , MatchedLowPass , MatchedHighPass , MatchedBandPass0dB ,
  MatchedPeaking
}
 

Public Member Functions

 Biquad (double samplerate)
 
 Biquad (const Biquad &other)
 
void run (float *data, const uint32_t n_samples)
 
void compute (Type t, double freq, double Q, double gain)
 
void configure (double a1, double a2, double b0, double b1, double b2)
 
void configure (Biquad const &)
 
float dB_at_freq (float freq) const
 
void reset ()
 
void coefficients (double &a1, double &a2, double &b0, double &b1, double &b2) const
 

Private Member Functions

void set_vicanek_poles (const double W0, const double Q, const double A=1.0)
 
void calc_vicanek (const double W0, double &A0, double &A1, double &A2, double &phi0, double &phi1, double &phi2)
 

Private Attributes

double _rate
 
float _z1
 
float _z2
 
double _a1
 
double _a2
 
double _b0
 
double _b1
 
double _b2
 

Detailed Description

Biquad Filter

Definition at line 221 of file dsp_filter.h.

Member Enumeration Documentation

◆ Type

Enumerator
LowPass 
HighPass 
BandPassSkirt 
BandPass0dB 
Notch 
AllPass 
Peaking 
LowShelf 
HighShelf 
MatchedLowPass 
MatchedHighPass 
MatchedBandPass0dB 
MatchedPeaking 

Definition at line 223 of file dsp_filter.h.

Constructor & Destructor Documentation

◆ Biquad() [1/2]

ARDOUR::DSP::Biquad::Biquad ( double  samplerate)

Instantiate Biquad Filter

Parameters
samplerateSamplerate

◆ Biquad() [2/2]

ARDOUR::DSP::Biquad::Biquad ( const Biquad other)

Member Function Documentation

◆ calc_vicanek()

void ARDOUR::DSP::Biquad::calc_vicanek ( const double  W0,
double &  A0,
double &  A1,
double &  A2,
double &  phi0,
double &  phi1,
double &  phi2 
)
private

◆ coefficients()

void ARDOUR::DSP::Biquad::coefficients ( double &  a1,
double &  a2,
double &  b0,
double &  b1,
double &  b2 
) const

◆ compute()

void ARDOUR::DSP::Biquad::compute ( Type  t,
double  freq,
double  Q,
double  gain 
)

setup filter, compute coefficients

Parameters
tfilter type (LowPass, HighPass, etc)
freqfilter frequency
Qfilter quality
gainfilter gain

◆ configure() [1/2]

void ARDOUR::DSP::Biquad::configure ( Biquad const &  )

◆ configure() [2/2]

void ARDOUR::DSP::Biquad::configure ( double  a1,
double  a2,
double  b0,
double  b1,
double  b2 
)

setup filter, set coefficients directly

◆ dB_at_freq()

float ARDOUR::DSP::Biquad::dB_at_freq ( float  freq) const

filter transfer function (filter response for spectrum visualization)

Parameters
freqfrequency
Returns
gain at given frequency in dB (clamped to -120..+120)

◆ reset()

void ARDOUR::DSP::Biquad::reset ( )
inline

reset filter state

Definition at line 274 of file dsp_filter.h.

◆ run()

void ARDOUR::DSP::Biquad::run ( float *  data,
const uint32_t  n_samples 
)

process audio data

Parameters
datapointer to audio-data
n_samplesnumber of samples to process

◆ set_vicanek_poles()

void ARDOUR::DSP::Biquad::set_vicanek_poles ( const double  W0,
const double  Q,
const double  A = 1.0 
)
private

Member Data Documentation

◆ _a1

double ARDOUR::DSP::Biquad::_a1
private

Definition at line 283 of file dsp_filter.h.

◆ _a2

double ARDOUR::DSP::Biquad::_a2
private

Definition at line 283 of file dsp_filter.h.

◆ _b0

double ARDOUR::DSP::Biquad::_b0
private

Definition at line 284 of file dsp_filter.h.

◆ _b1

double ARDOUR::DSP::Biquad::_b1
private

Definition at line 284 of file dsp_filter.h.

◆ _b2

double ARDOUR::DSP::Biquad::_b2
private

Definition at line 284 of file dsp_filter.h.

◆ _rate

double ARDOUR::DSP::Biquad::_rate
private

Definition at line 281 of file dsp_filter.h.

◆ _z1

float ARDOUR::DSP::Biquad::_z1
private

Definition at line 282 of file dsp_filter.h.

◆ _z2

float ARDOUR::DSP::Biquad::_z2
private

Definition at line 282 of file dsp_filter.h.


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