OpenShot Audio Library | OpenShotAudio: juce::dsp::StateVariableFilter::Filter< SampleType > Class Template Reference

OpenShot Audio Library | OpenShotAudio 1.0.0

Loading...
Searching...
No Matches
juce::dsp::StateVariableFilter::Filter< SampleType > Class Template Reference

`#include <juce_StateVariableFilter.h>`

## Public Types
using | NumericType = typename SampleTypeHelpers::ElementType<SampleType>::Type
using | ParametersPtr = typename Parameters<NumericType>::Ptr

## Public Member Functions
| Filter ()
| Filter (ParametersPtr parametersToUse)
| Filter (const Filter &)=default
| Filter (Filter &&)=default
void | prepare (const ProcessSpec &) noexcept
void | reset () noexcept
void | snapToZero () noexcept
template<typename ProcessContext>
void | process (const ProcessContext &context) noexcept
SampleType JUCE_VECTOR_CALLTYPE | processSample (SampleType sample) noexcept

## Public Attributes
Parameters< NumericType >::Ptr | parameters

## Detailed Description

template<typename SampleType>
class juce::dsp::StateVariableFilter::Filter< 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 55 of file juce_StateVariableFilter.h.

## Member Typedef Documentation

## ◆ NumericType

template<typename SampleType>

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)

Definition at line 62 of file juce_StateVariableFilter.h.

## ◆ ParametersPtr

template<typename SampleType>

using juce::dsp::StateVariableFilter::Filter< SampleType >::ParametersPtr = typename Parameters<NumericType>::Ptr

A typedef for a ref-counted pointer to the coefficients object

Definition at line 65 of file juce_StateVariableFilter.h.

## Constructor & Destructor Documentation

## ◆ Filter() [1/4]

template<typename SampleType>

juce::dsp::StateVariableFilter::Filter< SampleType >::Filter | ( |  | ) |
| inline

Creates a filter with default parameters.

Deprecated

Definition at line 72 of file juce_StateVariableFilter.h.

Referenced by Filter(), and Filter().

## ◆ Filter() [2/4]

template<typename SampleType>

juce::dsp::StateVariableFilter::Filter< SampleType >::Filter | ( | ParametersPtr | parametersToUse | ) |
| inline

Creates a filter using some parameters.

Deprecated

Definition at line 77 of file juce_StateVariableFilter.h.

## ◆ Filter() [3/4]

template<typename SampleType>

juce::dsp::StateVariableFilter::Filter< SampleType >::Filter | ( | const Filter< SampleType > & |  | ) |
| default

Creates a copy of another filter.

## ◆ Filter() [4/4]

template<typename SampleType>

juce::dsp::StateVariableFilter::Filter< SampleType >::Filter | ( | Filter< SampleType > && |  | ) |
| default

Move constructor

## Member Function Documentation

## ◆ prepare()

template<typename SampleType>

void juce::dsp::StateVariableFilter::Filter< SampleType >::prepare | ( | const ProcessSpec & |  | ) |
| inlinenoexcept

Initialization of the filter

Definition at line 88 of file juce_StateVariableFilter.h.

## ◆ process()

template<typename SampleType>
template<typename ProcessContext>

void juce::dsp::StateVariableFilter::Filter< SampleType >::process | ( | const ProcessContext & | context | ) |
| inlinenoexcept

Definition at line 106 of file juce_StateVariableFilter.h.

## ◆ processSample()

template<typename SampleType>

SampleType JUCE_VECTOR_CALLTYPE juce::dsp::StateVariableFilter::Filter< SampleType >::processSample | ( | SampleType | sample | ) |
| inlinenoexcept

Processes a single sample, without any locking or checking. Use this if you need processing of a single value.

Definition at line 119 of file juce_StateVariableFilter.h.

## ◆ reset()

template<typename SampleType>

void juce::dsp::StateVariableFilter::Filter< SampleType >::reset | ( |  | ) |
| inlinenoexcept

Resets the filter's processing pipeline.

Definition at line 91 of file juce_StateVariableFilter.h.

Referenced by Filter(), Filter(), and prepare().

## ◆ snapToZero()

template<typename SampleType>

void juce::dsp::StateVariableFilter::Filter< SampleType >::snapToZero | ( |  | ) |
| 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.

Definition at line 97 of file juce_StateVariableFilter.h.

## Member Data Documentation

## ◆ parameters

template<typename SampleType>

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.

Definition at line 102 of file juce_StateVariableFilter.h.

Referenced by Filter(), Filter(), and processSample().

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

- juce_StateVariableFilter.h