JUCE  v5.1.1-3-g1a0b28c73
JUCE API
FIR::Coefficients< NumericType > Struct Template Reference

A set of coefficients for use in an FIRFilter object. More...

#include <juce_FIRFilter.h>

Inheritance diagram for FIR::Coefficients< NumericType >:
Collaboration diagram for FIR::Coefficients< NumericType >:

Public Types

using Ptr = ReferenceCountedObjectPtr< Coefficients >
 The Coefficients structure is ref-counted, so this is a handy type that can be used as a pointer to one. More...
 

Public Member Functions

 Coefficients ()
 Creates a null set of coefficients (which will produce silence). More...
 
 Coefficients (size_t size)
 Creates a null set of coefficients of a given size. More...
 
 Coefficients (const Coefficients &)=default
 Creates a copy of another filter. More...
 
 Coefficients (Coefficients &&)=default
 Move constructor. More...
 
 Coefficients (const NumericType *samples, size_t numSamples)
 Creates a set of coefficients from an array of samples. More...
 
void decReferenceCount () noexcept
 Decreases the object's reference count. More...
 
bool decReferenceCountWithoutDeleting () noexcept
 Decreases the object's reference count. More...
 
size_t getFilterOrder () const noexcept
 Returns the filter order associated with the coefficients. More...
 
double getMagnitudeForFrequency (double frequency, double sampleRate) const noexcept
 Returns the magnitude frequency response of the filter for a given frequency and sample rate. More...
 
void getMagnitudeForFrequencyArray (double *frequencies, double *magnitudes, size_t numSamples, double sampleRate) const noexcept
 Returns the magnitude frequency response of the filter for a given frequency array and sample rate. More...
 
double getPhaseForFrequency (double frequency, double sampleRate) const noexcept
 Returns the phase frequency response of the filter for a given frequency and sample rate. More...
 
void getPhaseForFrequencyArray (double *frequencies, double *phases, size_t numSamples, double sampleRate) const noexcept
 Returns the phase frequency response of the filter for a given frequency array and sample rate. More...
 
NumericType * getRawCoefficients () noexcept
 Returns a raw data pointer to the coefficients. More...
 
const NumericType * getRawCoefficients () const noexcept
 Returns a raw data pointer to the coefficients. More...
 
int getReferenceCount () const noexcept
 Returns the object's current reference count. More...
 
void incReferenceCount () noexcept
 Increments the object's reference count. More...
 
void normalise () noexcept
 Scales the values of the FIR filter with the sum of the squared coefficients. More...
 
Coefficientsoperator= (const Coefficients &other)
 Creates a copy of another filter. More...
 
Coefficientsoperator= (Coefficients &&)=default
 Creates a copy of another filter. More...
 

Public Attributes

Array< NumericType > coefficients
 The raw coefficients. More...
 

Protected Member Functions

void resetReferenceCount () noexcept
 Resets the reference count to zero without deleting the object. More...
 

Detailed Description

template<typename NumericType>
struct FIR::Coefficients< NumericType >

A set of coefficients for use in an FIRFilter object.

See also
FIRFilter

Member Typedef Documentation

◆ Ptr

template<typename NumericType>
using FIR::Coefficients< NumericType >::Ptr = ReferenceCountedObjectPtr<Coefficients>

The Coefficients structure is ref-counted, so this is a handy type that can be used as a pointer to one.

Constructor & Destructor Documentation

◆ Coefficients() [1/5]

template<typename NumericType>
FIR::Coefficients< NumericType >::Coefficients ( )
inline

Creates a null set of coefficients (which will produce silence).

◆ Coefficients() [2/5]

template<typename NumericType>
FIR::Coefficients< NumericType >::Coefficients ( size_t  size)
inline

Creates a null set of coefficients of a given size.

References FIR::Filter< SampleType >::coefficients.

◆ Coefficients() [3/5]

template<typename NumericType>
FIR::Coefficients< NumericType >::Coefficients ( const Coefficients< NumericType > &  )
default

Creates a copy of another filter.

◆ Coefficients() [4/5]

template<typename NumericType>
FIR::Coefficients< NumericType >::Coefficients ( Coefficients< NumericType > &&  )
default

Move constructor.

◆ Coefficients() [5/5]

template<typename NumericType>
FIR::Coefficients< NumericType >::Coefficients ( const NumericType *  samples,
size_t  numSamples 
)
inline

Creates a set of coefficients from an array of samples.

Member Function Documentation

◆ decReferenceCount()

void ReferenceCountedObject::decReferenceCount ( )
inlinenoexceptinherited

Decreases the object's reference count.

If the count gets to zero, the object will be deleted.

References jassert.

◆ decReferenceCountWithoutDeleting()

bool ReferenceCountedObject::decReferenceCountWithoutDeleting ( )
inlinenoexceptinherited

Decreases the object's reference count.

If the count gets to zero, the object will not be deleted, but this method will return true, allowing the caller to take care of deletion.

References jassert.

◆ getFilterOrder()

template<typename NumericType>
size_t FIR::Coefficients< NumericType >::getFilterOrder ( ) const
inlinenoexcept

Returns the filter order associated with the coefficients.

References FIR::Filter< SampleType >::coefficients.

◆ getMagnitudeForFrequency()

template<typename NumericType>
double FIR::Coefficients< NumericType >::getMagnitudeForFrequency ( double  frequency,
double  sampleRate 
) const
noexcept

Returns the magnitude frequency response of the filter for a given frequency and sample rate.

◆ getMagnitudeForFrequencyArray()

template<typename NumericType>
void FIR::Coefficients< NumericType >::getMagnitudeForFrequencyArray ( double *  frequencies,
double *  magnitudes,
size_t  numSamples,
double  sampleRate 
) const
noexcept

Returns the magnitude frequency response of the filter for a given frequency array and sample rate.

◆ getPhaseForFrequency()

template<typename NumericType>
double FIR::Coefficients< NumericType >::getPhaseForFrequency ( double  frequency,
double  sampleRate 
) const
noexcept

Returns the phase frequency response of the filter for a given frequency and sample rate.

◆ getPhaseForFrequencyArray()

template<typename NumericType>
void FIR::Coefficients< NumericType >::getPhaseForFrequencyArray ( double *  frequencies,
double *  phases,
size_t  numSamples,
double  sampleRate 
) const
noexcept

Returns the phase frequency response of the filter for a given frequency array and sample rate.

◆ getRawCoefficients() [1/2]

template<typename NumericType>
NumericType* FIR::Coefficients< NumericType >::getRawCoefficients ( )
inlinenoexcept

Returns a raw data pointer to the coefficients.

References FIR::Filter< SampleType >::coefficients.

◆ getRawCoefficients() [2/2]

template<typename NumericType>
const NumericType* FIR::Coefficients< NumericType >::getRawCoefficients ( ) const
inlinenoexcept

Returns a raw data pointer to the coefficients.

References FIR::Filter< SampleType >::coefficients.

◆ getReferenceCount()

int ReferenceCountedObject::getReferenceCount ( ) const
inlinenoexceptinherited

Returns the object's current reference count.

◆ incReferenceCount()

void ReferenceCountedObject::incReferenceCount ( )
inlinenoexceptinherited

Increments the object's reference count.

This is done automatically by the smart pointer, but is public just in case it's needed for nefarious purposes.

◆ normalise()

template<typename NumericType>
void FIR::Coefficients< NumericType >::normalise ( )
noexcept

Scales the values of the FIR filter with the sum of the squared coefficients.

◆ operator=() [1/2]

template<typename NumericType>
Coefficients& FIR::Coefficients< NumericType >::operator= ( const Coefficients< NumericType > &  other)
inline

◆ operator=() [2/2]

template<typename NumericType>
Coefficients& FIR::Coefficients< NumericType >::operator= ( Coefficients< NumericType > &&  )
default

Creates a copy of another filter.

◆ resetReferenceCount()

void ReferenceCountedObject::resetReferenceCount ( )
inlineprotectednoexceptinherited

Resets the reference count to zero without deleting the object.

You should probably never need to use this!

Member Data Documentation

◆ coefficients

template<typename NumericType>
Array<NumericType> FIR::Coefficients< NumericType >::coefficients

The raw coefficients.

You should leave these numbers alone unless you really know what you're doing.

Referenced by FIR::Coefficients< NumericType >::operator=().


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