(8.D.2.7) SbAECV1
Overview
Frequency domain subband adaptive filter
Discussion
Subband based mono echo canceler / adaptive filter. This module works in conjunction with the WOLA filterbank modules and implements an adaptive filter within each subband. Each subband operates independently which provides fast adaptation time and excellent cancellation.
The length of the effective echo tail equals the number of subband taps times the block size at the input to the WOLA analysis module. For example, assume that the WOLA analysis module has an input block size of 256 samples and an FFT size of 512 samples. Then if the subband echo canceler has 10 taps, this corresponds to an effective tail length of 10 x 256 = 2560 samples.
The module has two input pins. dataIn is the desired response (typically the microphone signal in an AEC). The second input is the mono reference signal.
At instantiation time you specify the length of each subband filter. Then at run time, you specify the number of taps currently used. This allows you to easily vary the filter length at run time and verify performance and CPU load. On some systems - especially those with caches - the computational load of the filter is a function of both the length of each subband and the number of taps currently in use. For most efficient operation, the length of the filter should equal the number of taps in use.
The smoothingTime variable controls the adaptation speed of the filter. smoothingTime is in units of seconds and usually in the range of 10 to 20 seconds. The higher the smoothingTime the slower the filter will adapt but it will achieve higher overall cancellation.
The module has optional residual noise suppression which is enabled via the enableRNS variable. By default, residual noise suppression is on and the output of the echo canceler (the error signal) is further reduced in level. The residual noise suppression is configured by a 7 element interpolation table. This table operates just like the Table X-Y module with configurable (X, Y) lookup points. The lookup table specifies values in dB for the input and output function.
Type Definition
typedef struct _ModuleSbAECV1
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
INT32 maxTaps; // Maximum length of the filter
INT32 numTaps; // Current length of the filter
FLOAT32 V; // Adaptation constant
FLOAT32 smoothingTime; // Time constant of the smoothing process.
FLOAT32 A; // Smoothing factor
FLOAT32 p0; // Starting value for covariance estimate
INT32 numIter; // Number of iterations of adaptive loop
INT32 enableRNS; // Enable residual noise suppression
INT32 stateIndex; // Circular buffer index. [0 numTaps-1]
INT32 RNS_numPoints; // Number of values in the lookup table. The total table size is [maxPoints 2].
INT32 RNS_order; // Order of the interpolation. This can be either 2 (for linear) or 4 (for pchip).
FLOAT32* WW1; // Adaptive filter coefficients.
FLOAT32* P; // Real estimation error covariance matrix.
FLOAT32* CC; // Complex state variables (previous inputs).
FLOAT32* Pplus; // Intermediate result (real scratch).
FLOAT32* Wplus; // Intermediate result (complex scratch).
FLOAT32* energyC; // Intermediate result (real scratch).
FLOAT32* mu; // Intermediate result (real scratch).
FLOAT32* W2; // Residual noise suppression weights.
FLOAT32* RNS_table; // Lookup table. The first row is the X values and the second row is the Y values.
FLOAT32* RNS_polyCoeffs; // Interpolation coefficients returned by the grid control.
} ModuleSbAECV1Class;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
maxTaps | int | const | 0 | 16 | Unrestricted | samples |
numTaps | int | parameter | 0 | 16 | 1:1:16 | samples |
V | float | const | 0 | 0.5 | Unrestricted | Â |
smoothingTime | float | parameter | 0 | 10 | 0.1:1000 | sec |
A | float | derived | 0 | 1 | 0:1 | Â |
p0 | float | parameter | 0 | 1 | Unrestricted | Â |
numIter | int | parameter | 0 | 1 | 1:20 | Â |
enableRNS | int | parameter | 0 | 1 | 0:1:1 | Â |
stateIndex | int | state | 1 | 0 | Unrestricted | Â |
RNS_numPoints | int | const | 1 | 7 | 4:1:1000 | Â |
RNS_order | int | const | 1 | 2 | 2:2:4 | Â |
WW1 | float* | state | 0 | [16 x 32] | Unrestricted | Â |
P | float* | state | 0 | [16 x 32] | Unrestricted | Â |
CC | float* | state | 0 | [16 x 32] | Unrestricted | Â |
Pplus | float* | state | 0 | [1 x 16] | Unrestricted | Â |
Wplus | float* | state | 0 | [1 x 16] | Unrestricted | Â |
energyC | float* | state | 0 | [16 x 1] | Unrestricted | Â |
mu | float* | state | 0 | [1 x 16] | Unrestricted | Â |
W2 | float* | state | 0 | [32 x 1] | Unrestricted | Â |
RNS_table | float* | parameter | 1 | [2 x 7] | Unrestricted | Â |
RNS_polyCoeffs | float* | state | 1 | [4 x 6] | Unrestricted | Â |
Pins
Input Pins
Name: dataIn
Description: Micro input
Data type: float
Channel range: 1
Block size range: Unrestricted
Sample rate range: Unrestricted
Complex support: Complex
Â
Name: reference
Description: Reference input
Data type: float
Channel range: 1
Block size range: Unrestricted
Sample rate range: Unrestricted
Complex support: Complex
Output Pins
Name: errorSignal
Description: Error signal = difference between filter output and dataIn
Data type: float
MATLAB Usage
File Name: sb_aec_v1_module.m
M = sb_aec_v1_module(NAME, MAXTAPS)
Frequency domain subband echo canceler using a Kalman filter based
algorithm. Arguments:
NAME - name of the module.
MAXTAPS - maximum length of each frequency domain complex adaptive filter
Â