An IIR filter that can perform low, band and high-pass filtering on an audio signal, with 12 dB of attenuation / octave, using a TPT structure, designed for fast modulation (see Vadim Zavalishin's documentation about TPT structures for more information). More...
#include <juce_StateVariableFilter.h>
Public Types | |
using | NumericType = typename SampleTypeHelpers::ElementType< SampleType >::Type |
The NumericType is the underlying primitive type used by the SampleType (which could be either a primitive or vector) More... | |
using | ParametersPtr = typename Parameters< NumericType >::Ptr |
A typedef for a ref-counted pointer to the coefficients object. More... | |
Public Member Functions | |
Filter () | |
Creates a filter with default parameters. More... | |
Filter (ParametersPtr parametersToUse) | |
Filter (const Filter &)=default | |
Creates a copy of another filter. More... | |
Filter (Filter &&)=default | |
Move constructor. More... | |
void | prepare (const ProcessSpec &) noexcept |
Initialization of the filter. More... | |
template<typename ProcessContext > | |
void | process (const ProcessContext &context) noexcept |
SampleType JUCE_VECTOR_CALLTYPE | processSample (SampleType sample) noexcept |
Processes a single sample, without any locking or checking. More... | |
void | reset () noexcept |
Resets the filter's processing pipeline. More... | |
void | snapToZero () noexcept |
Ensure that the state variables are rounded to zero if the state variables are denormals. More... | |
Public Attributes | |
Parameters< NumericType >::Ptr | parameters |
The parameters of the state variable filter. More... | |
Private Member Functions | |
template<bool isBypassed, typename Parameters< NumericType >::Type type> | |
void | processBlock (const SampleType *input, SampleType *output, size_t n) noexcept |
template<bool isBypassed, typename ProcessContext > | |
void | processInternal (const ProcessContext &context) noexcept |
template<bool isBypassed, typename Parameters< NumericType >::Type type> | |
SampleType JUCE_VECTOR_CALLTYPE | processLoop (SampleType sample, Parameters< NumericType > &state) noexcept |
Private Attributes | |
SampleType | s1 |
SampleType | s2 |
std::array< SampleType, 3 > | y |
An IIR filter that can perform low, band and high-pass filtering on an audio signal, with 12 dB of attenuation / octave, using a TPT structure, designed for fast modulation (see Vadim Zavalishin's documentation about TPT structures for more information).
Its behaviour is based on the analog state variable filter circuit.
Note: The bandpass here is not the one in the RBJ CookBook, its gain can be higher than 0 dB. For the classic 0 dB bandpass, we need to multiply the result with R2
{DSP}
using juce::dsp::StateVariableFilter::Filter< SampleType >::NumericType = typename SampleTypeHelpers::ElementType<SampleType>::Type |
The NumericType is the underlying primitive type used by the SampleType (which could be either a primitive or vector)
using juce::dsp::StateVariableFilter::Filter< SampleType >::ParametersPtr = typename Parameters<NumericType>::Ptr |
A typedef for a ref-counted pointer to the coefficients object.
|
inline |
Creates a filter with default parameters.
References juce::dsp::StateVariableFilter::Filter< SampleType >::reset().
Referenced by juce::dsp::StateVariableFilter::Filter< SampleType >::Filter().
|
inline |
|
default |
Creates a copy of another filter.
|
default |
Move constructor.
|
inlinenoexcept |
Initialization of the filter.
References juce::dsp::StateVariableFilter::Filter< SampleType >::reset().
|
inlinenoexcept |
|
inlineprivatenoexcept |
|
inlineprivatenoexcept |
References jassert, and jassertfalse.
|
inlineprivatenoexcept |
|
inlinenoexcept |
Processes a single sample, without any locking or checking.
Use this if you need processing of a single value.
References jassertfalse, and juce::dsp::StateVariableFilter::Filter< SampleType >::parameters.
|
inlinenoexcept |
Resets the filter's processing pipeline.
References juce::dsp::StateVariableFilter::Filter< SampleType >::s1, and juce::dsp::StateVariableFilter::Filter< SampleType >::s2.
Referenced by juce::dsp::StateVariableFilter::Filter< SampleType >::Filter(), and juce::dsp::StateVariableFilter::Filter< SampleType >::prepare().
|
inlinenoexcept |
Ensure that the state variables are rounded to zero if the state variables are denormals.
This is only needed if you are doing sample by sample processing.
References juce::dsp::StateVariableFilter::Filter< SampleType >::s1, juce::dsp::StateVariableFilter::Filter< SampleType >::s2, and juce::dsp::util::snapToZero().
Referenced by juce::dsp::StateVariableFilter::Filter< SampleType >::processBlock().
Parameters<NumericType>::Ptr juce::dsp::StateVariableFilter::Filter< SampleType >::parameters |
The parameters of the state variable filter.
It's up to the caller to ensure that these parameters are modified in a thread-safe way.
Referenced by juce::dsp::StateVariableFilter::Filter< SampleType >::processBlock(), and juce::dsp::StateVariableFilter::Filter< SampleType >::processSample().
|
private |
|
private |
|
private |