Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Scroll Documents: Update page title prefix

Overview

Subband normalized LMS adaptive filter

Discussion

The SbNLMSV3 module implements a subband-based normalized LMS algorithm. This module is identical to v2 except for a clarification of the names of the input and output signals. NLMS, when used as an Acoustic Echo Canceller, should use the "desired" signal for the mic input, and the "input" signal for the AEC reference. The pin locations have been swapped to match those of other sb aec modules. There is a separate complex filter within each subband. The module takes 2 single channel inputs: A desired signal and an input to be filtered so that can match the desired signal. For an AEC application, the reference signal goes to input, and the mic signal goes to desired. For every data sample the filtered output is compared to the desired 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, (desired-(filter output)). The error signal is the output for an AEC system, while the filtered output is ignored. 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 _ModuleSbNLMSV3
{
    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
    FLOAT32* W;                                   // Weighted error from last iteration
} ModuleSbNLMSV3Class;

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

W

float*

state

1

[32 x 1]

Unrestricted

Pins

Input Pins

Name: desired

Description: Desired signal at filtered output

...

Sample rate range: Unrestricted

Complex support: Complex

Output Pins

Name: output

Description: Output of adaptive filtered input

...

Description: Error signal = difference between filtered output and desired signal (AEC output)

Data type: float

MATLAB Usage

File Name: sb_nlms_v3_module.m

...