OpenWareLaboratory
BiquadFilter Class Reference
Inheritance diagram for BiquadFilter:
Collaboration diagram for BiquadFilter:

Public Member Functions

 BiquadFilter ()
 
 BiquadFilter (float sr, float *coefs, float *ste, size_t sgs)
 
void copyCoefficients (FloatArray newCoefficients)
 Copies coefficient values from an array. More...
 
void copyState (FloatArray newState)
 Copies state values from an array. More...
 
FloatArray getCoefficients ()
 
FilterStage getFilterStage (size_t stage)
 
size_t getStages ()
 
FloatArray getState ()
 
void process (float *input, float *output, size_t size)
 
void process (FloatArray in)
 
void process (FloatArray in, FloatArray out)
 
float process (float input)
 
void processBandPass (FloatArray in, FloatArray fc, float q, FloatArray out)
 
void processHighPass (FloatArray in, FloatArray fc, float q, FloatArray out)
 
void processLowPass (FloatArray in, FloatArray fc, float q, FloatArray out)
 
void setBandPass (float fc, float q)
 
void setCoefficients (FloatArray newCoefficients)
 Sets coefficients to point to a different set of values. More...
 
void setHighPass (float fc, float q)
 
void setHighShelf (float fc, float gain)
 Configure a high shelf filter with variable gain. More...
 
void setLowPass (float fc, float q)
 
void setLowShelf (float fc, float gain)
 Configure a low shelf filter with variable gain. More...
 
void setNotch (float fc, float q)
 
void setPeak (float fc, float q, float gain)
 Configure a peaking filter with resonance and variable gain. More...
 
void setSampleRate (float sr)
 
void setStages (size_t newStages)
 
void setState (FloatArray newState)
 Sets state to point to a different set of values. More...
 
virtual ~BiquadFilter ()
 

Static Public Member Functions

static BiquadFiltercreate (float sr, size_t stages=1)
 
static void destroy (BiquadFilter *filter)
 
static size_t getCoefficientsPerStage ()
 

Protected Member Functions

void copyCoefficients ()
 
void init ()
 

Protected Attributes

float * coefficients
 
size_t stages
 
float * state
 

Detailed Description

Definition at line 167 of file BiquadFilter.h.

Constructor & Destructor Documentation

BiquadFilter::BiquadFilter ( )
inline

Definition at line 201 of file BiquadFilter.h.

Referenced by create().

BiquadFilter::BiquadFilter ( float  sr,
float *  coefs,
float *  ste,
size_t  sgs 
)
inline

Definition at line 204 of file BiquadFilter.h.

References init().

virtual BiquadFilter::~BiquadFilter ( )
inlinevirtual

Definition at line 208 of file BiquadFilter.h.

Member Function Documentation

void BiquadFilter::copyCoefficients ( )
inlineprotected
void BiquadFilter::copyCoefficients ( FloatArray  newCoefficients)
inline

Copies coefficient values from an array.

Definition at line 379 of file BiquadFilter.h.

References ASSERT, BIQUAD_COEFFICIENTS_PER_STAGE, FilterStage::copyCoefficients(), copyCoefficients(), getFilterStage(), and SimpleArray< T >::getSize().

void BiquadFilter::copyState ( FloatArray  newState)
inline

Copies state values from an array.

Definition at line 244 of file BiquadFilter.h.

References ASSERT, BIQUAD_STATE_VARIABLES_PER_STAGE, SimpleArray< T >::copyFrom(), SimpleArray< T >::getSize(), getState(), and stages.

static BiquadFilter* BiquadFilter::create ( float  sr,
size_t  stages = 1 
)
inlinestatic
static void BiquadFilter::destroy ( BiquadFilter filter)
inlinestatic
FloatArray BiquadFilter::getCoefficients ( )
inline

Definition at line 225 of file BiquadFilter.h.

References BIQUAD_COEFFICIENTS_PER_STAGE, coefficients, and stages.

static size_t BiquadFilter::getCoefficientsPerStage ( )
inlinestatic

Definition at line 221 of file BiquadFilter.h.

References BIQUAD_COEFFICIENTS_PER_STAGE.

FilterStage BiquadFilter::getFilterStage ( size_t  stage)
inline
size_t BiquadFilter::getStages ( )
inline

Definition at line 213 of file BiquadFilter.h.

References stages.

FloatArray BiquadFilter::getState ( )
inline

Definition at line 229 of file BiquadFilter.h.

References BIQUAD_STATE_VARIABLES_PER_STAGE, stages, and state.

Referenced by copyState().

void BiquadFilter::init ( )
inlineprotected

Definition at line 191 of file BiquadFilter.h.

References BIQUAD_STATE_VARIABLES_PER_STAGE, coefficients, stages, and state.

Referenced by BiquadFilter(), and setCoefficients().

void BiquadFilter::process ( FloatArray  in)
inline

Definition at line 283 of file BiquadFilter.h.

References SimpleArray< T >::getSize(), and process().

void BiquadFilter::process ( FloatArray  in,
FloatArray  out 
)
inlinevirtual

Reimplemented from SignalProcessor.

Definition at line 287 of file BiquadFilter.h.

References ASSERT, SimpleArray< T >::getSize(), and process().

float BiquadFilter::process ( float  input)
inlinevirtual

Implements SignalProcessor.

Definition at line 314 of file BiquadFilter.h.

References process().

void BiquadFilter::processBandPass ( FloatArray  in,
FloatArray  fc,
float  q,
FloatArray  out 
)
inline

Definition at line 306 of file BiquadFilter.h.

References SimpleArray< T >::getSize(), process(), and setBandPass().

void BiquadFilter::processHighPass ( FloatArray  in,
FloatArray  fc,
float  q,
FloatArray  out 
)
inline

Definition at line 299 of file BiquadFilter.h.

References SimpleArray< T >::getSize(), process(), and setHighPass().

void BiquadFilter::processLowPass ( FloatArray  in,
FloatArray  fc,
float  q,
FloatArray  out 
)
inline

Definition at line 292 of file BiquadFilter.h.

References SimpleArray< T >::getSize(), process(), and setLowPass().

void BiquadFilter::setBandPass ( float  fc,
float  q 
)
inline

Definition at line 330 of file BiquadFilter.h.

References coefficients, copyCoefficients(), and FilterStage::setBandPass().

Referenced by processBandPass().

void BiquadFilter::setCoefficients ( FloatArray  newCoefficients)
inline

Sets coefficients to point to a different set of values.

Definition at line 370 of file BiquadFilter.h.

References ASSERT, BIQUAD_COEFFICIENTS_PER_STAGE, coefficients, SimpleArray< T >::getData(), SimpleArray< T >::getSize(), init(), and stages.

Referenced by MultiBiquadFilter::create(), and StereoBiquadFilter::create().

void BiquadFilter::setHighPass ( float  fc,
float  q 
)
inline
void BiquadFilter::setHighShelf ( float  fc,
float  gain 
)
inline

Configure a high shelf filter with variable gain.

Parameters
gainin dB

Definition at line 362 of file BiquadFilter.h.

References coefficients, copyCoefficients(), and FilterStage::setHighShelf().

void BiquadFilter::setLowPass ( float  fc,
float  q 
)
inline
void BiquadFilter::setLowShelf ( float  fc,
float  gain 
)
inline

Configure a low shelf filter with variable gain.

Parameters
gainin dB

Definition at line 353 of file BiquadFilter.h.

References coefficients, copyCoefficients(), and FilterStage::setLowShelf().

void BiquadFilter::setNotch ( float  fc,
float  q 
)
inline

Definition at line 335 of file BiquadFilter.h.

References coefficients, copyCoefficients(), and FilterStage::setNotch().

void BiquadFilter::setPeak ( float  fc,
float  q,
float  gain 
)
inline

Configure a peaking filter with resonance and variable gain.

Parameters
gainin dB

Definition at line 344 of file BiquadFilter.h.

References coefficients, copyCoefficients(), and FilterStage::setPeak().

void BiquadFilter::setSampleRate ( float  sr)
inline

Definition at line 209 of file BiquadFilter.h.

References M_PI.

Referenced by MultiBiquadFilter::create(), and StereoBiquadFilter::create().

void BiquadFilter::setStages ( size_t  newStages)
inline

Definition at line 217 of file BiquadFilter.h.

References stages.

Referenced by MultiBiquadFilter::create(), and StereoBiquadFilter::create().

void BiquadFilter::setState ( FloatArray  newState)
inline

Sets state to point to a different set of values.

Definition at line 236 of file BiquadFilter.h.

References ASSERT, BIQUAD_STATE_VARIABLES_PER_STAGE, SimpleArray< T >::getData(), SimpleArray< T >::getSize(), stages, and state.

Referenced by MultiBiquadFilter::create(), and StereoBiquadFilter::create().

Field Documentation

float* BiquadFilter::state
protected

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