What Is Acoustic Echo Cancellation (AEC)? Stop Speaker Audio from Returning in a Call
Learn how AEC uses speaker playback and microphone input to reduce echo sent back to the other caller, and why reference timing, double-talk, and real-device checks matter.
Short answer
Acoustic echo cancellation (AEC) reduces call echo that occurs when the other party’s voice plays through your loudspeaker, reaches your microphone, and is sent back to them. The system uses the playback signal as a reference to estimate the echo path through the room and device, then subtracts estimated echo or suppresses what remains. The playback reference must align with the microphone signal, and your own voice must remain clear when both people speak at once. WebRTC APM overview SpeexDSP manual
How echo forms and is cancelled
In a hands-free call, remote speech plays from your speaker, travels through room reflections and device acoustics, and is picked up partly by your microphone. If that capture is sent back unchanged, the remote caller hears a delayed copy of their voice. An echo canceller takes the speaker-bound signal as a reference and uses an adaptive filter to estimate the acoustic path. It subtracts estimated echo from the microphone signal; another suppressor may reduce nonlinear or residual echo. Implementations differ, but the playback reference is central. SpeexDSP manual WebRTC APM API
How it differs from noise suppression
Noise suppression targets background sound such as a fan. AEC targets a known playback signal that returns from speaker to microphone. They can run together but are not substitutes. AEC mainly reduces echo heard by the remote caller in the microphone uplink; it does not remove room reverberation heard locally from your speaker, nor is it the same as electrical echo cancellation in a telephone network. WebRTC treats echo cancellation, noise suppression, and automatic gain control as separate effects.
What affects performance
**Correct playback reference:** AEC needs the far-end audio actually sent to the speaker. WebRTC APM identifies the render/reverse stream as the echo reference. An unrelated or partially processed signal makes echo prediction harder.
**Delay and synchronization:** The system must align when reference audio is rendered with when the corresponding echo reaches capture and processing. WebRTC exposes stream delay for this relationship. Inaccurate delay or mismatched device clocks can reduce performance.
**Double-talk:** Both remote playback and your speech are present. The filter can mistakenly remove your voice as echo or leave echo behind, so check echo reduction and near-end speech preservation together.
**Changing path and distortion:** Moving the device, changing volume, or switching speaker/microphone paths can make the path estimate stale. Speaker clipping or strong distortion is harder for a simple linear filter to model. Test with the actual devices and room. [WebRTC API](https://webrtc.googlesource.com/src/+/cdf0e6d4c5a06f6c04435041cc5f7b35c8facb61/modules/audio_processing/include/audio_processing.h) [ICASSP 2021 AEC Challenge](https://arxiv.org/abs/2009.04972)
A practical check sequence
**Trace the signal paths:** Confirm remote playback reaches the AEC render/reference input and your microphone reaches capture. If the OS or device has built-in AEC, check whether app processing duplicates it.
**Check delay and devices:** Confirm capture/playback devices, audio formats, and timing between reference and microphone are consistent. For a meeting app, consult its and the device’s documentation to learn where AEC runs.
**Listen by scenario:** With only the remote person speaking, check residual echo; with only you speaking, check clipped speech or level changes; during simultaneous speech, check both. Ask the remote caller about what they hear.
**Repeat after changing the setup:** Test realistic speaker levels, mic distance, and device positions. If echo rises after a move or volume change, check the changed path and reference connection.
**Combine metrics with listening:** ERLE (echo return loss enhancement) is a supporting measure of cancellation in echo-only conditions. In real recordings with noise and reverberation or during double-talk, objective measures such as ERLE and PESQ may not track perceived quality well. Include real call recordings and listening review. [ICASSP 2021 AEC Challenge](https://arxiv.org/abs/2009.04972)
AEC does not guarantee complete echo removal. Check the playback reference, timing, device path, and preservation of near-end speech during double-talk to narrow down the cause.