csl::Filter Class Reference

Filter: the canonical-form n-pole/m-zero filter class. More...

#include <Filters.h>

Inheritance diagram for csl::Filter:

csl::Effect csl::Scalable csl::FrequencyAmount csl::UnitGenerator csl::Controllable csl::Controllable csl::Controllable csl::Model csl::Allpass csl::Butter csl::Formant csl::Moog csl::Notch

List of all members.

Public Member Functions

 Filter ()
 Default constructor generates a zeroth order "do-nothing" filter.
 Filter (unsigned num_b, unsigned num_a=1)
 Filter (UnitGenerator &in, unsigned num_b=1, unsigned num_a=1)
 Filter (UnitGenerator &in, SampleBuffer bCoeffs, SampleBuffer aCoeffs, unsigned num_b, unsigned num_a)
 This constructor takes arrays of coefficients and constructs the filter accordingly.
 ~Filter ()
 Filter destructor frees temp memory.
void clear (void)
 clears the input/output buffers
virtual void setupCoeffs ()
void setupCoeffs (SampleBuffer bCoeffs, SampleBuffer aCoeffs, unsigned num_b, unsigned num_a)
 this version is to be inherited by the subclasses. provides a way to directly supply the filter info
virtual void nextBuffer (Buffer &outputBuffer, unsigned outBufNum) throw (CException)
void dump ()
 log information about myself

Protected Member Functions

void init (unsigned a, unsigned b)
 shared initialization function

Protected Attributes

float mBCoeff [FILTER_MAX_COEFFICIENTS]
 array of numerator coeffs
float mACoeff [FILTER_MAX_COEFFICIENTS]
 array of denominator coeffs
unsigned mBNum
 number of coeffs in b
unsigned mANum
 number of coeffs in a
BuffermPrevInputs
 arrays of past input and output samples
BuffermPrevOutputs
float mFrame
 to keep hold of sample rate for calculating coeffs


Detailed Description

Filter: the canonical-form n-pole/m-zero filter class.

Constructor & Destructor Documentation

Filter::Filter (  ) 

Default constructor generates a zeroth order "do-nothing" filter.

Generic Filter class with scalable order and generic next_buffer method that implememnts the canonical filter diference equation. Subclasses must supply filter order and override the setupCoeffs() method.

References init().

Filter::Filter ( unsigned  num_b,
unsigned  num_a = 1 
)

References init().

Filter::Filter ( UnitGenerator in,
unsigned  num_b = 1,
unsigned  num_a = 1 
)

References init().

Filter::Filter ( UnitGenerator in,
SampleBuffer  bCoeffs,
SampleBuffer  aCoeffs,
unsigned  num_b,
unsigned  num_a 
)

This constructor takes arrays of coefficients and constructs the filter accordingly.

References init(), and setupCoeffs().

Filter::~Filter ( void   ) 

Filter destructor frees temp memory.

References mPrevInputs, and mPrevOutputs.


Member Function Documentation

void Filter::clear ( void   ) 

virtual void csl::Filter::setupCoeffs (  )  [inline, virtual]

Reimplemented in csl::Butter, csl::Formant, csl::Notch, csl::Allpass, and csl::Moog.

Referenced by Filter().

void Filter::setupCoeffs ( SampleBuffer  bCoeffs,
SampleBuffer  aCoeffs,
unsigned  num_b,
unsigned  num_a 
)

this version is to be inherited by the subclasses. provides a way to directly supply the filter info

to be overloaded by subclasses supply the coefficients directly

References mACoeff, and mBCoeff.

void Filter::nextBuffer ( Buffer outputBuffer,
unsigned  outBufNum 
) throw (CException) [virtual]

really compute the next buffer given an offset base channel; this is called by nextBuffer, possibly multiple times

Reimplemented from csl::UnitGenerator.

Reimplemented in csl::Moog.

References DECLARE_FILTER_CONTROLS, DECLARE_SCALABLE_CONTROLS, testkiss::j, LOAD_FILTER_CONTROLS, LOAD_SCALABLE_CONTROLS, csl::logMsg(), csl::Effect::pullInput(), and UPDATE_SCALABLE_CONTROLS.

void Filter::dump ( void   )  [virtual]

log information about myself

Reimplemented from csl::UnitGenerator.

References csl::logMsg(), mACoeff, mANum, mBCoeff, and mBNum.

Referenced by testFilters().

void Filter::init ( unsigned  a,
unsigned  b 
) [protected]


Member Data Documentation

float csl::Filter::mBCoeff[FILTER_MAX_COEFFICIENTS] [protected]

float csl::Filter::mACoeff[FILTER_MAX_COEFFICIENTS] [protected]

unsigned csl::Filter::mBNum [protected]

number of coeffs in b

Referenced by dump(), and init().

unsigned csl::Filter::mANum [protected]

number of coeffs in a

Referenced by dump(), and init().

arrays of past input and output samples

Referenced by clear(), init(), and ~Filter().

Referenced by clear(), init(), and ~Filter().

float csl::Filter::mFrame [protected]

to keep hold of sample rate for calculating coeffs


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

Generated on Thu Sep 17 23:14:17 2009 for CSL by  doxygen 1.5.8