An IIR filter that can perform low, high, or band-pass filtering on an audio signal.
More...
List of all members.
Public Member Functions |
| | IIRFilter () |
| | Creates a filter.
|
| | IIRFilter (const IIRFilter &other) |
| | Creates a copy of another filter.
|
| | ~IIRFilter () |
| | Destructor.
|
| void | reset () noexcept |
| | Resets the filter's processing pipeline, ready to start a new stream of data.
|
| void | processSamples (float *samples, int numSamples) noexcept |
| | Performs the filter operation on the given set of samples.
|
| float | processSingleSampleRaw (float sample) noexcept |
| | Processes a single sample, without any locking or checking.
|
| void | makeLowPass (double sampleRate, double frequency) noexcept |
| | Sets the filter up to act as a low-pass filter.
|
| void | makeHighPass (double sampleRate, double frequency) noexcept |
| | Sets the filter up to act as a high-pass filter.
|
| void | makeLowShelf (double sampleRate, double cutOffFrequency, double Q, float gainFactor) noexcept |
| | Sets the filter up to act as a low-pass shelf filter with variable Q and gain.
|
| void | makeHighShelf (double sampleRate, double cutOffFrequency, double Q, float gainFactor) noexcept |
| | Sets the filter up to act as a high-pass shelf filter with variable Q and gain.
|
| void | makeBandPass (double sampleRate, double centreFrequency, double Q, float gainFactor) noexcept |
| | Sets the filter up to act as a band pass filter centred around a frequency, with a variable Q and gain.
|
| void | makeInactive () noexcept |
| | Clears the filter's coefficients so that it becomes inactive.
|
| void | copyCoefficientsFrom (const IIRFilter &other) noexcept |
| | 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) noexcept |
| IIRFilter & | operator= (const IIRFilter &) |
| | JUCE_LEAK_DETECTOR (IIRFilter) |
Protected Attributes |
| CriticalSection | processLock |
| bool | active |
| float | coefficients [6] |
| float | x1 |
| float | x2 |
| float | y1 |
| float | y2 |
Detailed Description
An IIR filter that can perform low, high, or band-pass filtering on an audio signal.
- See also:
- IIRFilterAudioSource
Constructor & Destructor Documentation
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 ) |
|
Creates a copy of another filter.
| IIRFilter::~IIRFilter |
( |
) |
|
Member Function Documentation
| void IIRFilter::reset |
( |
) |
|
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 * |
samples, |
|
|
int |
numSamples |
|
) |
| |
Performs the filter operation on the given set of samples.
| float IIRFilter::processSingleSampleRaw |
( |
float |
sample ) |
|
Processes a single sample, without any locking or checking.
Use this if you need fast processing of a single value, but be aware that this isn't thread-safe in the way that processSamples() is.
| void IIRFilter::makeLowPass |
( |
double |
sampleRate, |
|
|
double |
frequency |
|
) |
| |
Sets the filter up to act as a low-pass filter.
| void IIRFilter::makeHighPass |
( |
double |
sampleRate, |
|
|
double |
frequency |
|
) |
| |
Sets the filter up to act as a high-pass filter.
| void IIRFilter::makeLowShelf |
( |
double |
sampleRate, |
|
|
double |
cutOffFrequency, |
|
|
double |
Q, |
|
|
float |
gainFactor |
|
) |
| |
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 |
( |
double |
sampleRate, |
|
|
double |
cutOffFrequency, |
|
|
double |
Q, |
|
|
float |
gainFactor |
|
) |
| |
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 |
( |
double |
sampleRate, |
|
|
double |
centreFrequency, |
|
|
double |
Q, |
|
|
float |
gainFactor |
|
) |
| |
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 |
( |
) |
|
Clears the filter's coefficients so that it becomes inactive.
| void IIRFilter::copyCoefficientsFrom |
( |
const IIRFilter & |
other ) |
|
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 |
|
) |
| [protected] |
| IIRFilter::JUCE_LEAK_DETECTOR |
( |
IIRFilter |
) |
[protected] |
Member Data Documentation
The documentation for this class was generated from the following file: