r8brain-free-src
High-quality pro audio sample rate converter library
 
Loading...
Searching...
No Matches
r8b::CDSPFIRFilter Class Reference

Calculation and storage class for FIR filters. More...

#include <CDSPFIRFilter.h>

Inheritance diagram for r8b::CDSPFIRFilter:

Public Member Functions

int getBlockLenBits () const
 Returns filter's block length, expressed as Nth power of 2. The actual length is twice as large due to zero-padding.
 
const double * getKernelBlock () const
 Returns pointer to filter's kernel block, in complex-numbered form obtained via the CDSPRealFFT::forward() function call.
 
int getKernelLen () const
 Returns filter kernel length, in samples. Not to be confused with the block length.
 
int getLatency () const
 Returns filter's latency, in samples (integer part).
 
double getLatencyFrac () const
 Returns filter's latency, in samples (fractional part). Always zero for linear-phase filters.
 
bool isZeroPhase () const
 Returns true if kernel block of this filter has zero-phase response.
 
void unref ()
 Reduces reference count to this object.
 

Static Public Member Functions

static double getLPMaxAtten ()
 Returns the maximal allowed low-pass filter's stop-band attenuation, in decibel.
 
static double getLPMaxTransBand ()
 Returns the maximal allowed low-pass filter's transition band, in percent.
 
static double getLPMinAtten ()
 Returns the minimal allowed low-pass filter's stop-band attenuation, in decibel.
 
static double getLPMinTransBand ()
 Returns the minimal allowed low-pass filter's transition band, in percent.
 

Friends

class CDSPFIRFilterCache
 

Detailed Description

Calculation and storage class for FIR filters.

Class that implements calculation and storing of a FIR filter (currently contains low-pass filter calculation routine designed for sample rate conversion). Objects of this class cannot be created directly, but can be obtained via the CDSPFilterCache::getLPFilter() static function.

Member Function Documentation

◆ getKernelBlock()

const double * r8b::CDSPFIRFilter::getKernelBlock ( ) const

Returns pointer to filter's kernel block, in complex-numbered form obtained via the CDSPRealFFT::forward() function call.

Zero-padded, gain-adjusted with the CDSPRealFFT::getInvMulConst() multiplied by ReqGain constant, immediately suitable for convolution. Kernel block may have "zero-phase" response, depending on the isZeroPhase() function's result.

◆ unref()

void r8b::CDSPFIRFilter::unref ( )

Reduces reference count to this object.

This function should be called when the filter obtained via the filter cache is no longer needed.