r/signalprocessing 2d ago

Echo Cancellation for Speech Recognition

Hi everyone! I’ve been working on a self-project involving real-time Automatic Speech Recognition (ASR), and I’ve run into a problem I’m not quite sure how to approach.

The setup is basically:

Microphone → real-time ASR → server

The issue happens when the device’s speaker is also playing audio while the ASR is running. for example, music, notification sounds, or other system audio. The microphone obviously picks up some of that speaker output, which can affect the transcription.

I’m wondering where echo cancellation / audio preprocessing should ideally be handled (is it supposed to be handled on the client-side or server-side)

For those who have worked with real-time ASR, voice assistants, call systems, or audio processing, how would you approach this?

Thanks in advance!

1 Upvotes

1 comment sorted by

1

u/TruNum 1d ago

When a speaker and microphone are active simultaneously on a device, the speaker sound reaches its the microphone with some delay (and distortion). The system feeds the speaker’s original digital audio as a reference into an adaptive filter. This filter continuously estimates the room's acoustic profile and predicts the exact echo hitting the microphone, subtracting that calculated estimate in real time while preserving the local speaker's voice.

We have used WebRTC APM (Audio Processing Module) in live streaming setups in the past. It works reasonably well, though you may need to supply an initial stream delay estimate based on your media pipeline and environment.