A MATLAB Adaptive Filtering Toolbox

Research and development of adaptive filters rely heavily on Monte Carlo simulations to assess their performances and designs. These ensemble average experiments, however, rapidly become time consuming, especially in the ubiquitous MATLAB environment. This toolbox provides an intuitive interface to vectorized adaptive algorithms implementations that are up to 10 times faster than commonly used (loop) implementations with no loss in accuracy. These algorithms include LMS, NLMS, RLS, convex/affine combinations... A simulation template eases experimental setup and examples are provided for each adaptive filter.


The AF toolbox purpose is two-fold: (i) accelerate simulations and (ii) reduce the time and effort to test an idea. The first goal is achieved by vectorized implementations of adaptive algorithms, which compute faster in MATLAB. The second objective is the principle behind rapid prototyping. The AF toolbox provides a simulation template that can significantly reduce the time between idealization, implementation, and test. Furthermore, vectorized auxiliary functions to compute commonly used quantities are available, facilitating the vectorized coding of new adaptive algorithms.


The example code below shows the simplicity of simulation codes using the AF Toolbox. Moreover, it will run in less than 0.5 seconds!
Check out our benchmarks or download the AF Toolbox and try it!

% Problem setup
M = 10;                    % Filter length
wo = ones(M,1)/sqrt(M);    % System model
var_u = 1;                 % Input variance
var_v = 1e-3;              % Noise variance
ITER = 3000;               % Number of iterations
REAL = 200;                % Number of realizations

% Initializations
ur = sqrt(var_u)*randn(REAL,M);
w1 = zeros(M,REAL);
mse1 = zeros(1,ITER);

% Simulation
for i = 1:ITER
    % Update inputs
    u = sqrt(var_u)*randn(REAL,1);
    v = sqrt(var_v)*randn(REAL,1);
    ur = [u ur(:,1:end-1)];
    d = y(ur,wo) + v;

    % Evaluate a priori errors
    mse1(i) = msea(d, ur, w1);

    % Update coefficients
    w1 = lmsa(0.07, d, ur, w1);

% Plots
afplot('mse', mse1);


People have been running simulations 8.6 times faster* with the AF Toolbox!

* Average of 5 users and all AFs.

AFTBX v1.0b

In the package:
  • core functions (AFs);
  • auxiliary functions;
  • template for rapid prototyping;
  • test, benchmark, and example codes;
  • User's Guide.
Provided under the permissive MIT License.


  • send us your benchmark results and computer configuration: they will be used to guide future releases
  • contribute vectorized implementation of your adaptive algorithms
  • recommend and acknowledge the use of AFTBX
  • comment, ask for features, and send us your opinion about the toolbox