Education

Echo Cancellation: How AEC Works and How to Set It Up

Acoustic echo cancellation is one of the most technically demanding audio processing tasks in conferencing system design. Unlike equalization or dynamics processing — where the algorithm applies a fixed or slowly-changing transform to the signal — AEC must continuously model a changing, unpredictable physical environment and subtract its effects from the microphone signal in real time.

The Echo Problem in Detail

When a remote participant's voice plays through the room loudspeaker, that sound travels through the air, reflects off walls and surfaces, and eventually reaches the room's microphone capsule. This acoustic path introduces delay (typically 5-50 ms for a conference room) and coloration (frequency-dependent absorption and reflection from room surfaces). The microphone signal is the sum of the desired near-end speech and this unwanted loudspeaker echo.

Without cancellation, the remote participant hears their own voice returned to them at their audio output — delayed by the round-trip network latency plus the acoustic propagation time. This echo is disorienting and makes natural conversation impossible. In large rooms with high reverberation, the echo tail extends hundreds of milliseconds, compounding the problem.

The Adaptive Filter Model

AEC models the acoustic path from loudspeaker to microphone as a finite impulse response (FIR) filter — a sequence of coefficients representing the room impulse response. If the filter model perfectly matched the true acoustic path, convolving the loudspeaker signal (reference) with the filter would produce an exact replica of the echo component in the microphone signal. Subtracting this replica from the microphone input would leave only the near-end speech.

The challenge: the acoustic path changes continuously as people move, doors open, HVAC airflow shifts, and room temperature changes. The filter coefficients must adapt in real time to track these changes.

NLMS (Normalized Least Mean Squares) is the standard adaptive algorithm used in AEC. At each sample, NLMS adjusts the filter coefficients in the direction that reduces the error (residual echo) between the predicted echo and the actual microphone signal, normalized by the power of the reference signal.

Step size tradeoffs: Higher step size = faster adaptation to room changes, but more susceptibility to double-talk errors. Lower step size = more stable filter, slower adaptation, better double-talk performance. Many AEC processors use variable step size algorithms that increase adaptation speed during single-talk periods and reduce it during double-talk.

Tail Length and RT60

The tail length (filter length) of the adaptive filter determines how much of the room's echo the AEC can cancel. The filter must have enough coefficients to span the echo for as long as it is loud enough to hear, including late reflections.

That is usually shorter than the room's full RT60, which measures a 60 dB decay. More reverberant rooms need longer tails. Large, very reverberant spaces push the boundary of what practical AEC can handle.

Computational cost: FIR filter computation scales linearly with tail length. A 500 ms filter at 48 kHz sampling rate has 24,000 coefficients. This is multiplied by the number of microphone channels. Many modern professional DSPs implement AEC using FFT-based frequency-domain processing, which reduces computational cost significantly.

Non-Linear Processing (NLP)

After the adaptive filter subtracts the predicted echo, residual echo remains due to imperfect filter convergence, non-linear acoustic effects, and model mismatch. Non-Linear Processing (NLP) is a second-stage suppressor that reduces this residual.

NLP estimates the residual echo level by comparing the filter's prediction accuracy against the actual microphone signal. It applies gain reduction during remote-talker-only periods, when the near-end signal is presumed to be mostly residual echo rather than speech.

NLP aggressiveness tradeoffs: Higher NLP aggressiveness eliminates more residual echo but risks clipping soft near-end speech that the filter misidentified as echo. Lower aggressiveness sounds more natural but may leave perceptible echo in very reverberant rooms. Calibrating NLP aggressiveness for each room is part of AEC commissioning.

Double-Talk Detection

Double-talk — simultaneous near-end and far-end speech — is the most difficult condition for AEC. During double-talk:

  • The microphone signal contains both near-end speech and far-end echo superimposed
  • The NLMS algorithm cannot distinguish which component is "error" to minimize
  • If the filter adapts during double-talk, it corrupts its model by treating near-end speech as echo

Double-talk detectors use various approaches:

  • Cross-correlation: If the microphone signal is highly correlated with the reference (loudspeaker), echo is dominant. If correlation drops, near-end speech has entered.
  • Power ratio: If near-end microphone power exceeds a threshold relative to reference power, near-end speech is likely active.
  • Geigel algorithm: Compares maximum of reference signal over a window with microphone signal level — simple and fast, though less accurate than correlation methods.

During detected double-talk, the NLMS step size is reduced to near-zero, freezing filter adaptation. Systems with poor double-talk detection either suppress near-end speech or fail to converge after double-talk periods.

Hardware vs. Software AEC: Implementation Differences

Purpose-built hardware AEC (Biamp Tesira, QSC Q-SYS, Shure IntelliMix P300):

  • Dedicated processing hardware with deterministic timing
  • Filter tail lengths in the hundreds of milliseconds (check the maker's spec)
  • AEC reference signal carried inside the processor, so its timing is predictable
  • Optimized for extended operation in fixed rooms
  • QSC Q-SYS and Biamp allow integration of beamforming mic outputs directly into the AEC input

Software AEC in conferencing clients (Teams, Zoom, Webex):

  • Runs on general-purpose CPU with variable latency
  • Quality varies across platforms and computers

The double AEC problem: When hardware AEC and software AEC both run on the same audio path, the second stage works on a signal the first has already processed. The result can be clipping, distortion, and dropped speech — particularly during double-talk. Where the conferencing client allows it, disable software AEC when hardware DSP AEC is in the signal chain. Some DSPs can also present themselves to the computer over USB as an echo-cancelling speakerphone, which tells the client that echo is already handled. Check the DSP maker's guidance for each conferencing platform.

AEC Reference Signal Path — The Critical Detail

The adaptive filter requires a reference signal representing the loudspeaker output as it enters the room. The reference must be:

  1. Post-mixing — after all far-end audio sources are combined onto the output bus
  2. Pre-amplification — before any gain changes that the amplifier might apply
  3. Pre-room — taken inside the DSP from the signal that feeds the loudspeaker output; never from a microphone
  4. Time-aligned — arriving at the AEC no later than the echo reaches the microphone

A reference taken at the wrong point produces a mismatch between the predicted echo and the actual echo in the microphone. This mismatch causes residual echo that no amount of NLP tuning can fully suppress.

In QSC Q-SYS: The AEC reference is a separate input on the AEC component in the design. It must be explicitly wired from the speaker output bus post-processing. A common commissioning error is omitting this wire entirely — AEC appears active in the design but performs no cancellation.

In Biamp Tesira: The AEC reference must be routed from the output path serving the room's loudspeaker, post all mixing and processing.

AEC in Beamforming Systems

Many modern beamforming microphone arrays (Shure MXA series, Biamp Parle) integrate AEC processing directly in the array or in a co-designed DSP. The beamformed output feeds the AEC as the near-end signal.

Beamforming complements AEC by providing spatial filtering — the beam formed toward a talker attenuates the loudspeaker (which is in a different direction) before AEC even begins. This significantly reduces the echo-to-speech ratio at the AEC input, improving convergence stability and reducing NLP suppression artifacts.

Commissioning AEC — Step by Step

  1. Verify AEC reference routing in DSP software before powering up the room. Trace the signal path from the loudspeaker output to the AEC reference input explicitly.
  2. Set gain structure — with a remote caller active, set speaker output to normal conversational level and microphone gain to -18 dBFS nominal on near-end speech. See gain-structure.
  3. Test echo cancellation — with the remote caller speaking, listen at the remote end. Any echo from the near end indicates incomplete cancellation. Common causes: AEC reference not connected, gain too high, tail length too short.
  4. Adjust NLP aggressiveness — increase until residual echo is inaudible; verify near-end speech is not clipped during single-talk.
  5. Test double-talk — both participants speak simultaneously. Verify near-end speech is preserved, not suppressed.
  6. Test convergence after reset — restart the DSP and test echo cancellation immediately. Well-designed systems reconverge within seconds once far-end audio is playing.
  7. Test with room at occupancy — people in the room change the acoustic environment significantly. Test AEC performance with the room fully occupied.

Common Pitfalls

  • AEC reference not connected — a common commissioning error. AEC component active in design but no reference signal wired to it. Result: echo on every call. Verify reference signal path explicitly before calling commissioning complete.
  • Double AEC (hardware DSP + conferencing client) — make sure only one stage is cancelling echo. Check the DSP maker's guidance for each conferencing platform.
  • Tail length too short for the room — in a reverberant room, a short tail leaves the late part of the echo uncanceled. Increase the tail length setting in the DSP if it offers one.
  • Microphone too close to loudspeaker — direct acoustic coupling overwhelms the adaptive filter. Keep microphones and loudspeakers well apart.
  • Gain structure causing reference mismatch — if the amplifier gain is changed after the AEC reference tap point, the reference no longer matches actual loudspeaker output level. Fix amplifier gain during commissioning and control volume via the DSP only.
  • Room change after initial convergence — major room changes alter the impulse response. The filter needs time to reconverge.

Related

Continue reading in the knowledge base.

We use optional analytics cookies to understand site usage and improve the experience. You can accept or reject.