Sinc function-based fractional delay filter bank. More...
#include <avir.h>
Public Member Functions | |
int | calcInitComplexity (const CBuffer< char > &FracUseMap) const |
Returns an approximate initialization complexity, expressed in the number of multiply-add operations. | |
void | copyInitParams (const CDSPFracFilterBankLin &s) |
Copies a limited set of parameters of the source filter bank. | |
void | createAllFilters () |
Makes sure all fractional delay filters were created. | |
const fptype * | getFilter (const int i) |
Returns the pointer to the specified interpolation table filter. | |
const fptype * | getFilterConst (const int i) const |
Returns the pointer to the specified interpolation table filter. | |
int | getFilterLen () const |
Returns the length of each fractional delay filter, in samples (taps). Always an even value. | |
int | getFracCount () const |
Returns the number of fractional filters in use by this bank. | |
int | getOrder () const |
Returns the order of the interpolation polynomial. | |
void | init (const int ReqFracCount, const int ReqOrder, const double BaseLen, const double Cutoff, const double aWFAlpha, const CFltBuffer &aExtFilter, const int aAlignment=0, const int FltLenAlign=1) |
Initializes (builds) the filter bank based on the supplied parameters. | |
bool | operator== (const CDSPFracFilterBankLin &s) const |
Compares this filter bank and another filter bank, and returns true , if their parameters are equal. Alignment is not taken into account. | |
Sinc function-based fractional delay filter bank.
Class implements storage and initialization of a bank of sinc function-based fractional delay filters, expressed as 1st order polynomial interpolation coefficients. The filters are produced from a single "long" windowed low-pass filter. Also supports 0th-order ("nearest neighbor") interpolation.
This class also supports multiplication of each fractional delay filter by an external filter (usually a low-pass filter).
fptype | Specifies storage type of the filter coefficients bank. The filters are initially calculated using the "double" precision. |
int avir::CDSPFracFilterBankLin< fptype >::calcInitComplexity | ( | const CBuffer< char > & | FracUseMap | ) | const |
Returns an approximate initialization complexity, expressed in the number of multiply-add operations.
This includes fractional delay filters calculation and multiplication by an external filter. This function can only be called after the init() function.
FracUseMap | Fractional delays use map, each element corresponds to a single fractional delay, will be compared to the internal table fill flags. This map should include 0 and 1 values only. |
void avir::CDSPFracFilterBankLin< fptype >::copyInitParams | ( | const CDSPFracFilterBankLin< fptype > & | s | ) |
Copies a limited set of parameters of the source filter bank.
The actual filters are not copied. Such copying is used during filtering steps "modeling" stage. A further init() function call is required.
s | Source filter bank. |
const fptype * avir::CDSPFracFilterBankLin< fptype >::getFilter | ( | const int | i | ) |
Returns the pointer to the specified interpolation table filter.
The filter will be created if it is not yet created.
i | Filter (fractional delay) index, in the range 0 to ReqFracCount - 1 , inclusive. |
FilterLen
elements. const fptype * avir::CDSPFracFilterBankLin< fptype >::getFilterConst | ( | const int | i | ) | const |
Returns the pointer to the specified interpolation table filter.
This function can be only used if the createAllFilters() function was called.
i | Filter (fractional delay) index, in the range 0 to ReqFracCount - 1 , inclusive. |
FilterLen
elements. void avir::CDSPFracFilterBankLin< fptype >::init | ( | const int | ReqFracCount, |
const int | ReqOrder, | ||
const double | BaseLen, | ||
const double | Cutoff, | ||
const double | aWFAlpha, | ||
const CFltBuffer & | aExtFilter, | ||
const int | aAlignment = 0, | ||
const int | FltLenAlign = 1 ) |
Initializes (builds) the filter bank based on the supplied parameters.
If the supplied parameters are equal to previously defined parameters, function does nothing (alignment is assumed to be never changing between the init() function calls).
ReqFracCount | Required number of fractional delays in the filter bank. The minimal value is 2. |
ReqOrder | Required order of the interpolation polynomial (0 or 1). |
BaseLen | Low-pass filter's base length, in samples (taps). Affects the actual length of the filter and its overall steepness. |
Cutoff | Low-pass filter's normalized cutoff frequency, [0; 1]. |
aWFAlpha | Peaked Cosine window function's Alpha parameter. |
aExtFilter | External filter to apply to each fractional delay filter. |
aAlignment | Memory alignment of the filter bank, power-of-2 value. 0 - use default stdlib alignment. |
FltLenAlign | Filter's length alignment, power-of-2 value. |
bool avir::CDSPFracFilterBankLin< fptype >::operator== | ( | const CDSPFracFilterBankLin< fptype > & | s | ) | const |
Compares this filter bank and another filter bank, and returns true
, if their parameters are equal. Alignment is not taken into account.
s | Filter bank to compare to. |
true
, if compared banks have equal parameters.