Adaptive control

Active noise cancellation algorithms, benchmarks, and implementation notes.

This site documents the single-channel active noise cancellation controllers implemented in the repository, the benchmark workflow used to compare them, and the practical C++ surfaces you use to build on the code.

This repository is an implementation of the TI ANC paper SPRA042, with the algorithms reconstructed and translated into modern C++ from that document.

The implementation spans both broadband feedforward ANC and synchronized narrowband cancellation. The result is a compact codebase that makes it easy to compare FXLMS-family controllers against waveform synthesis, adaptive notch, and multi-tone methods.

Algorithm families

The implemented controllers cover both feedforward broadband methods such as FXLMS and FBFXLMS, and synchronized narrowband methods such as waveform synthesis, adaptive notch, and multi-tone cancellation.

Benchmarking path

The repository includes a CLI benchmark runner plus a Python report generator that emits summary tables, raw CSV traces, and plots suitable for documentation and review.

What The Repository Implements

The implemented controllers are based on the equations, flow, and implementation details described in the TI paper SPRA042, adapted here into a reproducible floating-point benchmark and documentation set.

Category Algorithms Typical use
Broadband feedforward FXLMS, Leaky FXLMS, FBFXLMS General ANC with a causal reference microphone and an identified secondary path
Adaptive IIR Filtered-U RLMS Cases where a recursive control law is worth the added tuning sensitivity
Synchronized periodic Waveform synthesis, adaptive notch, multi-tone Tonal or harmonic disturbances with a stable period or sync relationship
Reference-free periodic Feedback ANC Periodic disturbance cancellation when no reference microphone is available

Common Signal Model

The feedforward controllers share the same physical picture:

The residual follows:

\[e(n) = d(n) + y'(n)\]

That sign convention is why the adaptive updates in this repository use the ANC form rather than the subtractive electrical-noise-canceler form common in basic LMS tutorials.

Secondary-Path Identification Matters

One recurring requirement

Most of the controllers here are only as good as their secondary-path estimate. Before comparing algorithms, identify the actuator-to-error path offline and keep that estimate fixed during cancellation.

The documented workflow is the standard one:

  1. Excite the actuator with white noise.
  2. Measure the error-sensor response.
  3. Adapt a model of the actuator-to-error path with LMS.
  4. Freeze the resulting coefficients and reuse them during ANC adaptation.

Benchmark Snapshot

Primary attenuation across the suite

The benchmark suite mixes matched broadband and narrowband cases so controller fit becomes visible quickly.

Primary benchmark attenuation plot.

Broadband default

FXLMS is the strongest first choice when a clean reference microphone and a usable secondary-path estimate are available.

Narrowband best case

Multi-tone produces the deepest attenuation in the benchmark suite because the disturbance is intentionally a perfect stationary harmonic match.

Most sensitive

FU-RLMS is the most tuning-sensitive controller in the repository because its recursive section can amplify modeling mistakes.

Specialized fallback

Feedback ANC is the practical option when hardware constraints remove the usual reference microphone path.

Code And Workflow Entry Points

Core library

The anc_core library implements the controllers plus the benchmark harness. The controllers live in include/anc and src.

CLI benchmark tool

apps/anc_cli.cpp exposes the benchmark options needed to generate summary CSVs and full time-series outputs.

Tests

The smoke tests in tests validate the core FXLMS path and the cross-algorithm benchmark surface declared in CMake.

Analysis

analysis/run_report.py orchestrates the CLI runs and turns them into the plots embedded throughout this site.

Where To Go Next

Choose an algorithm

Read the per-algorithm pages for equations, benchmark interpretation, and controller-specific C++ snippets.

Open the algorithm guide

Compare tradeoffs

Use the comparison page when you need to select between broadband, feedback-aware, tonal, and reference-free strategies.

Read the comparison