r8brain-free-src
High-quality pro audio sample rate converter library
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Friends | List of all members
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
 
const double * getKernelBlock () const
 
int getKernelLen () const
 
int getLatency () const
 
double getLatencyFrac () const
 
bool isZeroPhase () const
 
void unref ()
 

Static Public Member Functions

static double getLPMaxAtten ()
 
static double getLPMaxTransBand ()
 
static double getLPMinAtten ()
 
static double getLPMinTransBand ()
 

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

◆ getBlockLenBits()

int r8b::CDSPFIRFilter::getBlockLenBits ( ) const
Returns
Filter's block length, expressed as Nth power of 2. The actual length is twice as large due to zero-padding.

◆ getKernelBlock()

const double * r8b::CDSPFIRFilter::getKernelBlock ( ) const
Returns
Filter's kernel block, in complex-numbered form obtained via the CDSPRealFFT::forward() function call, zero-padded, gain-adjusted with the CDSPRealFFT::getInvMulConst() * ReqGain constant, immediately suitable for convolution. Kernel block may have "zero-phase" response, depending on the isZeroPhase() function's result.

◆ getKernelLen()

int r8b::CDSPFIRFilter::getKernelLen ( ) const
Returns
Filter kernel length, in samples. Not to be confused with the block length.

◆ getLatency()

int r8b::CDSPFIRFilter::getLatency ( ) const
Returns
Filter's latency, in samples (integer part).

◆ getLatencyFrac()

double r8b::CDSPFIRFilter::getLatencyFrac ( ) const
Returns
Filter's latency, in samples (fractional part). Always zero for linear-phase filters.

◆ getLPMaxAtten()

static double r8b::CDSPFIRFilter::getLPMaxAtten ( )
static
Returns
The maximal allowed low-pass filter's stop-band attenuation, in decibel.

◆ getLPMaxTransBand()

static double r8b::CDSPFIRFilter::getLPMaxTransBand ( )
static
Returns
The maximal allowed low-pass filter's transition band, in percent.

◆ getLPMinAtten()

static double r8b::CDSPFIRFilter::getLPMinAtten ( )
static
Returns
The minimal allowed low-pass filter's stop-band attenuation, in decibel.

◆ getLPMinTransBand()

static double r8b::CDSPFIRFilter::getLPMinTransBand ( )
static
Returns
The minimal allowed low-pass filter's transition band, in percent.

◆ isZeroPhase()

bool r8b::CDSPFIRFilter::isZeroPhase ( ) const
Returns
"True" if kernel block of *this filter has zero-phase response.

◆ unref()

void r8b::CDSPFIRFilter::unref ( )

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