LMMS
Loading...
Searching...
No Matches
dsp::biquad_d2 Struct Reference

#include <biquad.h>

Inheritance diagram for dsp::biquad_d2:
dsp::biquad_coeffs

Public Member Functions

 biquad_d2 ()
 Constructor (initializes state to all zeros).
double process (double in)
 direct II form with two state variables
double process_lp (double in)
bool empty () const
 Is the filter state completely silent? (i.e. set to 0 by sanitize function).
void sanitize ()
 Sanitize (set to 0 if potentially denormal) filter state.
void reset ()
 Reset state variables.
Public Member Functions inherited from dsp::biquad_coeffs
 biquad_coeffs ()
void set_null ()
void set_lp_rbj (float fc, float q, float sr, float gain=1.0)
void set_lp_zoelzer (float fc, float q, float odsr, float gain=1.0)
void set_hp_rbj (float fc, float q, float esr, float gain=1.0)
void set_hp_rbj_optimized (float fc, float q, float esr, float gain=1.0)
void set_bp_rbj (double fc, double q, double esr, double gain=1.0)
void set_br_rbj (double fc, double q, double esr, double gain=1.0)
void set_allpass (float freq, float pole_r, float sr)
void set_bilinear (double aa0, double aa1, double aa2, double ab0, double ab1, double ab2)
 set digital filter parameters based on given analog filter parameters
void set_bilinear_direct (double aa0, double aa1, double aa2, double ab1, double ab2)
 set digital filter parameters directly
void set_peakeq_rbj (double freq, double q, double peak, double sr)
void set_lowshelf_rbj (float freq, float q, float peak, float sr)
void set_highshelf_rbj (float freq, float q, float peak, float sr)
void copy_coeffs (const biquad_coeffs &src)
 copy coefficients from another biquad
float freq_gain (float freq, float sr) const
cfloat h_z (const cfloat &z) const

Public Attributes

double w1
 state[n-1]
double w2
 state[n-2]
Public Attributes inherited from dsp::biquad_coeffs
double a0
double a1
double a2
double b1
double b2

Additional Inherited Members

Public Types inherited from dsp::biquad_coeffs
typedef std::complex< double > cfloat
Static Public Member Functions inherited from dsp::biquad_coeffs
static double prewarp (float freq, float sr)
 prewarping for bilinear transform, maps given digital frequency to analog counterpart for analog filter design
static double unwarp (float omega, float sr)
 convert analog angular frequency value to digital
static double unwarpf (float t, float sr)
 convert analog filter time constant to digital counterpart

Detailed Description

Two-pole two-zero filter, for floating point values. Uses slightly faster Direct II form (combined FIR and IIR halves). However, when used with wildly varying coefficients, it may make more zipper noise than Direct I form, so it's better to use it when filter coefficients are not changed mid-stream.

Constructor & Destructor Documentation

◆ biquad_d2()

dsp::biquad_d2::biquad_d2 ( )
inline

Constructor (initializes state to all zeros).

Member Function Documentation

◆ empty()

bool dsp::biquad_d2::empty ( ) const
inline

Is the filter state completely silent? (i.e. set to 0 by sanitize function).

◆ process()

double dsp::biquad_d2::process ( double in)
inline

direct II form with two state variables

◆ process_lp()

double dsp::biquad_d2::process_lp ( double in)
inline

◆ reset()

void dsp::biquad_d2::reset ( )
inline

Reset state variables.

◆ sanitize()

void dsp::biquad_d2::sanitize ( )
inline

Sanitize (set to 0 if potentially denormal) filter state.

Member Data Documentation

◆ w1

double dsp::biquad_d2::w1

state[n-1]

◆ w2

double dsp::biquad_d2::w2

state[n-2]


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