Acoustic echo cancellation (AEC) algorithm
Echo cancellation helps maintain clear hands-free communication and intelligible voice interactions
In hands-free systems and devices with voice interfaces, the microphone captures part of the loudspeaker output. This may include far-end speech, voice responses, alerts, or other audio content. Acoustic echo cancellation models the loudspeaker-to-microphone path, estimates the echo contribution, and subtracts it from the captured signal. This processing helps preserve the user's voice for communication, voice control, or transcription, including during double talk.
The microphone also picks up the signal played by the loudspeaker
In hands-free communication
In a vehicle, the microphone captures both near-end speech and sound reproduced by the loudspeakers. When transmitted to the far end, the loudspeaker contribution is heard as echo and can disrupt the conversation.
In videoconferencing
The microphone and the loudspeaker are often built into the same device, with strong acoustic coupling. Without effective echo cancellation, simultaneous speech can make conversations difficult.
In a voice interface
During playback of a voice response, the system must continue capturing the user's speech. Without suitable processing, the loudspeaker signal can mask voice commands and prevent users from interrupting playback. Users may need to wait until playback ends before issuing a voice command.
Integrating an adaptive acoustic echo canceller into your system
The algorithm uses the signal sent to the loudspeaker as a reference. An adaptive filter based on LMS or NLMS methods estimates the acoustic response between the loudspeaker and microphone in real time. The estimated echo is then subtracted from the captured signal to preserve near-end speech before transmission.
The acoustic path can vary with environmental changes, including human movement, product repositioning, door openings, or changes in playback conditions. The adaptive filter updates its acoustic path model to maintain echo cancellation. Dedicated double-talk handling helps prevent near-end speech from interfering with filter adaptation during simultaneous speech.
ARTEAC-LAB applies its expertise in adaptive filtering and real-time signal processing to design, tune, and validate these algorithms. We then port the solution to your target platform, accounting for computational resources, memory, sampling rate, latency, and audio chain architecture.
From product characterization to signal processing integration
Characterizing the electroacoustic system
We analyze product geometry, microphone-to-loudspeaker distance, acoustic and mechanical transmission, playback levels, and reverberation in the operating environment. These parameters influence echo path complexity and achievable performance.
Assessing platform capabilities
Before porting, we verify platform compatibility, including access to the loudspeaker reference signal and synchronization of capture and playback streams. We also assess sampling rate, audio chain latency, available dynamic range, computational resources, and memory. Signal levels must remain within the available dynamic range to prevent clipping and saturation.
Sizing the algorithm
We determine the adaptive filter length based on the delay and duration of the acoustic impulse response to be modeled. We then adjust algorithm parameters to achieve suitable adaptation speed, convergence time, and tracking of acoustic path changes. Parameter selection takes into account performance targets and the resources available on the target platform.
Handling double talk
During double talk, the algorithm must distinguish near-end speech from acoustic echo originating from loudspeaker playback. Double-talk detection controls filter adaptation to reduce the risk of divergence while maintaining echo cancellation and preserving near-end speech.
Tuning and validating on the actual product
We perform final tuning on the integrated product under representative operating conditions. We assess echo attenuation, convergence time, stability following acoustic path changes, and preservation of near-end speech during double talk.
Echo cancellation explained
What is the difference between echo and feedback?
Both phenomena result from loudspeaker-to-microphone coupling, but their effects are distinct. Acoustic echo occurs when delayed speech is transmitted back to the far-end caller. Acoustic feedback can cause sustained oscillation or howling when an electroacoustic loop becomes unstable. Antidote is designed to suppress acoustic feedback.
Does the processing degrade near-end speech?
The objective is to preserve near-end speech. The estimated echo is subtracted from the microphone signal rather than directly attenuating near-end speech. Speech discontinuities or metallic coloration can result from inadequate double-talk detection or excessive residual echo suppression. An adaptive filter that is too short to model the acoustic impulse response can leave residual echo.
Is specific hardware required?
Our acoustic echo cancellation algorithm is implemented in software and does not require a dedicated hardware component. Platform compatibility depends on access to the loudspeaker reference signal, synchronization of capture and playback streams, signal levels without clipping, and available computational resources. We assess these requirements before porting.
When does a commercial library require application-specific adaptation?
An existing commercial library can provide a suitable basis for integration. Application-specific adaptation may be needed for close microphone and loudspeaker placement, mechanical coupling, or high playback levels. Algorithm settings and implementation may then require adaptation to the target platform.
Show the technical details
Maintaining clear hands-free communication and intelligible voice interactions
The signal sent to the loudspeaker serves as the reference signal. The transfer function between the loudspeaker and microphone must be estimated and is often dominated by direct coupling. Loudspeaker-to-microphone coupling can be significant depending on transducer placement, directivity, playback levels, and acoustic or mechanical isolation.
An LMS (least mean squares) adaptive filter estimates the acoustic path by minimizing the mean squared error. The estimated loudspeaker contribution is then subtracted from the captured signal. This processing can reduce echo while preserving near-end speech for communication, voice control, or transcription.
Double talk: an adaptive filtering challenge
Echo canceller adaptation is generally more effective during far-end single talk. During double talk, the microphone captures both near-end speech and echo from the far-end signal. Uncontrolled adaptation can result in biased path estimates and degraded convergence.
Our approach supports full-duplex communication. Double-talk detection is used to suspend or stabilize adaptation when necessary. The converged filter continues to compensate for echo without interrupting communication.
Factors determining implementation requirements
Embedded audio systems often have closely spaced loudspeakers and microphones. Acoustic and mechanical coupling can be significant, while computational resources may be limited.
We adapt the processing architecture to each target platform, considering filter length, convergence, reference signal delay, acceptable latency, and channel count. We also consider potential clock drift and playback chain nonlinearities. Additional processing can reduce residual echo and improve system robustness. We use the same methodology for our other modules, as described on the embedded audio page.
Where is echo cancellation implemented in the audio chain?
Directional sound pickup can reduce the reverberant contribution to the captured signal and facilitate echo cancellation. Beamforming and AEC are then designed jointly. Their processing order depends on the selected architecture, microphone array geometry, and whether the beam is fixed or adaptive.