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)
 
float getSampleRate ()
 
size_t getStages ()
 
FloatArray getState ()
 
void process (float *input, float *output, size_t size)
 
float process (float input)
 
void process (FloatArray in)
 
void process (FloatArray in, FloatArray out)
 
void processAllPass (FloatArray in, FloatArray fc, float q, FloatArray out)
 
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 setAllPass (float fc, float q)
 
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 181 of file BiquadFilter.h.

Constructor & Destructor Documentation

◆ BiquadFilter() [1/2]

BiquadFilter::BiquadFilter ( )
inline

Definition at line 215 of file BiquadFilter.h.

Referenced by create().

◆ BiquadFilter() [2/2]

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

Definition at line 218 of file BiquadFilter.h.

References init().

◆ ~BiquadFilter()

virtual BiquadFilter::~BiquadFilter ( )
inlinevirtual

Definition at line 222 of file BiquadFilter.h.

Member Function Documentation

◆ copyCoefficients() [1/2]

◆ copyCoefficients() [2/2]

void BiquadFilter::copyCoefficients ( FloatArray  newCoefficients)
inline

Copies coefficient values from an array.

Definition at line 411 of file BiquadFilter.h.

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

◆ copyState()

void BiquadFilter::copyState ( FloatArray  newState)
inline

Copies state values from an array.

Definition at line 263 of file BiquadFilter.h.

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

◆ create()

static BiquadFilter* BiquadFilter::create ( float  sr,
size_t  stages = 1 
)
inlinestatic

◆ destroy()

static void BiquadFilter::destroy ( BiquadFilter filter)
inlinestatic

◆ getCoefficients()

FloatArray BiquadFilter::getCoefficients ( )
inline

Definition at line 244 of file BiquadFilter.h.

References BIQUAD_COEFFICIENTS_PER_STAGE, coefficients, and stages.

◆ getCoefficientsPerStage()

static size_t BiquadFilter::getCoefficientsPerStage ( )
inlinestatic

Definition at line 240 of file BiquadFilter.h.

References BIQUAD_COEFFICIENTS_PER_STAGE.

◆ getFilterStage()

FilterStage BiquadFilter::getFilterStage ( size_t  stage)
inline

◆ getSampleRate()

float BiquadFilter::getSampleRate ( )
inline

Definition at line 228 of file BiquadFilter.h.

References M_PI.

◆ getStages()

size_t BiquadFilter::getStages ( )
inline

Definition at line 232 of file BiquadFilter.h.

References stages.

◆ getState()

FloatArray BiquadFilter::getState ( )
inline

Definition at line 248 of file BiquadFilter.h.

References BIQUAD_STATE_VARIABLES_PER_STAGE, stages, and state.

Referenced by copyState().

◆ init()

void BiquadFilter::init ( )
inlineprotected

Definition at line 205 of file BiquadFilter.h.

References BIQUAD_STATE_VARIABLES_PER_STAGE, coefficients, stages, and state.

Referenced by BiquadFilter(), and setCoefficients().

◆ process() [1/4]

◆ process() [2/4]

float BiquadFilter::process ( float  input)
inlinevirtual

Reimplemented from SignalProcessor.

Definition at line 341 of file BiquadFilter.h.

References process().

◆ process() [3/4]

void BiquadFilter::process ( FloatArray  in)
inline

Definition at line 303 of file BiquadFilter.h.

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

◆ process() [4/4]

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

Reimplemented from SignalProcessor.

Definition at line 307 of file BiquadFilter.h.

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

◆ processAllPass()

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

Definition at line 333 of file BiquadFilter.h.

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

◆ processBandPass()

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

Definition at line 326 of file BiquadFilter.h.

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

◆ processHighPass()

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

Definition at line 319 of file BiquadFilter.h.

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

◆ processLowPass()

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

Definition at line 312 of file BiquadFilter.h.

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

◆ setAllPass()

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

Definition at line 362 of file BiquadFilter.h.

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

Referenced by processAllPass().

◆ setBandPass()

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

Definition at line 357 of file BiquadFilter.h.

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

Referenced by processBandPass().

◆ setCoefficients()

void BiquadFilter::setCoefficients ( FloatArray  newCoefficients)
inline

Sets coefficients to point to a different set of values.

Definition at line 402 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().

◆ setHighPass()

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

◆ setHighShelf()

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

Configure a high shelf filter with variable gain.

Parameters
gainin dB

Definition at line 394 of file BiquadFilter.h.

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

◆ setLowPass()

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

◆ setLowShelf()

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

Configure a low shelf filter with variable gain.

Parameters
gainin dB

Definition at line 385 of file BiquadFilter.h.

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

◆ setNotch()

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

Definition at line 367 of file BiquadFilter.h.

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

◆ setPeak()

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 376 of file BiquadFilter.h.

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

◆ setSampleRate()

void BiquadFilter::setSampleRate ( float  sr)
inline

Definition at line 224 of file BiquadFilter.h.

References M_PI.

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

◆ setStages()

void BiquadFilter::setStages ( size_t  newStages)
inline

Definition at line 236 of file BiquadFilter.h.

References stages.

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

◆ setState()

void BiquadFilter::setState ( FloatArray  newState)
inline

Sets state to point to a different set of values.

Definition at line 255 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

◆ coefficients

◆ stages

◆ state

float* BiquadFilter::state
protected

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