A compact, reproducible implementation of adaptive filtering algorithms for finite impulse response system identification.
The package implements:
- Least mean squares (
LMS) - Normalized least mean squares (
NLMS) - Affine projection algorithm (
APA) - Steepest descent on diagonalized quadratic cost surfaces
For an input vector LMS update is
NLMS normalizes the update by the instantaneous input power:
APA uses the most recent
- A shared, validated API for all adaptive filters
- Deterministic experiments using fixed random seeds
- Full coefficient histories for convergence analysis
- Numerical regularization for
NLMSandAPA - Explicit stability validation for quadratic steepest descent
- Automated tests for convergence, invalid inputs, determinism, and zero-energy signals
- No plotting, notebook, or proprietary MATLAB dependency in the core package
.
├── examples/
│ └── steepest_descent.py
├── src/adaptive_filters/
│ ├── benchmark.py
│ ├── filters.py
│ └── steepest_descent.py
├── tests/
│ ├── test_filters.py
│ └── test_steepest_descent.py
└── pyproject.toml
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -e .
python3 -m unittest discover -s tests -v
adaptive-filter-benchmarkThe benchmark identifies the unknown system
The default benchmark uses
| Algorithm | Coefficient error |
Final-window MSE |
|---|---|---|
LMS |
||
NLMS |
||
APA |
Run the benchmark with another seed:
adaptive-filter-benchmark --seed 42 --output results/seed-42.jsonThe automated validation assumes a real-valued, time-invariant unknown FIR
system, finite one-dimensional inputs, and additive zero-mean noise. The
benchmark evaluates coefficient recovery and steady-state mean-square error;
it is not a universal ranking of the algorithms.