---
title: Online SPM in FxLMS Testbed
url: https://www.emergentmind.com/topics/online-secondary-path-modeling-fxlms-testbed
type: topic
---

# Online SPM in FxLMS Testbed

Online secondary path modeling in the FxLMS testbed targets the concurrent identification of the secondary acoustic path $S(z)$ within adaptive feedforward active noise control (ANC) systems utilizing the filtered-x least mean square (FxLMS) algorithm. Accurate, real-time modeling of the secondary path is critical, as $S(z)$ is necessary to generate the filtered reference for the control filter adaptation. Modern methodologies enable this identification without destabilizing auxiliary noise injection, support time-varying scenarios, and are evaluated on rigorous testbeds under rapid environmental changes [1811.03755, 2306.11408, 2601.13849].

## 1. Problem Definition and Challenges

The key challenge in online secondary path modeling is to estimate the impulse response vector $s = [s(0), ..., s(N_s-1)]^\top$ of $S(z)$ adaptively and concurrently with controller operation, using only the usual reference $r(n)$ and error $e(n)$ signals, and—ideally—without explicit test noise injection. The secondary path estimate $\hat{s}(n)$ must adapt alongside the control filter $w(n)$ while maintaining stability and high noise reduction. Environmental changes (e.g., movement of error microphone or loudspeaker, structural shifts) can cause $S(z)$ to change abruptly, requiring rapid re-identification. Traditional identification approaches degrade ANC performance by requiring additive test noise; modern solutions circumvent this while preserving or enhancing stability and computational efficiency [1811.03755, 2306.11408, 2601.13849].

## 2. Mathematical Formalism

Let $w(n)$ be the control filter of length $N_c$ and $\hat{s}(n)$ the secondary path estimate of length $N_s$. The controller output is $y(n) = w(n)^\top r(n)$, with $r(n) = [r(n), r(n-1), ..., r(n-N_c+1)]^\top$. The true filtered reference is $x(n) = S(z) r(n)$. The adaptation dynamics center on the joint autocorrelation matrix
$$
R = E\{u(n)u(n)^\top\},\quad u(n) = \begin{bmatrix} r(n) \\ x(n) \end{bmatrix} \in \mathbb{R}^{N_c + N_s}
$$
with $R$ in block form:
$$
R = \begin{pmatrix} R_{rr} & R_{rx} \\ R_{xr} & R_{xx} \end{pmatrix}
$$
where typical definitions hold.

The identifiability of $s$ depends on the rank of $R$. For static $w(n)$, $R$ is full rank if and only if $N_c > N_p$ (primary path length). When $N_c \leq N_p$, $x(n)$ is a linear combination of past $r(n)$, causing rank deficiency, hence non-unique solutions. However, when $w(n)$ is time-varying, as in standard adaptive ANC, the continual update of $w(n)$ decorrelates $r(n)$ and $x(n)$ over time, ensuring that $R$ is full rank on average and $s$ remains identifiable even if $N_c \leq N_p$ [1811.03755].

In the modified FxLMS paradigm, key update equations are:
- **Controller update:** $w(n+1) = w(n) + \mu_w e(n) x_f(n)$, with $x_f(n) = [x * \hat{s}](n)$
- **Secondary path model:** $\hat{s}(n+1) = \hat{s}(n) + \mu_s e(n) x(n) / (\|x(n)\|^2 + \delta)$ or, in computation-efficient LMS updating: $\hat{s}(n+1) = \hat{s}(n) - \mu_s y_{\vec{n}} e_s(n)$, where $e_s(n)$ is the inner error quantifying SPM mismatch [2306.11408].

## 3. Algorithmic Strategies and Testbed Realizations

Recent developments converge on algorithmic architectures that avoid explicit additive noise for identification, and/or implement mode-switching strategies to rapidly adapt after path changes. Three prominent methodologies are deployed in testbeds:

### Method 1: Concurrent Adaptation Without Noise Injection
- ANC and secondary path estimates are jointly adapted using normalized LMS (NLMS) or recursive least squares (RLS), taking advantage of the time-variation in $w(n)$ to ensure identifiability [1811.03755].
- Initialization: $w(0)$ is a short impulse, $\hat{s}(0) = 0$.
- Step sizes and filter lengths are empirically chosen (e.g., $N_s = 48$, $N_c \approx 64$, $\mu_w = 0.01$, $\mu_s = 0.002$).
- Monitoring: Real-time error power $E[e^2(n)]$, tracking of $\|\hat{s}(n) - \hat{s}(n-1)\|$.

### Method 2: Computation-Efficient Mode-Switching SPM
- System alternates between adaptive ANC (Mode 1) and SPM (Mode 2).
- Divergence detector triggers SPM mode when reference-to-error power ratio drops below threshold; SPM mode is exited when model error slope stagnates [2306.11408].
- The SPM update cost per sample is $L_s$ multiplies (50% reduction compared to classical dual-filter approaches).
- Efficacy: After a secondary path change, converges in $1.8\pm0.2$ s with steady-state ERLE $41.8\pm0.5$ dB; zero ANC gap on switching. See Table 1.

| Method            | Steady-State ERLE (dB) | SP Remodel Time (s) | ANC Gap (s) |
|-------------------|------------------------|---------------------|-------------|
| Proposed          | 41.8 ± 0.5             | 1.8 ± 0.2           | 0           |
| 5-stage (Pradhan) | 41.3 ± 0.7             | 2.0 ± 0.3           | 0.5 ± 0.1   |
| Akhtar VSS-LMS    | 35.2 ± 1.1             | 1.2 ± 0.1           | 0           |

### Method 3: Meta-Learned Co-Initialization
- Control filter and secondary path model are co-initialized via model-agnostic meta-learning (MAML) trained over a small set of measured paths [2601.13849].
- On detection of abrupt path/environment changes, parameters are reset to their learned initial values for rapid recovery.
- This yields lower early-stage MSE (by 5 dB), 30% faster time-to-target, ~20% less auxiliary-noise energy, and $\sim2$ s recovery time after path switch versus $\sim5$ s baseline.

## 4. Practical Implementation in ANC Testbeds

A typical ANC–FxLMS–OSPM testbed comprises:
- Microphone(s) (error/reference), control loudspeaker, ADCs/DACs, real-time DSP or low-latency real-time PC/FPGA.
- Sampling rates range from 1–48 kHz, with 13–16 kHz common for testbeds [1811.03755, 2306.11408, 2601.13849].
- Filter lengths: $N_c, N_s$ often 48–512 taps, selected based on measured path duration/spectral content.
- Software: MATLAB simulation, dSPACE/Simulink, or custom embedded code.
- Monitoring: Error power, impulse response convergence, real-time visualization of secondary path estimate.

Meta-learning-based initialization employs RWTH Aachen PANDAR database (for in-ear headphones) to meta-train initializations over diverse secondary path scenarios, optimizing for rapid adaptation [2601.13849].

## 5. Performance Evaluation and Representative Results

Testbed results consistently demonstrate that online secondary path modeling without noise injection outperforms additive-noise baselines. For instance [1811.03755]:
- No-noise NLMS reaches $0.06$ RMSE on $\hat{s}$ in $\sim3$ s with $17$ dB ANC attenuation, outperforming additive-noise NLMS (RMSE $0.15$, $16$ dB attenuation).
- Adaptive methods with time-varying $w(n)$ can eliminate the traditional filter length restriction.

Mode-switching and meta-learned initializations reduce recovery time and error power:
- Mode-switching SPM achieves zero ANC downtime during secondary path reidentification [2306.11408].
- MAML-initialized FxLMS recovers target error rates $30\%$ faster using less auxiliary identification energy [2601.13849].

Figures in [1811.03755] and [2306.11408] further illustrate convergence curves, learning curves under path switching, and the evolution of error power.

## 6. Current Trends and Research Directions

Recent focus centers on improving early-stage adaptation and recovery speed after abrupt environmental changes, eliminating additive noise without degrading accuracy, and minimizing computational resources. Meta-learning approaches suggest that transfer of initialization knowledge across environments meaningfully reduces startup and adaptation times. Mode-switching control with computationally efficient SPM is now favored for practical, low-latency ANC devices [2306.11408, 2601.13849]. Investigations into the impact of secondary-path dispersion for meta-learned initializations indicate that task diversity in training promotes robust generalization in unseen acoustic scenarios [2601.13849].

A plausible implication is that future systems will increasingly integrate meta-learned priors and principled divergence detection, dynamically balancing ANC performance and online system identification in highly nonstationary environments.

## 7. Summary Table: Comparison of Approaches

| Approach                    | Noise Injection | ID Trigger/Mode Switch      | Recovery/Adaptation    |
|-----------------------------|----------------|----------------------------|------------------------|
| Classical Additive-Noise    | Yes            | N/A                        | Slower, steady plateau |
| Simultaneous NLMS (No Noise)| No             | N/A                        | Rapid, optimal RMSE    |
| Mode-Switching SPM          | No             | Reference-error ratio, slope| 1.8 s, zero ANC gap    |
| MAML Co-Initialization      | Optional       | Error-jump detector         | ~2 s, low startup MSE  |

All methods above have been implemented in real-time testbeds and validated under both synthetic and measured environmental changes, confirming their applicability to embedded and consumer ANC deployments [1811.03755, 2306.11408, 2601.13849].

Source: https://www.emergentmind.com/topics/online-secondary-path-modeling-fxlms-testbed