Adaptive Noise Cancellation: LMS, NLMS and RLS Explained

Background noise is rarely constant.

A microphone may encounter changing fan noise, vehicle noise, machinery, keyboard sounds, vibration, or other interference. When the noise characteristics change over time, a fixed noise-reduction filter may not be sufficient.

Adaptive noise cancellation addresses this problem by continuously adjusting the filter according to the incoming signal.

Instead of using a fixed set of coefficients, an adaptive filter learns the characteristics of the unwanted signal and updates its coefficients in real time.

Three classical adaptive-filter algorithms are particularly important in audio signal processing:

  • LMS — Least Mean Squares
  • NLMS — Normalized Least Mean Squares
  • RLS — Recursive Least Squares

These algorithms form an important foundation for modern audio DSP and remain relevant to applications such as acoustic echo cancellation, active noise control, microphone systems, speech enhancement, and multi-microphone audio processing.

1. What Is Adaptive Noise Cancellation?

Adaptive noise cancellation is a signal-processing technique that estimates unwanted noise using an adaptive filter and subtracts the estimated noise from the primary signal.

A simplified system can be represented as:

Primary Signal + Noise → Adaptive Filter → Noise Estimate → Subtraction → Enhanced Signal

The key difference from conventional fixed filtering is that the filter coefficients change continuously.

A simplified signal model is:

d(n) = s(n) + v(n)

where:

  • d(n) = microphone signal
  • s(n) = desired signal
  • v(n) = unwanted noise

The objective is to estimate the unwanted component and produce:

e(n) = d(n) − ŷ(n)

where:

  • ŷ(n) = estimated interference
  • e(n) = error or enhanced signal

The adaptive algorithm adjusts the filter so that the error signal becomes as close as possible to the desired signal.

2. Why Is an Adaptive Filter Needed?

Traditional filters are usually designed around known frequency characteristics.

For example:

  • Low-pass filter
  • High-pass filter
  • Band-pass filter
  • Notch filter

These approaches work well when the unwanted signal occupies a predictable frequency range.

However, real-world noise often overlaps the frequency range of speech.

For example, human speech and:

  • Air-conditioning noise
  • Vehicle noise
  • Machinery
  • Fans
  • Other voices

may occupy overlapping frequency bands.

A fixed filter cannot simply remove those frequencies without also affecting the desired speech.

Adaptive filtering takes a different approach.

It continuously estimates the changing interference and updates its response.

3. Basic Adaptive Noise Cancellation Architecture

A classic adaptive noise cancellation system uses two inputs.

Primary input

The primary microphone captures:

Desired Signal + Noise

Reference input

A reference sensor captures a signal that is correlated with the unwanted noise.

The reference does not necessarily need to contain the desired speech.

The system then looks like:

Reference Noise

Adaptive Filter

Estimated Noise

Subtract from Primary Input

Enhanced Output

Mathematically:

d(n) = s(n) + v(n)

and:

y(n) = wᵀ(n)x(n)

where:

  • x(n) = reference input vector
  • w(n) = adaptive filter coefficient vector
  • y(n) = estimated noise

The output is:

e(n) = d(n) − y(n)

The algorithm continuously updates w(n).

4. The Most Important Requirement: A Reference Signal

This is one of the most important concepts in adaptive noise cancellation.

An adaptive filter normally needs information that is correlated with the unwanted interference.

For example, imagine a device containing:

  • A microphone
  • A loudspeaker
  • A cooling fan

If the fan produces a measurable acoustic signal, another sensor or microphone can potentially provide a reference correlated with that fan noise.

The adaptive filter can then learn the relationship between:

Reference Noise → Noise at Primary Microphone

and estimate the unwanted component.

This is different from simply estimating a noise spectrum from silent periods.

5. LMS: Least Mean Squares Algorithm

The LMS algorithm is one of the most widely known adaptive filtering algorithms.

Its popularity comes from its relatively simple implementation and low computational requirements.

The basic LMS update can be written as:

w(n+1) = w(n) + μe(n)x(n)

where:

  • w(n) = current filter coefficients
  • μ = step size
  • e(n) = error signal
  • x(n) = reference input vector

The error is:

e(n) = d(n) − wᵀ(n)x(n)

The algorithm therefore follows a simple loop:

Input → Filter → Output → Error → Coefficient Update

The filter continuously modifies its coefficients according to the error.

6. How LMS Learns

Imagine that the adaptive filter initially has incorrect coefficients.

The estimated noise will therefore be inaccurate.

The error signal will contain:

Desired Signal + Residual Noise

The LMS algorithm uses this error to adjust the filter coefficients.

If the adjustment moves the estimated noise closer to the actual interference, the error becomes smaller.

Over time, the filter attempts to minimize the mean-square error:

J = E[e²(n)]

This is the central idea behind the Least Mean Squares algorithm.

7. LMS Step Size

The parameter μ controls how quickly the LMS filter adapts.

This creates an important engineering tradeoff.

Small μ

Advantages:

  • More stable adaptation
  • Lower coefficient fluctuation
  • Better steady-state behavior

Disadvantages:

  • Slow response to changing noise

Large μ

Advantages:

  • Faster adaptation
  • Better response to rapidly changing conditions

Disadvantages:

  • Greater risk of instability
  • Larger residual error
  • Potential audible artifacts

Therefore:

The LMS step size must be selected according to the signal characteristics and system requirements.

For a normalized LMS implementation, the stability relationship is also affected by the reference signal power.

8. LMS Algorithm: Conceptual Example

Suppose a microphone captures speech together with a periodic machine noise.

The reference microphone captures a correlated version of the machine noise.

Initially:

Filter Error → High

As the adaptive filter learns:

Filter Error → Lower

After convergence:

Estimated Noise ≈ Actual Noise

and therefore:

Output ≈ Speech + Residual Noise

If the machine operating condition changes, the LMS algorithm continues updating its coefficients.

This ability to track changing conditions is the main advantage of adaptive filtering.

9. NLMS: Normalized Least Mean Squares

The standard LMS algorithm can be sensitive to the amplitude of the reference signal.

If the reference signal becomes very large, the update term:

μe(n)x(n)

can also become large.

The Normalized Least Mean Squares (NLMS) algorithm addresses this by normalizing the update according to the reference-signal energy.

A common form is:

w(n+1) = w(n) + [μ / (ε + ||x(n)||²)] e(n)x(n)

where:

  • μ = normalized step size
  • ε = small positive constant used to avoid division by zero
  • ||x(n)||² = reference signal energy

This normalization makes the adaptation less sensitive to changes in input amplitude.

10. Why NLMS Is Important in Audio Systems

Audio levels can vary significantly.

A microphone reference signal may change because of:

  • Speaker distance
  • Volume changes
  • Mechanical movement
  • Environmental noise
  • Different acoustic conditions

A conventional LMS implementation may need careful step-size tuning.

NLMS automatically accounts for the approximate energy of the reference signal.

This often makes it a practical choice for real-time audio applications.

11. LMS vs. NLMS

FeatureLMSNLMS
Algorithm complexityLowLow to moderate
NormalizationNoYes
Input amplitude sensitivityHigherLower
Parameter tuningRelatively sensitiveGenerally easier
Real-time implementationVery practicalVery practical
Audio applicationsCommonVery common
Computational costLowerSlightly higher

For many embedded audio systems, NLMS provides a useful balance between simplicity, stability, and adaptation performance.

12. RLS: Recursive Least Squares

The Recursive Least Squares (RLS) algorithm takes a different approach.

Instead of simply following the instantaneous gradient of the error, RLS recursively minimizes a weighted sum of past squared errors.

The objective can be expressed conceptually as:

J(n) = Σ λⁿ⁻ⁱ e²(i)

where:

  • λ = forgetting factor
  • e(i) = error at previous time i

The forgetting factor determines how strongly older observations influence the current solution.

A value closer to 1 gives greater weight to historical data.

A smaller value allows the system to adapt more quickly to changes.

13. Why RLS Can Adapt Faster

LMS and NLMS are gradient-based methods.

They gradually move the filter coefficients toward the optimum.

RLS uses information from the signal correlation structure to estimate a better coefficient update.

As a result, RLS can converge much faster under many conditions.

This can be useful when:

  • Noise characteristics change rapidly
  • Fast convergence is important
  • The system has sufficient processing resources

However, this performance comes with greater computational complexity.

14. LMS vs. NLMS vs. RLS

The three algorithms can be viewed as a practical engineering tradeoff.

CharacteristicLMSNLMSRLS
Implementation complexityLowLow–ModerateHigh
Computational costLowLow–ModerateHigh
Convergence speedModerateModerate–FastFast
Input normalizationNoYesBuilt into formulation
Memory requirementsLowLowHigher
Parameter sensitivityModerateModerateModerate–High
Embedded DSP suitabilityExcellentExcellentApplication-dependent
Fast-changing conditionsLimitedBetterStrong
Typical useBasic adaptive filteringAudio/AECAdvanced adaptive systems

There is no universal “best” algorithm.

The appropriate choice depends on:

  • Processing power
  • Memory
  • Sampling rate
  • Filter length
  • Required convergence speed
  • Noise characteristics
  • Power consumption
  • Latency requirements

15. Adaptive Noise Cancellation vs. Spectral Noise Reduction

Adaptive filtering and spectral filtering solve related but different problems.

Spectral methods

Examples:

  • Spectral subtraction
  • Wiener filtering

They analyze the frequency content of the signal and modify frequency-dependent gain.

Adaptive filtering

Examples:

  • LMS
  • NLMS
  • RLS

They estimate the relationship between signals and continuously update filter coefficients.

TechnologyMain Information Used
Spectral subtractionSignal/noise spectrum
Wiener filteringSignal/noise power and SNR
LMSReference signal + error
NLMSReference signal + normalized error
RLSReference signal + historical error statistics
BeamformingMulti-microphone spatial information

These techniques can also be combined.

16. Adaptive Filtering and Acoustic Echo Cancellation

One of the most important applications of adaptive filtering is Acoustic Echo Cancellation (AEC).

Consider a conference device.

The loudspeaker plays:

Far-End Voice

The microphone receives:

Near-End Speech + Far-End Echo + Background Noise

The system can use the far-end playback signal as a reference.

The adaptive filter models the acoustic path:

Speaker → Room → Microphone

It then estimates the echo:

Estimated Echo

and subtracts it from the microphone signal.

A simplified architecture is:

Far-End Reference

Adaptive Filter

Echo Estimate

Subtract from Microphone Input

Near-End Speech

This is why LMS and especially NLMS-type adaptive filtering concepts are highly relevant to conferencing and voice communication systems.

17. Why Microphone and Speaker Placement Matters

An adaptive algorithm cannot completely compensate for poor acoustic design.

The acoustic path between speaker and microphone depends on:

  • Physical distance
  • Device enclosure
  • Room reflections
  • Speaker direction
  • Microphone direction
  • Mechanical vibration
  • Internal acoustic leakage

For microphone-array products, acoustic design therefore remains critical.

For example, SISTC microphone-array documentation recommends considering the relative positions of the microphone, speaker, and cooling fan because the product structure directly affects microphone pickup and echo/noise-processing performance.

This illustrates an important engineering principle:

Adaptive DSP should be designed together with microphone placement and acoustic structure, not treated as a software-only problem.

18. Adaptive Noise Cancellation with MEMS Microphones

Modern MEMS microphones are increasingly used in multi-microphone systems.

A typical architecture may include:

MEMS Microphone 1

→ Primary Audio

MEMS Microphone 2

→ Reference / Spatial Information

Adaptive DSP

Enhanced Speech

With more microphones, the system can obtain additional information about:

  • Noise direction
  • Target direction
  • Spatial correlation
  • Reverberation
  • Acoustic interference

This creates opportunities to combine adaptive filtering with microphone-array processing.

19. Adaptive Filtering in Microphone Arrays

A microphone array can provide multiple synchronized channels.

For example:

Mic 1 → Channel 1

Mic 2 → Channel 2

Mic 3 → Channel 3

Mic 4 → Channel 4

The signals can then be processed jointly.

An actual SISTC digital microphone-array design uses synchronized multi-channel microphone inputs and provides array signal-processing functions including noise suppression and signal enhancement.

This type of architecture provides a foundation for more advanced processing such as:

  • Beamforming
  • Direction-of-arrival estimation
  • Adaptive filtering
  • Noise suppression
  • Speech enhancement
  • Acoustic echo cancellation

20. LMS for a Microphone Array

A simple multi-channel adaptive system can use one adaptive filter per microphone channel.

For example:

Reference Signal

LMS Filter 1 → Mic 1 Estimate

LMS Filter 2 → Mic 2 Estimate

LMS Filter 3 → Mic 3 Estimate

LMS Filter 4 → Mic 4 Estimate

The resulting signals can then be combined.

More advanced architectures can instead use a vector or matrix formulation to jointly process all microphone channels.

This is where adaptive filtering begins to overlap with advanced beamforming and multi-channel signal processing.

21. The Importance of Channel Synchronization

Multi-microphone adaptive processing requires accurate timing relationships between channels.

If microphone channels are not synchronized correctly, the system may have difficulty modeling:

  • Phase relationships
  • Time delays
  • Spatial information
  • Acoustic paths

This is particularly important for:

  • Beamforming
  • Direction estimation
  • Multi-channel AEC
  • Adaptive array processing

For this reason, synchronized multi-channel acquisition is an important hardware consideration for microphone-array systems.

22. Real-Time Adaptive Noise Cancellation

Adaptive filters are well suited to real-time systems because they update continuously as audio samples arrive.

A typical real-time loop is:

Acquire Sample

Read Reference

Calculate Filter Output

Calculate Error

Update Coefficients

Output Enhanced Audio

Repeat

The processing must finish before the next audio block arrives.

Otherwise, the system introduces:

  • Buffer underruns
  • Audio dropouts
  • Increased latency

Therefore, algorithm design and hardware selection must be considered together.

23. Filter Length

The adaptive filter length is another important parameter.

A short filter requires:

  • Less computation
  • Less memory
  • Faster processing

But it may not be able to model a long or complex acoustic path.

A longer filter can model more complex relationships but requires more resources.

This is especially important for AEC because the acoustic impulse response of a room can contain many reflections.

The correct filter length therefore depends on:

  • Sampling rate
  • Acoustic path
  • Room characteristics
  • Device geometry
  • Required performance

24. Convergence vs. Tracking

Adaptive filtering always involves a tradeoff between:

Convergence speed

and

Steady-state accuracy

A filter that adapts very slowly may not follow changing noise.

A filter that adapts too aggressively may introduce instability or excessive coefficient fluctuations.

For LMS and NLMS, the step size is a major control parameter.

For RLS, the forgetting factor plays an important role.

A practical design should therefore evaluate both:

  1. How quickly the filter adapts
  2. How stable the output becomes after convergence

25. Common Problems in Adaptive Noise Cancellation

Problem 1: Poor reference signal

If the reference microphone does not capture a signal correlated with the unwanted noise, the adaptive filter has limited information to work with.

Problem 2: Reference contains the desired speech

If the reference microphone also captures significant target speech, the algorithm may partially cancel the desired signal.

This can cause speech distortion.

Problem 3: Incorrect step size

An overly large LMS/NLMS step size can cause unstable or noisy adaptation.

An overly small step size can make the system respond too slowly.

Problem 4: Acoustic path changes too quickly

If the acoustic environment changes faster than the adaptive filter can track, the filter may temporarily become inaccurate.

Problem 5: Nonlinear distortion

Many basic adaptive filters assume approximately linear signal relationships.

Real acoustic systems can contain nonlinearities from:

  • Loudspeakers
  • Amplifiers
  • Enclosures
  • Microphone interfaces

Additional nonlinear processing may therefore be required.

26. LMS, NLMS and RLS in Embedded Systems

When implementing adaptive filtering on embedded hardware, engineers need to consider more than algorithmic accuracy.

Important factors include:

CPU load

Higher-order algorithms require more calculations.

Memory

Filter coefficients and historical samples must be stored.

Power consumption

This is especially important in battery-powered products.

Latency

The algorithm must operate within the system’s real-time budget.

Fixed-point vs. floating-point

Some embedded platforms favor fixed-point arithmetic, while others provide efficient floating-point processing.

Sampling rate

Higher sampling rates increase the number of samples processed per second.

Number of microphone channels

Processing complexity increases significantly as the number of channels grows.


27. Practical Algorithm Selection

A simplified selection process can be useful.

Choose LMS when:

  • Low computational complexity is important
  • The environment changes relatively slowly
  • The system has limited processing resources
  • A simple adaptive filter is sufficient

Choose NLMS when:

  • Input amplitude varies
  • More robust adaptation is needed
  • Real-time audio processing is required
  • A good balance between complexity and performance is desired

Consider RLS when:

  • Fast convergence is important
  • The acoustic environment changes significantly
  • Processing resources are available
  • Higher algorithm complexity is acceptable

These are general engineering guidelines rather than absolute rules.


28. A Simplified NLMS Implementation

The following example demonstrates the basic structure of an NLMS adaptive filter.

import numpy as np

def nlms(primary, reference, filter_length=128,
         mu=0.5, epsilon=1e-8):

    weights = np.zeros(filter_length)
    output = np.zeros(len(primary))

    reference_buffer = np.zeros(filter_length)

    for n in range(len(primary)):

        reference_buffer[1:] = reference_buffer[:-1]
        reference_buffer[0] = reference[n]

        # Estimate unwanted component
        estimated_noise = np.dot(weights, reference_buffer)

        # Error / enhanced signal
        error = primary[n] - estimated_noise

        output[n] = error

        # NLMS coefficient update
        power = np.dot(
            reference_buffer,
            reference_buffer
        )

        weights += (
            mu * error * reference_buffer
            / (epsilon + power)
        )

    return output

This example is intended to demonstrate the algorithmic structure.

A production audio implementation would require additional considerations such as:

  • Numerical stability
  • Input scaling
  • DC offset handling
  • Filter initialization
  • Double-talk detection for AEC
  • Voice activity detection
  • Buffer processing
  • Fixed-point optimization
  • Real-time scheduling

29. Adaptive Noise Cancellation and AI

Adaptive filtering and AI-based audio enhancement are not necessarily competing technologies.

They can serve different purposes.

For example:

MEMS Microphone Array

Beamforming

Adaptive Filtering / AEC

AI Speech Enhancement

Voice Recognition

In this architecture, adaptive DSP can handle predictable signal relationships while AI processes more complex residual interference.

This hybrid approach is particularly relevant to modern voice-interface systems.

30. Why Classical Adaptive Filtering Still Matters

With the rapid development of AI audio processing, it may appear that traditional algorithms such as LMS and RLS are becoming obsolete.

They are not.

Adaptive filtering remains valuable because it offers:

  • Low latency
  • Predictable computational requirements
  • Real-time operation
  • Mathematical interpretability
  • Efficient embedded implementation
  • Continuous adaptation
  • Strong suitability for AEC and control applications

AI models can provide powerful nonlinear signal separation, but classical DSP remains an important part of many practical audio architectures.

31. Adaptive Noise Cancellation in Modern Audio Products

A modern audio product may contain several processing layers:

Hardware Layer

MEMS Microphones

Acquisition Layer

Synchronized Multi-Channel Audio

Spatial Processing

Beamforming / Direction Estimation

Adaptive Processing

AEC / LMS / NLMS / RLS

Spectral Processing

Wiener Filtering / Noise Suppression

AI Processing

Neural Speech Enhancement

Application

Voice Recognition / Communication / Recording

This layered architecture highlights an important point:

No single noise-reduction algorithm is universally sufficient for every acoustic environment.

The best system architecture depends on the interaction between the microphone hardware, acoustic structure, DSP algorithms, AI models, and application requirements.

32. Adaptive Noise Cancellation vs. Active Noise Cancellation

These two terms are sometimes confused.

Adaptive Noise Cancellation

Usually refers to a signal-processing technique in which an adaptive filter estimates and suppresses an unwanted signal.

It can be used in:

  • Voice communication
  • AEC
  • Microphone systems
  • Signal enhancement

Active Noise Cancellation

Usually refers to generating an acoustic signal that destructively interferes with unwanted sound.

Typical examples include:

  • Headphones
  • Earbuds
  • Vehicle cabins

Although both may use adaptive filtering, their system architectures and objectives are different.

This distinction is important when discussing audio products and engineering specifications.

33. Practical Design Checklist

When designing an adaptive noise cancellation system, engineers should evaluate:

Signal architecture

  • What is the primary signal?
  • What is the reference signal?
  • Is the reference correlated with the unwanted noise?

Algorithm

  • LMS?
  • NLMS?
  • RLS?
  • Multi-channel adaptive filtering?

Acoustic design

  • Microphone location
  • Speaker location
  • Mechanical isolation
  • Acoustic leakage
  • Reverberation

Processing

  • Sampling rate
  • Filter length
  • Block size
  • CPU load
  • Memory
  • Latency

Audio quality

  • Noise attenuation
  • Speech preservation
  • Residual noise
  • Convergence behavior
  • Audible artifacts

System integration

  • MEMS microphone performance
  • ADC / digital microphone interface
  • DSP
  • AI processor
  • Communication interface

This system-level evaluation is usually more meaningful than comparing algorithms by name alone.

34. Frequently Asked Questions

What is adaptive noise cancellation?

Adaptive noise cancellation is a signal-processing technique that continuously adjusts a filter to estimate and suppress unwanted interference.

What is the LMS algorithm?

LMS, or Least Mean Squares, is a gradient-based adaptive filtering algorithm that updates filter coefficients to minimize the mean-square error between the desired and estimated signals.

What is NLMS?

NLMS, or Normalized Least Mean Squares, is an improved LMS approach that normalizes the coefficient update according to the energy of the reference signal.

What is RLS?

RLS, or Recursive Least Squares, is an adaptive filtering algorithm that recursively minimizes a weighted history of squared errors. It generally converges faster than LMS-type methods but requires more computational resources.

Is NLMS better than LMS?

Neither is universally better. NLMS is generally less sensitive to changes in reference-signal amplitude, while LMS has a simpler update rule and lower computational overhead.

Is RLS better than NLMS?

RLS can converge faster in many situations, but it has substantially higher computational and memory requirements. For resource-constrained embedded audio systems, NLMS may be more practical.

Can LMS be used for acoustic echo cancellation?

Yes. Adaptive filtering is a fundamental technique in acoustic echo cancellation, where a known far-end playback signal can be used as a reference for estimating the acoustic echo path.

Can adaptive noise cancellation work with MEMS microphones?

Yes. MEMS microphones can provide the primary and reference signals required by adaptive filtering systems. Multi-microphone systems can also provide additional spatial information for more advanced processing.

Can adaptive filtering and AI noise reduction be used together?

Yes. Adaptive filtering can handle predictable or correlated interference, while AI models can address more complex residual noise and speech enhancement tasks.

Conclusion

Adaptive noise cancellation is one of the fundamental technologies in real-time audio DSP.

The three classical algorithms—LMS, NLMS, and RLS—provide different tradeoffs between:

  • Computational complexity
  • Convergence speed
  • Stability
  • Memory requirements
  • Adaptation capability

LMS provides a simple foundation.

NLMS improves robustness to changes in input signal power and is particularly useful in many practical audio systems.

RLS provides faster adaptation at the cost of significantly greater computational complexity.

In real-world audio products, however, the algorithm is only one part of the solution.

High-quality adaptive audio processing depends on the complete signal chain:

MEMS Microphone → Acoustic Design → Synchronized Audio Capture → Adaptive DSP → Noise Reduction → AI Enhancement → Application

For microphone arrays and professional audio systems, combining multi-channel microphone hardware, beamforming, adaptive filtering, spectral noise reduction, and AI can provide a much more flexible foundation for challenging acoustic environments.

The next step in this technical series is to examine Wavelet Denoising for Audio Signals, which approaches noise reduction from a different perspective by analyzing signals across multiple time-frequency scales.

滚动至顶部
SILICON SOURCE
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.