A first order filter class using the TPT (Topology-Preserving Transform) structure. More...
#include <juce_FirstOrderTPTFilter.h>
Public Types | |
using | Type = FirstOrderTPTFilterType |
Public Member Functions | |
FirstOrderTPTFilter () | |
Constructor. | |
void | setType (Type newType) |
Sets the filter type. | |
void | setCutoffFrequency (SampleType newFrequencyHz) |
Sets the cutoff frequency of the filter. | |
Type | getType () const noexcept |
Returns the type of the filter. | |
SampleType | getCutoffFrequency () const noexcept |
Returns the cutoff frequency of the filter. | |
void | prepare (const ProcessSpec &spec) |
Initialises the filter. | |
void | reset () |
Resets the internal state variables of the filter. | |
void | reset (SampleType newValue) |
Resets the internal state variables of the filter to a given value. | |
template<typename ProcessContext > | |
void | process (const ProcessContext &context) noexcept |
Processes the input and output samples supplied in the processing context. | |
SampleType | processSample (int channel, SampleType inputValue) |
Processes one sample at a time on a given channel. | |
void | snapToZero () noexcept |
Ensure that the state variables are rounded to zero if the state variables are denormals. | |
A first order filter class using the TPT (Topology-Preserving Transform) structure.
This filter can be modulated at high rates without producing audio artefacts. See Vadim Zavalishin's documentation about TPT structures for more information.
Note: Using this class prevents some loud audio artefacts commonly encountered when changing the cutoff frequency using of other filter simulation structures and IIR filter classes. However, this class may still require additional smoothing for cutoff frequency changes.
using dsp::FirstOrderTPTFilter< SampleType >::Type = FirstOrderTPTFilterType |
dsp::FirstOrderTPTFilter< SampleType >::FirstOrderTPTFilter | ( | ) |
Constructor.
void dsp::FirstOrderTPTFilter< SampleType >::setType | ( | Type | newType | ) |
Sets the filter type.
void dsp::FirstOrderTPTFilter< SampleType >::setCutoffFrequency | ( | SampleType | newFrequencyHz | ) |
Sets the cutoff frequency of the filter.
newFrequencyHz | cutoff frequency in Hz. |
|
noexcept |
Returns the type of the filter.
|
noexcept |
Returns the cutoff frequency of the filter.
void dsp::FirstOrderTPTFilter< SampleType >::prepare | ( | const ProcessSpec & | spec | ) |
Initialises the filter.
void dsp::FirstOrderTPTFilter< SampleType >::reset | ( | ) |
Resets the internal state variables of the filter.
void dsp::FirstOrderTPTFilter< SampleType >::reset | ( | SampleType | newValue | ) |
Resets the internal state variables of the filter to a given value.
|
noexcept |
Processes the input and output samples supplied in the processing context.
References jassert, dsp::FirstOrderTPTFilter< SampleType >::processSample(), and dsp::FirstOrderTPTFilter< SampleType >::snapToZero().
SampleType dsp::FirstOrderTPTFilter< SampleType >::processSample | ( | int | channel, |
SampleType | inputValue ) |
Processes one sample at a time on a given channel.
Referenced by dsp::FirstOrderTPTFilter< SampleType >::process().
|
noexcept |
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.
Referenced by dsp::FirstOrderTPTFilter< SampleType >::process().