#include <avir.h>
Public Member Functions | |
int | calcInitComplexity (const CBuffer< uint8_t > &FracUseMap) const |
void | copyInitParams (const CDSPFracFilterBankLin &s) |
void | createAllFilters () |
const fptype * | getFilter (const int i) |
int | getFilterLen () const |
int | getFracCount () const |
int | getOrder () const |
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) |
bool | operator== (const CDSPFracFilterBankLin &s) const |
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< uint8_t > & | FracUseMap | ) | const |
Function 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 | ) |
Copy constructor 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. |
void avir::CDSPFracFilterBankLin< fptype >::createAllFilters | ( | ) |
Function makes sure all fractional delay filters were created.
const fptype* avir::CDSPFracFilterBankLin< fptype >::getFilter | ( | const int | i | ) |
Function returns the pointer to the specified interpolation table filter.
i | Filter (fractional delay) index, in the range 0 to ReqFracCount - 1, inclusive. |
int avir::CDSPFracFilterBankLin< fptype >::getFilterLen | ( | ) | const |
int avir::CDSPFracFilterBankLin< fptype >::getFracCount | ( | ) | const |
int avir::CDSPFracFilterBankLin< fptype >::getOrder | ( | ) | const |
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 |
||
) |
Function 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 |
Operator 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. |