Acoustics & DSP Series

7 posts
1
Acoustic Waves & Digital Signal Processing Basics
· 7 min read

Destructive Interference

Active noise cancellation (ANC) builds on a simple physical principle: destructive interference. Two sound waves of the same frequency and opposite phase cancel each other out.

The original noise signal:

$$ p_n(t) = A \cos(2\pi ft + \phi) $$

The anti-noise generated by the ANC system:

$$ p_c(t) = -A \cos(2\pi ft + \phi) = A \cos(2\pi ft + \phi + \pi) $$

Superposition:

$$ p_{\text{total}} = p_n(t) + p_c(t) = 0 $$

2
Adaptive Filtering: From LMS to NLMS
· 9 min read

The LMS Algorithm

The core problem in adaptive filtering is: given a reference signal x(n) and a desired signal d(n), find a filter coefficient vector w such that the output y(n) approximates d(n).

The Least Mean Square (LMS) algorithm is the most classic solution to this problem, proposed by Widrow and Hoff in 1960. The core idea is to take one step down the steepest gradient of the error surface at each iteration — stochastic gradient descent.

3
FXLMS and Active Noise Control System Architecture
· 9 min read

Active Noise Control (ANC) works by generating an acoustic wave with equal amplitude and opposite phase to the incoming noise, canceling it through destructive interference at the target zone. Translating this into hardware requires two decisions: which sensors to use for noise sensing, and what control strategy to apply for anti-noise generation. These two factors define the three canonical ANC architectures: feedforward, feedback, and hybrid.

Feedforward ANC

A feedforward ANC system places a reference microphone upstream of the noise source to capture the disturbance early, feeds it to the DSP, and drives the speaker to produce the anti-noise. An error microphone near the ear monitors the residual noise and feeds it back to the adaptive algorithm for coefficient update.

4
Variable Step Size and Frequency-Domain Adaptive Algorithms
· 7 min read

The Convergence Trade-off of Fixed Step Size

Standard LMS and NLMS algorithms use a fixed step size parameter $\mu$. The choice of step size directly impacts algorithm performance, but a fundamental contradiction exists:

  • Large step size: Fast convergence and quick adaptation to environmental changes, but large steady-state error and low filtering precision
  • Small step size: Small steady-state error and high filtering precision, but slow convergence and sluggish response to abrupt changes

This contradiction is particularly pronounced in applications such as echo cancellation and active noise control — the system needs fast convergence during startup, yet wishes to maintain low error in steady state. A fixed step size cannot satisfy both phases simultaneously.

5
Embedded ANC: STM32 in Practice
· 10 min read

Hardware Architecture

Implementing real-time ANC begins with selecting the right hardware platform. The controller must complete adaptive filtering within microseconds while managing multiple audio data streams.

ModuleFunctionTypical Choice
Main ControllerExecutes adaptive algorithmSTM32F4/F7, ESP32-S3, nRF5340
Reference MicCaptures ambient noiseKnowles SPH0645, Infineon IM69D130
Error MicCaptures residual noiseKnowles SPH0645, TDK ICS-43434
Audio DACOutputs anti-noise signalES9218, PCM5102
AmplifierDrives speakerClass-D

The reference microphone sits outside the earcup and captures external ambient noise as the algorithm’s reference input. The error microphone sits inside the earcup near the speaker, capturing residual noise for evaluating cancellation performance and driving adaptive updates. The audio DAC converts the digital anti-noise signal to analog, which is amplified by a Class-D amplifier to drive the speaker.

6
Embedded ANC: ESP32 Practice
· 8 min read

The ESP32-S3’s dual-core Xtensa LX7 processor with vector instruction set extensions is well-suited for the real-time DSP workloads required by embedded ANC. Combined with the ESP-DSP library, efficient adaptive filtering becomes practical on this platform.

I2S Microphone Capture

ANC requires at least two synchronous input channels: a reference microphone (capturing ambient noise) and an error microphone (capturing residual error). The ESP32-S3 I2S peripheral supports simultaneous multi-channel ADC data reception. Configuring it for 16-bit, 16 kHz sampling suffices for consumer-grade ANC.

7
ANC Tuning & Performance Optimization
· 11 min read

In engineering practice, the most time-consuming and experience-dependent part of an active noise control system is not algorithm selection, but parameter tuning and stability debugging. Filter order, step size, sampling rate — each parameter interacts with the others in ways that are not always obvious. This article draws from hands-on experience to cover the key parameter selection logic and common troubleshooting approaches in ANC tuning.

Filter Order Selection

The FIR filter order $N$ directly determines two core metrics: frequency resolution and computational complexity. Getting this choice wrong reveals itself early in debugging — poor noise reduction, slow convergence, or outright divergence.