TL;DR:
When an assistant talks through your speakers, its voice also reaches your microphone. Echo cancellation subtracts it.
The software knows exactly what it played, so it predicts how the room will change that sound and removes the prediction from the recording.
It works well but not perfectly. Headphones remove the problem at its source.
You ask your laptop a question, and the answer plays out of its speakers. A few inches away, the microphone is wide open, and the microphone is not smart. It hears the assistant's voice just as clearly as yours. If nothing were done about it, the assistant would listen to its own answer, treat it as a new question and start replying to itself.
The short answer
Echo cancellation is the trick that prevents this. The software keeps a copy of the sound it is playing. It works out what that sound will look like once it has travelled through the speaker, across the room and into the microphone, and then subtracts that predicted version from what the microphone recorded. What is left is mostly you.
What happens step by step
The assistant plays audio. The software has the exact digital copy of it, called the reference.
The sound travels. It leaves the speaker, bounces off the desk, walls and your screen, and reaches the microphone, delayed and changed.
The microphone records the mix: your voice plus the delayed, altered copy of the playback.
A filter estimates the path. It guesses how the room changes the reference: how late it arrives and how it is colored.
It subtracts the estimate from the recording. The remainder goes on to speech recognition.
The filter keeps updating its estimate, because the path changes when you move, open the lid or shift the laptop. This is why it is called adaptive.
Walk-through: an assistant speaking from laptop speakers
Let us put numbers on the delay, since delay is what the filter has to learn. Sound travels at about 343 m/s in room temperature air.
Path | Distance | Time at 343 m/s |
|---|---|---|
Speaker straight to microphone | 0.3 m | 0.3 / 343 ≈ 0.00087 s, about 0.9 ms |
Speaker, off a wall 2 m away, to microphone | about 4 m | 4 / 343 ≈ 0.0117 s, about 11.7 ms |
So the microphone does not hear one copy of the assistant's voice. It hears the direct sound at about 0.9 ms, then fainter copies arriving later as the sound bounces, such as one at about 11.7 ms. The filter's job is to learn that pattern of delays and strengths.
Then a worked picture. Say, in a simplified example, the reference at one instant has the value 0.8, and the room produces a direct copy at 0.5 of the strength. The microphone also picks up your voice with value 0.2 at that moment.
Microphone recording:
your voice + echo = 0.2 + (0.5 × 0.8) = 0.2 + 0.4 = 0.6.The filter estimates the echo as
0.5 × 0.8 = 0.4.It subtracts:
0.6 − 0.4 = 0.2.The result equals your voice alone.
That arithmetic is the whole idea. Real audio does it for tens of thousands of values a second, with many delayed copies at once, and the estimates are never perfect, so a small leftover remains.
When it works and when it struggles
Loud playback. The louder the speakers, the larger the echo to remove, and speakers can distort in ways a simple estimate cannot copy.
Changing room. If you pick up the laptop or someone walks by, the path changes and the filter needs a moment to catch up.
Talking at the same time. If you speak over the assistant, the filter has your voice mixed in as it tries to learn, which makes it harder. This is known as double talk.
Odd setups. External speakers, audio routed through a monitor or several microphones can add delays the software does not expect.
What it can't do
Echo cancellation cannot remove sound it does not know about. It can subtract the assistant's own voice because it holds a copy. It cannot subtract a video playing from another source it cannot see, or music from the next room. It also cannot fix a speaker that is so loud the microphone overloads.
Headphones remove the problem: With headphones, the assistant's voice never reaches the microphone in the first place, so nothing needs cancelling. If you hear the assistant repeating itself or cutting off, try headphones first.
Privacy and control
Echo cancellation happens to a recording that the microphone has already captured, so it is a quality tool, not a privacy tool. What matters for privacy is when the microphone is on. For example, DuckyHelper listens only while the pill is open and for that answer, so it is not recording when idle. If you use one that stays open, mute it when you are not talking.
Try it yourself
Make an echo test. Play your assistant's answer at a moderate volume, then raise it step by step and watch when it starts to mishear you. Then put on headphones and try the same volume. The difference shows how much work the software was doing behind the scenes.
If your problem is a crowded room instead, read getting a voice assistant to understand you in a noisy room.
Frequently asked questions
Why does my assistant cut itself off?
It may have mistaken its own voice for yours. Lower the volume, move away from the microphone or use headphones.
Is echo cancellation the same as noise cancelling?
No. Echo cancellation removes a sound the system itself is playing. Noise cancelling aims at outside sounds, either in your headphones or in the microphone signal.
Does it work with a loud video playing?
Not reliably. The software does not hold a copy of that video's sound unless it is routed through the same system, so mute it while you talk.
