JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::IIRFilter Class Reference

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

#include <juce_IIRFilter.h>

Collaboration diagram for juce::IIRFilter:

Public Member Functions

 IIRFilter () noexcept
 Creates a filter. More...
 
 IIRFilter (const IIRFilter &) noexcept
 Creates a copy of another filter. More...
 
 ~IIRFilter () noexcept
 Destructor. More...
 
IIRCoefficients getCoefficients () const noexcept
 Returns the coefficients that this filter is using. More...
 
void makeInactive () noexcept
 Clears the filter so that any incoming data passes through unchanged. More...
 
void processSamples (float *samples, int numSamples) noexcept
 Performs the filter operation on the given set of samples. More...
 
float processSingleSampleRaw (float sample) noexcept
 Processes a single sample, without any locking or checking. More...
 
void reset () noexcept
 Resets the filter's processing pipeline, ready to start a new stream of data. More...
 
void setCoefficients (const IIRCoefficients &newCoefficients) noexcept
 Applies a set of coefficients to this filter. More...
 

Protected Member Functions

IIRFilteroperator= (const IIRFilter &)=delete
 

Protected Attributes

bool active = false
 
IIRCoefficients coefficients
 
SpinLock processLock
 
float v1 = 0
 
float v2 = 0
 

Detailed Description

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

See also
IIRCoefficient, IIRFilterAudioSource

{Audio}

Constructor & Destructor Documentation

◆ IIRFilter() [1/2]

juce::IIRFilter::IIRFilter ( )
noexcept

Creates a filter.

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

◆ IIRFilter() [2/2]

juce::IIRFilter::IIRFilter ( const IIRFilter )
noexcept

Creates a copy of another filter.

◆ ~IIRFilter()

juce::IIRFilter::~IIRFilter ( )
noexcept

Destructor.

Member Function Documentation

◆ getCoefficients()

IIRCoefficients juce::IIRFilter::getCoefficients ( ) const
inlinenoexcept

Returns the coefficients that this filter is using.

◆ makeInactive()

void juce::IIRFilter::makeInactive ( )
noexcept

Clears the filter so that any incoming data passes through unchanged.

◆ operator=()

IIRFilter& juce::IIRFilter::operator= ( const IIRFilter )
protecteddelete

◆ processSamples()

void juce::IIRFilter::processSamples ( float samples,
int  numSamples 
)
noexcept

Performs the filter operation on the given set of samples.

◆ processSingleSampleRaw()

float juce::IIRFilter::processSingleSampleRaw ( float  sample)
noexcept

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.

◆ reset()

void juce::IIRFilter::reset ( )
noexcept

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.

◆ setCoefficients()

void juce::IIRFilter::setCoefficients ( const IIRCoefficients newCoefficients)
noexcept

Applies a set of coefficients to this filter.

Member Data Documentation

◆ active

bool juce::IIRFilter::active = false
protected

◆ coefficients

IIRCoefficients juce::IIRFilter::coefficients
protected

◆ processLock

SpinLock juce::IIRFilter::processLock
protected

◆ v1

float juce::IIRFilter::v1 = 0
protected

◆ v2

float juce::IIRFilter::v2 = 0
protected

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