#include <Filters.h>

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 | |
| Buffer * | mPrevInputs |
| arrays of past input and output samples | |
| Buffer * | mPrevOutputs |
| float | mFrame |
| to keep hold of sample rate for calculating coeffs | |
| 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 | ) |
| void Filter::clear | ( | void | ) |
clears the input/output buffers
References mPrevInputs, mPrevOutputs, and csl::Buffer::zeroBuffers().
Referenced by csl::Allpass::Allpass(), csl::Butter::Butter(), csl::Formant::Formant(), and csl::Notch::Notch().
| 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 | |||
| ) |
| 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] |
shared initialization function
References csl::Buffer::allocateBuffers(), csl::UnitGenerator::frameRate(), mACoeff, mANum, mBCoeff, mBNum, csl::UnitGenerator::mFrameRate, mPrevInputs, and mPrevOutputs.
Referenced by Filter().
float csl::Filter::mBCoeff[FILTER_MAX_COEFFICIENTS] [protected] |
array of numerator coeffs
Referenced by dump(), init(), csl::Allpass::setupCoeffs(), csl::Notch::setupCoeffs(), csl::Formant::setupCoeffs(), csl::Butter::setupCoeffs(), and setupCoeffs().
float csl::Filter::mACoeff[FILTER_MAX_COEFFICIENTS] [protected] |
array of denominator coeffs
Referenced by dump(), init(), csl::Allpass::setupCoeffs(), csl::Notch::setupCoeffs(), csl::Formant::setupCoeffs(), csl::Butter::setupCoeffs(), and setupCoeffs().
unsigned csl::Filter::mBNum [protected] |
unsigned csl::Filter::mANum [protected] |
Buffer* csl::Filter::mPrevInputs [protected] |
Buffer* csl::Filter::mPrevOutputs [protected] |
float csl::Filter::mFrame [protected] |
to keep hold of sample rate for calculating coeffs
1.5.8