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::CDSPFracDelayFilterBank Class Reference

Sinc function-based fractional delay filter bank class. More...

#include <CDSPFracInterpolator.h>

Inheritance diagram for r8b::CDSPFracDelayFilterBank:

Public Member Functions

 CDSPFracDelayFilterBank (const int aFilterFracs, const int aElementSize, const int aInterpPoints, const double aReqAtten, const bool aIsThird)
 
int getFilterFracs () const
 
int getFilterLen () const
 
const double & operator[] (const int i) const
 
void unref ()
 

Static Public Member Functions

static void roundReqAtten (double &att, const bool aIsThird)
 

Friends

class CDSPFracDelayFilterBankCache
 

Detailed Description

Sinc function-based fractional delay filter bank class.

Class implements storage and initialization of a bank of sinc-based fractional delay filters, expressed as 0th, 1st, 2nd or 3rd order polynomial interpolation coefficients. The filters are windowed by the "Kaiser" power-raised window function.

Constructor & Destructor Documentation

◆ CDSPFracDelayFilterBank()

r8b::CDSPFracDelayFilterBank::CDSPFracDelayFilterBank ( const int  aFilterFracs,
const int  aElementSize,
const int  aInterpPoints,
const double  aReqAtten,
const bool  aIsThird 
)

Constructor.

Parameters
aFilterFracsThe number of fractional delay positions to sample, -1 - use default.
aElementSizeThe size of each filter's tap, in "double" values. This parameter corresponds to the complexity of interpolation. 4 should be set for 3rd order, 3 for 2nd order, 2 for linear interpolation, 1 for whole-numbered stepping.
aInterpPointsThe number of points the interpolation is based on. This value should not be confused with the ElementSize. Set to 2 for linear or no interpolation.
aReqAttenRequired filter attentuation.
aIsThird"True" if one-third filter is required.

Member Function Documentation

◆ getFilterFracs()

int r8b::CDSPFracDelayFilterBank::getFilterFracs ( ) const
Returns
The number of fractional positions sampled by the bank.

◆ getFilterLen()

int r8b::CDSPFracDelayFilterBank::getFilterLen ( ) const
Returns
The length of the filter, in samples (taps). Always an even number, not less than 6.

◆ operator[]()

const double & r8b::CDSPFracDelayFilterBank::operator[] ( const int  i) const
Parameters
iFilter index, in the range 0 to FilterFracs, inclusive.
Returns
Reference to the filter.

◆ roundReqAtten()

static void r8b::CDSPFracDelayFilterBank::roundReqAtten ( double &  att,
const bool  aIsThird 
)
static

Function "rounds" the specified attenuation to the nearest effective value.

Parameters
[in,out]attRequired filter attentuation. Will be rounded to the nearest value.
aIsThird"True" if one-third filter is required.

◆ unref()

void r8b::CDSPFracDelayFilterBank::unref ( )

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