41 template <
typename NumericType>
57 template <
typename SampleType>
64 using NumericType =
typename SampleTypeHelpers::ElementType<SampleType>::Type;
106 void reset (SampleType resetToValue);
113 template <
typename ProcessContext>
114 void process (
const ProcessContext& context) noexcept
116 if (context.isBypassed)
117 processInternal<ProcessContext, true> (context);
119 processInternal<ProcessContext, false> (context);
129 SampleType JUCE_VECTOR_CALLTYPE
processSample (SampleType sample) noexcept;
142 template <
typename ProcessContext,
bool isBypassed>
143 void processInternal (
const ProcessContext& context) noexcept;
147 SampleType* state =
nullptr;
150 JUCE_LEAK_DETECTOR (
Filter)
160 template <
typename NumericType>
191 static Ptr makeFirstOrderLowPass (
double sampleRate,
NumericType frequency);
194 static Ptr makeFirstOrderHighPass (
double sampleRate,
NumericType frequency);
197 static Ptr makeFirstOrderAllPass (
double sampleRate,
NumericType frequency);
201 static Ptr makeLowPass (
double sampleRate,
NumericType frequency);
208 static Ptr makeHighPass (
double sampleRate,
NumericType frequency);
215 static Ptr makeBandPass (
double sampleRate,
NumericType frequency);
229 static Ptr makeAllPass (
double sampleRate,
NumericType frequency);
241 static Ptr makeLowShelf (
double sampleRate,
NumericType cutOffFrequency,
250 static Ptr makeHighShelf (
double sampleRate,
NumericType cutOffFrequency,
260 static Ptr makePeakFilter (
double sampleRate,
NumericType centreFrequency,
265 size_t getFilterOrder() const noexcept;
270 double getMagnitudeForFrequency (
double frequency,
double sampleRate) const noexcept;
275 void getMagnitudeForFrequencyArray (const
double* frequencies,
double* magnitudes,
276 size_t numSamples,
double sampleRate) const noexcept;
281 double getPhaseForFrequency (
double frequency,
double sampleRate) const noexcept;
286 void getPhaseForFrequencyArray (
double* frequencies,
double* phases,
287 size_t numSamples,
double sampleRate) const noexcept;
310 #include "juce_IIRFilter_Impl.h"
Array< NumericType > coefficients
The raw coefficients.
A processing class that can perform IIR filtering on an audio signal, using the Transposed Direct For...
void reset()
Resets the filter's processing pipeline, ready to start a new stream of data.
CoefficientsPtr coefficients
The coefficients of the IIR filter.
void process(const ProcessContext &context) noexcept
Processes a block of samples.
typename Coefficients< NumericType >::Ptr CoefficientsPtr
A typedef for a ref-counted pointer to the coefficients object.
A set of coefficients for use in an Filter object.
const NumericType * getRawCoefficients() const noexcept
Returns a raw data pointer to the coefficients.
This is a handy base class for the state of a processor (such as parameter values) which is typically...
This structure is passed into a DSP algorithm's prepare() method, and contains information about vari...
A smart-pointer class which points to a reference-counted object.
typename SampleTypeHelpers::ElementType< SampleType >::Type NumericType
The NumericType is the underlying primitive type used by the SampleType (which could be either a prim...
void prepare(const ProcessSpec &) noexcept
Called before processing starts.
void snapToZero() noexcept
Ensure that the state variables are rounded to zero if the state variables are denormals.
SampleType JUCE_VECTOR_CALLTYPE processSample(SampleType sample) noexcept
Processes a single sample, without any locking.
Filter()
Creates a filter.