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

## 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

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

- juce_dsp/processors/juce_FIRFilter.h

## Public Types

using | 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).
using | CoefficientsPtr = typename Coefficients<NumericType>::Ptr
| A typedef for a ref-counted pointer to the coefficients object.

## Public Member Functions

| Filter ()
| This will create a filter which will produce silence.
| Filter (CoefficientsPtr coefficientsToUse)
| Creates a filter with a given set of coefficients.
| Filter (const Filter &)=default
| Filter (Filter &&)=default
Filter & | operator= (const Filter &)=default
Filter & | operator= (Filter &&)=default
void | prepare (const ProcessSpec &spec) noexcept
| Prepare this filter for processing.
void | reset ()
| Resets the filter's processing pipeline, ready to start a new stream of data.
template<typename ProcessContext>
void | process (const ProcessContext &context) noexcept
| Processes a block of samples.
SampleType JUCE_VECTOR_CALLTYPE | processSample (SampleType sample) noexcept
| Processes a single sample, without any locking.

## Public Attributes

Coefficients< NumericType >::Ptr | coefficients
| The coefficients of the FIR filter.

## Member Typedef Documentation

## 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).

## 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.

## Constructors and Destructors

## Filter() [1/4]

template<typename SampleType>

juce::dsp::FIR::Filter< SampleType >::Filter | ( |  | ) |

inline

This will create a filter which will produce silence.

References coefficients, and reset().

Referenced by Filter(), Filter(), operator=(), and operator=().

## Filter() [2/4]

template<typename SampleType>

juce::dsp::FIR::Filter< SampleType >::Filter | ( | CoefficientsPtr | coefficientsToUse | ) |

inline

Creates a filter with a given set of coefficients.

References coefficients, and reset().

## Filter() [3/4]

template<typename SampleType>

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

default

References Filter().

## Filter() [4/4]

template<typename SampleType>

juce::dsp::FIR::Filter< SampleType >::Filter | ( | Filter< SampleType > && |  | ) |

default

References Filter().

## Member Functions

## operator=() [1/2]

template<typename SampleType>

Filter & juce::dsp::FIR::Filter< SampleType >::operator= | ( | const Filter< SampleType > & |  | ) |

default

References Filter().

## operator=() [2/2]

template<typename SampleType>

Filter & juce::dsp::FIR::Filter< SampleType >::operator= | ( | Filter< SampleType > && |  | ) |

default

References Filter().

## prepare()

template<typename SampleType>

void juce::dsp::FIR::Filter< SampleType >::prepare | ( | const ProcessSpec & | spec | ) |

inline noexcept

Prepare this filter for processing.

References jassert, and reset().

## 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).

References coefficients, juce::jmax(), and juce::snapPointerToAlignment().

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

## process()

template<typename SampleType>
template<typename ProcessContext>

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

inline noexcept

Processes a block of samples.

References coefficients, and jassert.

## processSample()

template<typename SampleType>

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

inline noexcept

Processes a single sample, without any locking.

Use this if you need processing of a single value.

References coefficients, and JUCE_VECTOR_CALLTYPE.

## 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.

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

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited