JUCE v8.0.9
JUCE API
 
Loading...
Searching...
No Matches
juce::dsp::FIR::Coefficients< NumericType > Struct Template Reference

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

#include <juce_FIRFilter.h>

Inheritance diagram for juce::dsp::FIR::Coefficients< NumericType >:
Collaboration diagram for juce::dsp::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.
 

Public Member Functions

 Coefficients ()
 Creates a null set of coefficients (which will produce silence).
 
 Coefficients (Coefficients &&)=default
 
 Coefficients (const Coefficients &)=default
 
 Coefficients (const NumericType *samples, size_t numSamples)
 Creates a set of coefficients from an array of samples.
 
 Coefficients (size_t size)
 Creates a null set of coefficients of a given size.
 
void decReferenceCount () noexcept
 Decreases the object's reference count.
 
bool decReferenceCountWithoutDeleting () noexcept
 Decreases the object's reference count.
 
size_t getFilterOrder () const noexcept
 Returns the filter order associated with the coefficients.
 
double getMagnitudeForFrequency (double frequency, double sampleRate) const noexcept
 Returns the magnitude frequency response of the filter for a given frequency and sample rate.
 
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.
 
double getPhaseForFrequency (double frequency, double sampleRate) const noexcept
 Returns the phase frequency response of the filter for a given frequency and sample rate.
 
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.
 
const NumericTypegetRawCoefficients () const noexcept
 Returns a raw data pointer to the coefficients.
 
NumericTypegetRawCoefficients () noexcept
 Returns a raw data pointer to the coefficients.
 
int getReferenceCount () const noexcept
 Returns the object's current reference count.
 
void incReferenceCount () noexcept
 Increments the object's reference count.
 
void normalise () noexcept
 Scales the values of the FIR filter with the sum of the squared coefficients.
 
Coefficientsoperator= (Coefficients &&)=default
 
Coefficientsoperator= (const Coefficients &)=default
 

Public Attributes

Array< NumericTypecoefficients
 The raw coefficients.
 

Protected Member Functions

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

Private Attributes

Atomic< int > refCount { 0 }
 

Detailed Description

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

A set of coefficients for use in an FIRFilter object.

See also
FIRFilter

@tags{DSP}

Member Typedef Documentation

◆ Ptr

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 >
juce::dsp::FIR::Coefficients< NumericType >::Coefficients ( )
inline

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

◆ Coefficients() [2/5]

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

◆ Coefficients() [3/5]

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

Creates a set of coefficients from an array of samples.

◆ Coefficients() [4/5]

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

◆ Coefficients() [5/5]

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

Member Function Documentation

◆ decReferenceCount()

void juce::ReferenceCountedObject::decReferenceCount ( )
inlinenoexceptinherited

Decreases the object's reference count.

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

References jassert.

◆ decReferenceCountWithoutDeleting()

bool juce::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 juce::dsp::FIR::Coefficients< NumericType >::getFilterOrder ( ) const
inlinenoexcept

◆ getMagnitudeForFrequency()

template<typename NumericType >
double juce::dsp::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 juce::dsp::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 juce::dsp::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 juce::dsp::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 >
const NumericType * juce::dsp::FIR::Coefficients< NumericType >::getRawCoefficients ( ) const
inlinenoexcept

◆ getRawCoefficients() [2/2]

◆ getReferenceCount()

int juce::ReferenceCountedObject::getReferenceCount ( ) const
inlinenoexceptinherited

Returns the object's current reference count.

◆ incReferenceCount()

void juce::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 juce::dsp::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 & juce::dsp::FIR::Coefficients< NumericType >::operator= ( Coefficients< NumericType > &&  )
default

◆ operator=() [2/2]

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

◆ resetReferenceCount()

void juce::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

◆ refCount

Atomic<int> juce::ReferenceCountedObject::refCount { 0 }
privateinherited

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