SbMultiAECRNSOut
Overview
Multi-channel frequency domain subband adaptive echo cancellation filter
Discussion
Subband based multi channel echo canceller. This module works in conjunction with the WOLA filterbank modules. The module has two input pins. The first input is a single channel microphone signal while the second is a multi-channel 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.
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
The residual noise calculation gains are stored internally in the W2 state array. W2 is updated every block. If the variable .enableRNS is set, then the output is multiplied by W2.
The module also has an optional output pin that is enabled by the module argument RNSPIN. When this pin exists, the module outputs the RNS weights on the second pin. The RNS output data is real and of dimension 1 x numBins, where numBins is the number of FFT bins.
Type Definition
typedef struct _ModuleSbMultiAECRNSOut
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
INT32 maxTaps; // Maximum length of the filter
INT32 numChans; // Number of channels for AEC
INT32 numXterms; // Number of cross terms for AEC
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 - fixed to 1
INT32 enableRNS; // Enable residual noise suppression
INT32 numChansX2; // Number of channels multiply by 2 for AEC
INT32 numXtermsX2; // Number of cross terms multiply by 2 for AEC
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* Wplus; // Intermediate result (complex scratch).
FLOAT32* P; // Real estimation error covariance matrix.
FLOAT32* PXTerm; // Estimation error covariance matrix - the off-diagonal terms.
FLOAT32* Pplus; // Intermediate result of the diagonals(real scratch).
FLOAT32* PplusXTerm; // Estimation error covariance matrix - the off-diagonal terms.
FLOAT32* PplusXMatrix; // Estimation error covariance matrix temporary storage (complex scratch).
FLOAT32* CC; // Complex state variables (previous inputs).
FLOAT32* corrC; // Stores all the correlation between reference signals per bin and tap - diagonal part. Real number.
FLOAT32* corrCXTerm; // Correlation between ref channels - the off-diagonal terms.
FLOAT32* mu; // Intermediate result (real scratch).
FLOAT32* mumu; // Intermediate result (real scratch).
FLOAT32* muXTerm; // Intermediate result (imag scratch) - the off-diagonal terms.
FLOAT32* mumuXTerm; // Intermediate result (imag scratch) - the off-diagonal terms.
FLOAT32* K; // Intermediate K value (imaginary scratch).
FLOAT32* KK; // Intermediate K value (imaginary 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.
} ModuleSbMultiAECRNSOutClass;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
maxTaps | int | const | 0 | 10 | Unrestricted | samples |
numChans | int | const | 0 | 2 | Unrestricted | Â |
numXterms | int | const | 0 | 1 | Unrestricted | Â |
numTaps | int | parameter | 0 | 10 | 1:1:10 | 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 | const | 0 | 1 | 1:1 | Â |
enableRNS | int | parameter | 0 | 1 | 0:1:1 | Â |
numChansX2 | int | const | 1 | 4 | Unrestricted | Â |
numXtermsX2 | int | const | 1 | 2 | Unrestricted | Â |
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 | [20 x 32] | Unrestricted | Â |
Wplus | float* | state | 0 | [1 x 1] | Unrestricted | Â |
P | float* | state | 0 | [20 x 32] | Unrestricted | Â |
PXTerm | float* | state | 0 | [10 x 32] | Unrestricted | Â |
Pplus | float* | state | 0 | [10 x 1] | Unrestricted | Â |
PplusXTerm | float* | state | 0 | [1 x 1] | Unrestricted | Â |
PplusXMatrix | float* | state | 0 | [8 x 1] | Unrestricted | Â |
CC | float* | state | 0 | [20 x 32] | Unrestricted | Â |
corrC | float* | state | 0 | [20 x 32] | Unrestricted | Â |
corrCXTerm | float* | state | 0 | [10 x 32] | Unrestricted | Â |
mu | float* | state | 0 | [1 x 1] | Unrestricted | Â |
mumu | float* | state | 0 | [20 x 1] | Unrestricted | Â |
muXTerm | float* | state | 0 | [1 x 1] | Unrestricted | Â |
mumuXTerm | float* | state | 0 | [10 x 1] | Unrestricted | Â |
K | float* | state | 0 | [1 x 1] | Unrestricted | Â |
KK | float* | state | 0 | [20 x 1] | Unrestricted | Â |
W2 | float* | state | 0 | [32 x 1] | Unrestricted | Â |
RNS_table | float* | parameter | 0 | [2 x 7] | Unrestricted | Â |
RNS_polyCoeffs | float* | state | 1 | [4 x 6] | Unrestricted | Â |
Pins
Input Pins
Name: dataIn
Description: Microphone 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: 2
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
Â
Name: RNSWeights
Description: Weights from the residual noise suppressor
Data type: float
MATLAB Usage
File Name: sb_multi_aec_rns_out_module.m
M = sb_multi_aec_rns_out_module(NAME, MAXTAPS, NUMCHANS, RNSPIN)
Frequency domain subband multi-channel echo canceler using a Kalman filter based
algorithm. Arguments:
NAME - name of the module.
MAXTAPS - maximum length of each frequency domain complex adaptive filter
NUMCHANS - number of reference channels
RNSPIN - Boolean which specifies that the pin will have a second output pin
containing the RNS data. This wire holds real data of size 1 x numBins.
By default RNSPIN = 0.
Â