Logo Search packages:      
Sourcecode: calf version File versions  Download package

dsp::biquad_d2< Coeff, T > Struct Template Reference

#include <biquad.h>

Inheritance diagram for dsp::biquad_d2< Coeff, T >:

dsp::biquad_coeffs< Coeff >

List of all members.


Detailed Description

template<class Coeff = float, class T = float>
struct dsp::biquad_d2< Coeff, T >

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.

Definition at line 413 of file biquad.h.


Public Types

typedef std::complex< double > cfloat

Public Member Functions

 biquad_d2 ()
 Constructor (initializes state to all zeros).
template<class U>
void copy_coeffs (const biquad_coeffs< U > &src)
 copy coefficients from another biquad
bool empty ()
 Is the filter state completely silent? (i.e. set to 0 by sanitize function).
float freq_gain (float freq, float sr)
cfloat h_z (const cfloat &z)
process (T in)
 direct II form with two state variables
process_lp (T in)
void reset ()
 Reset state variables.
void sanitize ()
 Sanitize (set to 0 if potentially denormal) filter state.
void set_allpass (float freq, float pole_r, float sr)
void set_bilinear (float aa0, float aa1, float aa2, float ab0, float ab1, float ab2)
 set digital filter parameters based on given analog filter parameters
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_highshelf_rbj (float freq, float q, float peak, float sr)
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_lowshelf_rbj (float freq, float q, float peak, float sr)
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_null ()
void set_peakeq_rbj (float freq, float q, float peak, float sr)

Static Public Member Functions

static float prewarp (float freq, float sr)
 prewarping for bilinear transform, maps given digital frequency to analog counterpart for analog filter design
static float unwarp (float omega, float sr)
 convert analog angular frequency value to digital
static float unwarpf (float t, float sr)
 convert analog filter time constant to digital counterpart

Public Attributes

Coeff a0
Coeff a1
Coeff a2
Coeff b1
Coeff b2
float w1
 state[n-1]
float w2
 state[n-2]

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

Generated by  Doxygen 1.6.0   Back to index