IIRFilter Class Reference

List of all members.

Detailed Description

An IIR filter that can perform low, high, or band-pass filtering on an audio signal.

See also:
IIRFilterAudioSource


Public Member Functions

 IIRFilter () throw ()
 Creates a filter.
 IIRFilter (const IIRFilter &other) throw ()
 Creates a copy of another filter.
 ~IIRFilter () throw ()
 Destructor.
void reset () throw ()
 Resets the filter's processing pipeline, ready to start a new stream of data.
void processSamples (float *const samples, const int numSamples) throw ()
 Performs the filter operation on the given set of samples.
void makeLowPass (const double sampleRate, const double frequency) throw ()
 Sets the filter up to act as a low-pass filter.
void makeHighPass (const double sampleRate, const double frequency) throw ()
 Sets the filter up to act as a high-pass filter.
void makeLowShelf (const double sampleRate, const double cutOffFrequency, const double Q, const float gainFactor) throw ()
 Sets the filter up to act as a low-pass shelf filter with variable Q and gain.
void makeHighShelf (const double sampleRate, const double cutOffFrequency, const double Q, const float gainFactor) throw ()
 Sets the filter up to act as a high-pass shelf filter with variable Q and gain.
void makeBandPass (const double sampleRate, const double centreFrequency, const double Q, const float gainFactor) throw ()
 Sets the filter up to act as a band pass filter centred around a frequency, with a variable Q and gain.
void makeInactive () throw ()
 Clears the filter's coefficients so that it becomes inactive.
void copyCoefficientsFrom (const IIRFilter &other) throw ()
 Makes this filter duplicate the set-up of another one.

Protected Member Functions

void setCoefficients (double c1, double c2, double c3, double c4, double c5, double c6) throw ()
const IIRFilteroperator= (const IIRFilter &)

Protected Attributes

CriticalSection processLock
bool active
float coefficients [6]
float x1
float x2
float y1
float y2


Constructor & Destructor Documentation

IIRFilter::IIRFilter  )  throw ()
 

Creates a filter.

Initially the filter is inactive, so will have no effect on samples that you process with it. Use the appropriate method to turn it into the type of filter needed.

IIRFilter::IIRFilter const IIRFilter other  )  throw ()
 

Creates a copy of another filter.

IIRFilter::~IIRFilter  )  throw ()
 

Destructor.


Member Function Documentation

void IIRFilter::reset  )  throw ()
 

Resets the filter's processing pipeline, ready to start a new stream of data.

Note that this clears the processing state, but the type of filter and its coefficients aren't changed. To put a filter into an inactive state, use the makeInactive() method.

void IIRFilter::processSamples float *const   samples,
const int  numSamples
throw ()
 

Performs the filter operation on the given set of samples.

void IIRFilter::makeLowPass const double  sampleRate,
const double  frequency
throw ()
 

Sets the filter up to act as a low-pass filter.

void IIRFilter::makeHighPass const double  sampleRate,
const double  frequency
throw ()
 

Sets the filter up to act as a high-pass filter.

void IIRFilter::makeLowShelf const double  sampleRate,
const double  cutOffFrequency,
const double  Q,
const float  gainFactor
throw ()
 

Sets the filter up to act as a low-pass shelf filter with variable Q and gain.

The gain is a scale factor that the low frequencies are multiplied by, so values greater than 1.0 will boost the low frequencies, values less than 1.0 will attenuate them.

void IIRFilter::makeHighShelf const double  sampleRate,
const double  cutOffFrequency,
const double  Q,
const float  gainFactor
throw ()
 

Sets the filter up to act as a high-pass shelf filter with variable Q and gain.

The gain is a scale factor that the high frequencies are multiplied by, so values greater than 1.0 will boost the high frequencies, values less than 1.0 will attenuate them.

void IIRFilter::makeBandPass const double  sampleRate,
const double  centreFrequency,
const double  Q,
const float  gainFactor
throw ()
 

Sets the filter up to act as a band pass filter centred around a frequency, with a variable Q and gain.

The gain is a scale factor that the centre frequencies are multiplied by, so values greater than 1.0 will boost the centre frequencies, values less than 1.0 will attenuate them.

void IIRFilter::makeInactive  )  throw ()
 

Clears the filter's coefficients so that it becomes inactive.

void IIRFilter::copyCoefficientsFrom const IIRFilter other  )  throw ()
 

Makes this filter duplicate the set-up of another one.

void IIRFilter::setCoefficients double  c1,
double  c2,
double  c3,
double  c4,
double  c5,
double  c6
throw () [protected]
 

const IIRFilter& IIRFilter::operator= const IIRFilter  )  [protected]
 


Member Data Documentation

CriticalSection IIRFilter::processLock [protected]
 

bool IIRFilter::active [protected]
 

float IIRFilter::coefficients[6] [protected]
 

float IIRFilter::x1 [protected]
 

float IIRFilter::x2 [protected]
 

float IIRFilter::y1 [protected]
 

float IIRFilter::y2 [protected]
 


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