JUCE  v6.1.6 (6.0.8-1114)
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::dsp::LinkwitzRileyFilter< SampleType > Class Template Reference

A filter class designed to perform multi-band separation using the TPT (Topology-Preserving Transform) structure. More...

#include <juce_LinkwitzRileyFilter.h>

Collaboration diagram for juce::dsp::LinkwitzRileyFilter< SampleType >:

Public Types

using Type = LinkwitzRileyFilterType
 

Public Member Functions

 LinkwitzRileyFilter ()
 Constructor. More...
 
SampleType getCutoffFrequency () const noexcept
 Returns the cutoff frequency of the filter. More...
 
Type getType () const noexcept
 Returns the type of the filter. More...
 
void prepare (const ProcessSpec &spec)
 Initialises the filter. More...
 
template<typename ProcessContext >
void process (const ProcessContext &context) noexcept
 Processes the input and output samples supplied in the processing context. More...
 
SampleType processSample (int channel, SampleType inputValue)
 Performs the filter operation on a single sample at a time. More...
 
void processSample (int channel, SampleType inputValue, SampleType &outputLow, SampleType &outputHigh)
 Performs the filter operation on a single sample at a time, and returns both the low-pass and the high-pass outputs of the TPT structure. More...
 
void reset ()
 Resets the internal state variables of the filter. More...
 
void setCutoffFrequency (SampleType newCutoffFrequencyHz)
 Sets the cutoff frequency of the filter in Hz. More...
 
void setType (Type newType)
 Sets the filter type. More...
 
void snapToZero () noexcept
 Ensure that the state variables are rounded to zero if the state variables are denormals. More...
 

Private Member Functions

void update ()
 

Private Attributes

SampleType cutoffFrequency = 2000.0
 
Type filterType = Type::lowpass
 
SampleType g
 
SampleType h
 
SampleType R2
 
std::vector< SampleType > s1
 
std::vector< SampleType > s2
 
std::vector< SampleType > s3
 
std::vector< SampleType > s4
 
double sampleRate = 44100.0
 

Detailed Description

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

A filter class designed to perform multi-band separation using the TPT (Topology-Preserving Transform) structure.

Linkwitz-Riley filters are widely used in audio crossovers that have two outputs, a low-pass and a high-pass, such that their sum is equivalent to an all-pass filter with a flat magnitude frequency response. The Linkwitz-Riley filters available in this class are designed to have a -24 dB/octave slope (LR 4th order).

@tags{DSP}

Member Typedef Documentation

◆ Type

template<typename SampleType >
using juce::dsp::LinkwitzRileyFilter< SampleType >::Type = LinkwitzRileyFilterType

Constructor & Destructor Documentation

◆ LinkwitzRileyFilter()

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

Constructor.

Member Function Documentation

◆ getCutoffFrequency()

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

Returns the cutoff frequency of the filter.

References juce::dsp::LinkwitzRileyFilter< SampleType >::cutoffFrequency.

◆ getType()

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

Returns the type of the filter.

References juce::dsp::LinkwitzRileyFilter< SampleType >::filterType.

◆ prepare()

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

Initialises the filter.

◆ process()

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

◆ processSample() [1/2]

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

Performs the filter operation on a single sample at a time.

Referenced by juce::dsp::LinkwitzRileyFilter< SampleType >::process().

◆ processSample() [2/2]

template<typename SampleType >
void juce::dsp::LinkwitzRileyFilter< SampleType >::processSample ( int  channel,
SampleType  inputValue,
SampleType &  outputLow,
SampleType &  outputHigh 
)

Performs the filter operation on a single sample at a time, and returns both the low-pass and the high-pass outputs of the TPT structure.

◆ reset()

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

Resets the internal state variables of the filter.

◆ setCutoffFrequency()

template<typename SampleType >
void juce::dsp::LinkwitzRileyFilter< SampleType >::setCutoffFrequency ( SampleType  newCutoffFrequencyHz)

Sets the cutoff frequency of the filter in Hz.

◆ setType()

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

Sets the filter type.

◆ snapToZero()

template<typename SampleType >
void juce::dsp::LinkwitzRileyFilter< 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.

Referenced by juce::dsp::LinkwitzRileyFilter< SampleType >::process().

◆ update()

template<typename SampleType >
void juce::dsp::LinkwitzRileyFilter< SampleType >::update ( )
private

Member Data Documentation

◆ cutoffFrequency

template<typename SampleType >
SampleType juce::dsp::LinkwitzRileyFilter< SampleType >::cutoffFrequency = 2000.0
private

◆ filterType

template<typename SampleType >
Type juce::dsp::LinkwitzRileyFilter< SampleType >::filterType = Type::lowpass
private

◆ g

template<typename SampleType >
SampleType juce::dsp::LinkwitzRileyFilter< SampleType >::g
private

◆ h

template<typename SampleType >
SampleType juce::dsp::LinkwitzRileyFilter< SampleType >::h
private

◆ R2

template<typename SampleType >
SampleType juce::dsp::LinkwitzRileyFilter< SampleType >::R2
private

◆ s1

template<typename SampleType >
std::vector<SampleType> juce::dsp::LinkwitzRileyFilter< SampleType >::s1
private

◆ s2

template<typename SampleType >
std::vector<SampleType> juce::dsp::LinkwitzRileyFilter< SampleType >::s2
private

◆ s3

template<typename SampleType >
std::vector<SampleType> juce::dsp::LinkwitzRileyFilter< SampleType >::s3
private

◆ s4

template<typename SampleType >
std::vector<SampleType> juce::dsp::LinkwitzRileyFilter< SampleType >::s4
private

◆ sampleRate

template<typename SampleType >
double juce::dsp::LinkwitzRileyFilter< SampleType >::sampleRate = 44100.0
private

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