MostlyHarmless 0.0.1
 
Loading...
Searching...
No Matches
marvin::dsp::filters::LatticeAPF< SampleType > Class Template Referencefinal

A two multiply first order Schroeder allpass filter. More...

#include <marvin_APF.h>

Public Member Functions

 ~LatticeAPF () noexcept=default
 
void initialise (double sampleRate)
 
void setCoeff (SampleType newCoeff) noexcept
 
void setDelay (SampleType newDelaySamples) noexcept
 
SampleType operator() (SampleType x) noexcept
 
void reset () noexcept
 
SampleType tap (SampleType delaySamples) noexcept
 

Detailed Description

template<FloatType SampleType>
class marvin::dsp::filters::LatticeAPF< SampleType >

A two multiply first order Schroeder allpass filter.

Constructor & Destructor Documentation

◆ ~LatticeAPF()

template<FloatType SampleType>
marvin::dsp::filters::LatticeAPF< SampleType >::~LatticeAPF ( )
defaultnoexcept

Member Function Documentation

◆ initialise()

template<FloatType SampleType>
void marvin::dsp::filters::LatticeAPF< SampleType >::initialise ( double sampleRate)

Initialises the APF. Ensure this function is called before any calls to the call operator.

Parameters
sampleRateThe sample rate the filter should use.

◆ operator()()

template<FloatType SampleType>
SampleType marvin::dsp::filters::LatticeAPF< SampleType >::operator() ( SampleType x)
nodiscardnoexcept

Processes the input through the APF, and returns the filtered sample.

Parameters
xThe sample to filter.
Returns
The filtered sample.

◆ reset()

template<FloatType SampleType>
void marvin::dsp::filters::LatticeAPF< SampleType >::reset ( )
noexcept

Resets the filter to it's initial state.

◆ setCoeff()

template<FloatType SampleType>
void marvin::dsp::filters::LatticeAPF< SampleType >::setCoeff ( SampleType newCoeff)
noexcept

Sets the feedback/feedforward coefficient to use. At values >= 1, the filter becomes unstable, so be careful!.
Note that the internal coeff variable this function sets is not atomic, so ensure that this function is either called on the audio thread, or that the audio thread is not running when you call it.

Parameters
newCoeffThe feedback/feedforward coefficient to use.

◆ setDelay()

template<FloatType SampleType>
void marvin::dsp::filters::LatticeAPF< SampleType >::setDelay ( SampleType newDelaySamples)
noexcept

Sets the delay to use. Note that the delay line has a somewhat-arbitrary max of sampleRate samples, so be sure not to set the delay to anything above that.

Parameters
newDelaySamplesThe delay to use, in samples.

◆ tap()

template<FloatType SampleType>
SampleType marvin::dsp::filters::LatticeAPF< SampleType >::tap ( SampleType delaySamples)
nodiscardnoexcept

Retrieve a given sample-into the delay line, without updating the read head. Niche-ly useful in the case of something like a Dattorro reverb, for example.

Parameters
delaySamplesThe offset from the current read head to read from.
Returns
The sample at the desired offset.

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