OpenShot Audio Library | OpenShotAudio 0.4.0
 
Loading...
Searching...
No Matches
juce::dsp::StateVariableTPTFilter< SampleType > Class Template Reference

#include <juce_StateVariableTPTFilter.h>

Public Types

using Type = StateVariableTPTFilterType
 

Public Member Functions

 StateVariableTPTFilter ()
 
void setType (Type newType)
 
void setCutoffFrequency (SampleType newFrequencyHz)
 
void setResonance (SampleType newResonance)
 
Type getType () const noexcept
 
SampleType getCutoffFrequency () const noexcept
 
SampleType getResonance () const noexcept
 
void prepare (const ProcessSpec &spec)
 
void reset ()
 
void reset (SampleType newValue)
 
void snapToZero () noexcept
 
template<typename ProcessContext>
void process (const ProcessContext &context) noexcept
 
SampleType processSample (int channel, SampleType inputValue)
 

Detailed Description

template<typename SampleType>
class juce::dsp::StateVariableTPTFilter< SampleType >

An IIR filter that can perform low, band and high-pass filtering on an audio signal, with 12 dB of attenuation per 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 as its gain can be higher than 0 dB. For the classic 0 dB bandpass, we need to multiply the result by R2.

Note 2: Using this class prevents some loud audio artefacts commonly encountered when changing the cutoff frequency using other filter simulation structures and IIR filter classes. However, this class may still require additional smoothing for cutoff frequency changes.

see IIRFilter, SmoothedValue

Definition at line 57 of file juce_StateVariableTPTFilter.h.

Member Typedef Documentation

◆ Type

template<typename SampleType>
using juce::dsp::StateVariableTPTFilter< SampleType >::Type = StateVariableTPTFilterType

Definition at line 61 of file juce_StateVariableTPTFilter.h.

Constructor & Destructor Documentation

◆ StateVariableTPTFilter()

template<typename SampleType>
juce::dsp::StateVariableTPTFilter< SampleType >::StateVariableTPTFilter ( )

Constructor.

Definition at line 31 of file juce_StateVariableTPTFilter.cpp.

Member Function Documentation

◆ getCutoffFrequency()

template<typename SampleType>
SampleType juce::dsp::StateVariableTPTFilter< SampleType >::getCutoffFrequency ( ) const
inlinenoexcept

Returns the cutoff frequency of the filter.

Definition at line 90 of file juce_StateVariableTPTFilter.h.

◆ getResonance()

template<typename SampleType>
SampleType juce::dsp::StateVariableTPTFilter< SampleType >::getResonance ( ) const
inlinenoexcept

Returns the resonance of the filter.

Definition at line 93 of file juce_StateVariableTPTFilter.h.

◆ getType()

template<typename SampleType>
Type juce::dsp::StateVariableTPTFilter< SampleType >::getType ( ) const
inlinenoexcept

Returns the type of the filter.

Definition at line 87 of file juce_StateVariableTPTFilter.h.

◆ prepare()

template<typename SampleType>
void juce::dsp::StateVariableTPTFilter< SampleType >::prepare ( const ProcessSpec & spec)

Initialises the filter.

Definition at line 62 of file juce_StateVariableTPTFilter.cpp.

◆ process()

template<typename SampleType>
template<typename ProcessContext>
void juce::dsp::StateVariableTPTFilter< SampleType >::process ( const ProcessContext & context)
inlinenoexcept

Processes the input and output samples supplied in the processing context.

Definition at line 114 of file juce_StateVariableTPTFilter.h.

Referenced by process().

◆ processSample()

template<typename SampleType>
SampleType juce::dsp::StateVariableTPTFilter< SampleType >::processSample ( int channel,
SampleType inputValue )

Processes one sample at a time on a given channel.

Definition at line 99 of file juce_StateVariableTPTFilter.cpp.

Referenced by process().

◆ reset() [1/2]

template<typename SampleType>
void juce::dsp::StateVariableTPTFilter< SampleType >::reset ( )

Resets the internal state variables of the filter.

Definition at line 77 of file juce_StateVariableTPTFilter.cpp.

Referenced by prepare(), and reset().

◆ reset() [2/2]

template<typename SampleType>
void juce::dsp::StateVariableTPTFilter< SampleType >::reset ( SampleType newValue)

Resets the internal state variables of the filter to a given value.

Definition at line 83 of file juce_StateVariableTPTFilter.cpp.

◆ setCutoffFrequency()

template<typename SampleType>
void juce::dsp::StateVariableTPTFilter< SampleType >::setCutoffFrequency ( SampleType newFrequencyHz)

Sets the cutoff frequency of the filter.

Parameters
newFrequencyHzthe new cutoff frequency in Hz.

Definition at line 43 of file juce_StateVariableTPTFilter.cpp.

◆ setResonance()

template<typename SampleType>
void juce::dsp::StateVariableTPTFilter< SampleType >::setResonance ( SampleType newResonance)

Sets the resonance of the filter.

Note: The bandwidth of the resonance increases with the value of the parameter. To have a standard 12 dB / octave filter, the value must be set at 1 / sqrt (2).

Definition at line 52 of file juce_StateVariableTPTFilter.cpp.

◆ setType()

template<typename SampleType>
void juce::dsp::StateVariableTPTFilter< SampleType >::setType ( Type newType)

Sets the filter type.

Definition at line 37 of file juce_StateVariableTPTFilter.cpp.

◆ snapToZero()

template<typename SampleType>
void juce::dsp::StateVariableTPTFilter< SampleType >::snapToZero ( )
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.

Definition at line 90 of file juce_StateVariableTPTFilter.cpp.

Referenced by process().


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