OpenShot Audio Library | OpenShotAudio 0.3.2
Loading...
Searching...
No Matches
juce::dsp::FIR::Filter< SampleType > Class Template Reference

#include <juce_FIRFilter.h>

Public Types

using NumericType = typename SampleTypeHelpers::ElementType< SampleType >::Type
 
using CoefficientsPtr = typename Coefficients< NumericType >::Ptr
 

Public Member Functions

 Filter ()
 
 Filter (CoefficientsPtr coefficientsToUse)
 
 Filter (const Filter &)=default
 
 Filter (Filter &&)=default
 
Filteroperator= (const Filter &)=default
 
Filteroperator= (Filter &&)=default
 
void prepare (const ProcessSpec &spec) noexcept
 
void reset ()
 
template<typename ProcessContext >
void process (const ProcessContext &context) noexcept
 
SampleType JUCE_VECTOR_CALLTYPE processSample (SampleType sample) noexcept
 

Public Attributes

Coefficients< NumericType >::Ptr coefficients
 

Detailed Description

template<typename SampleType>
class juce::dsp::FIR::Filter< SampleType >

A processing class that can perform FIR filtering on an audio signal, in the time domain.

Using FIRFilter is fast enough for FIRCoefficients with a size lower than 128 samples. For longer filters, it might be more efficient to use the class Convolution instead, which does the same processing in the frequency domain thanks to FFT.

See also
FIRFilter::Coefficients, Convolution, FFT

Definition at line 55 of file juce_FIRFilter.h.

Member Typedef Documentation

◆ CoefficientsPtr

template<typename SampleType >
using juce::dsp::FIR::Filter< SampleType >::CoefficientsPtr = typename Coefficients<NumericType>::Ptr

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

Definition at line 64 of file juce_FIRFilter.h.

◆ NumericType

template<typename SampleType >
using juce::dsp::FIR::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 61 of file juce_FIRFilter.h.

Constructor & Destructor Documentation

◆ Filter() [1/2]

template<typename SampleType >
juce::dsp::FIR::Filter< SampleType >::Filter ( )
inline

This will create a filter which will produce silence.

Definition at line 68 of file juce_FIRFilter.h.

◆ Filter() [2/2]

template<typename SampleType >
juce::dsp::FIR::Filter< SampleType >::Filter ( CoefficientsPtr  coefficientsToUse)
inline

Creates a filter with a given set of coefficients.

Definition at line 71 of file juce_FIRFilter.h.

Member Function Documentation

◆ prepare()

template<typename SampleType >
void juce::dsp::FIR::Filter< SampleType >::prepare ( const ProcessSpec spec)
inlinenoexcept

Prepare this filter for processing.

Definition at line 80 of file juce_FIRFilter.h.

◆ process()

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

Processes a block of samples

Definition at line 125 of file juce_FIRFilter.h.

◆ processSample()

template<typename SampleType >
SampleType JUCE_VECTOR_CALLTYPE juce::dsp::FIR::Filter< SampleType >::processSample ( SampleType  sample)
inlinenoexcept

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

Definition at line 167 of file juce_FIRFilter.h.

◆ reset()

template<typename SampleType >
void juce::dsp::FIR::Filter< SampleType >::reset ( )
inline

Resets the filter's processing pipeline, ready to start a new stream of data.

Note that this clears the processing state, but the type of filter and its coefficients aren't changed. To disable the filter, call setEnabled (false).

Definition at line 94 of file juce_FIRFilter.h.

Referenced by juce::dsp::FIR::Filter< SampleType >::Filter(), juce::dsp::FIR::Filter< SampleType >::Filter(), and juce::dsp::FIR::Filter< SampleType >::prepare().

Member Data Documentation

◆ coefficients

template<typename SampleType >
Coefficients<NumericType>::Ptr juce::dsp::FIR::Filter< SampleType >::coefficients

The coefficients of the FIR filter. It's up to the caller to ensure that these coefficients are modified in a thread-safe way.

If you change the order of the coefficients then you must call reset after modifying them.

Definition at line 120 of file juce_FIRFilter.h.

Referenced by juce::dsp::FIR::Filter< SampleType >::process(), juce::dsp::FIR::Filter< SampleType >::processSample(), and juce::dsp::FIR::Filter< SampleType >::reset().


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