Overview
Subband normalized LMS adaptive filter
Discussion
The SbNLMS module implements a subband-based normalized LMS algorithm. There is a separate complex filter within each subband. The module takes 2 single channel inputs: filter input data and reference signal (desired filter output). For every data sample the filter output is compared to the reference signal and this information is used to update the filter taps according to the normalized LMS algorithm. The module always has 2 single channel ouputs: adaptive filter output and error signal, (reference-(filter output)). The array .coeffs holds complex filter coefficients and is of size numTaps x numBins, where numBins is the number of frequency domain bins (or subbands). numBins equals the FFT size / 2 + 1. The coefficients are stored in coeffs in normal order. The state variable array is complex data of size numTaps x numBins, and circular buffer is used within each subband.
...
The constructor argument MUINPUT determines where the adaptation parameter mu is taken from. By default, MUINPUT = 0 and the adaptation parameter is taken from the internal parameter .mu; the same factor is used for all subbands. If MUINPUT = 1, then the module has a 3rd input pin. This pin contains real data of size FFT size / 2 + 1 and each point specifies the mu factor for each subband. This allows external logic to be used when computing mu and allows mu to vary between subbands. When MUINPUT = 1 then the internal paramter .mu is ignored.
Type Definition
Code Block |
---|
typedef struct _ModuleSbNLMS { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure INT32 maxTaps; // Maximum length of the filter INT32 numTaps; // Current length of the filter FLOAT32 mu; // Adaptation constant FLOAT32 offset; // Normalization offset constant INT32 stateIndex; // Index of the oldest state variable in the array of state variables FLOAT32* coeffs; // Coefficient array FLOAT32* state; // State variable array } ModuleSbNLMSClass; |
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
maxTaps | int | const | 0 | 32 | 1:1:5000 | samples |
numTaps | int | parameter | 0 | 32 | 1:1:32 | samples |
mu | float | parameter | 0 | 0.5 | 0:1 | linear |
offset | float | parameter | 0 | 0.001 | 0:0.001 | linear |
stateIndex | int | state | 1 | 0 | Unrestricted | |
coeffs | float* | state | 0 | [32 x 32] | Unrestricted | |
state | float* | state | 1 | [32 x 32] | Unrestricted |
Pins
Input Pins
Name: dataIn
Description: Filter input
...
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: dataOut
Description: Filter output
...
Description: Error signal = difference between filter output and reference input
Data type: float
MATLAB Usage
File Name: sb_nlms_module.m
...