r8brain-free-src
High-quality pro audio sample rate converter library
 
Loading...
Searching...
No Matches
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)
 Initializes the filter bank object.
 
int getFilterFracs () const
 Returns the number of fractional positions sampled by the bank.
 
int getFilterLen () const
 Returns the length of the filter, in samples (taps). Always an even number, not less than 6.
 
const double & operator[] (const int i) const
 Returns reference to the filter.
 
void unref ()
 Reduces reference count to this object.
 

Static Public Member Functions

static void roundReqAtten (double &att, const bool aIsThird)
 Rounds the specified attenuation to the nearest effective value.
 

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 )

Initializes the filter bank object.

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.
aIsThirdtrue if one-third filter is required.

Member Function Documentation

◆ operator[]()

const double & r8b::CDSPFracDelayFilterBank::operator[] ( const int i) const

Returns reference to the filter.

Parameters
iFilter index, in the range 0 to FilterFracs, inclusive.

◆ roundReqAtten()

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

Rounds the specified attenuation to the nearest effective value.

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

◆ unref()

void r8b::CDSPFracDelayFilterBank::unref ( )

Reduces reference count to this object.

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