[Speex-dev] Help needed regarding Echo Cancellation

Jean-Marc Valin Jean-Marc.Valin at USherbrooke.ca
Mon Sep 5 16:10:28 PDT 2005

> -- When call is started EC works fine for first few
> seconds. Bur after a certain period [usually 20 sec or
> more] it does not work or works very bad [produces
> distorted or noisy echo].

The most common reason for that is skips (underruns/overruns) in the
audio, which change the (effective) echo impulse response abruptly. The
fix for that would be in the sound interface.

> -- I used echo tail 200ms. Using long echo tail
> [2000ms], EC works very fine but in that case CPU
> usage becomes very high. 

Define very high. If increasing the echo tail to 200ms makes it much
better, then it's probably just a problem of sync between far end and
near end (and the beginning of the echo tail being wasted because of

> -- I read the played packets from DirectSound Buffer
> and use it as echo frame. I have noticed that my echo
> frame is of low amplitude and many values of it are 0
> [zero]. 

Can't help you with DirectSound.

> -- Since the values are small, I applied AGC on echo
> frame with another Speex preprocessor before passing
> it to EC. With this approach and echo tail 400ms, I
> get very good echo cancellation. But some times we get
> distorted audio, sounds like someone speaking in pipe
> or underwater.

NOOOOOOOOOOOOOOOOOOO! Never, ever apply any kind of processing on any of
the AEC inputs (output doesn't matter), unless it's linear and constand
(e.g. a filter).

> -- Is there any possibility to get distorted audio if
> we apply speex AGC on echo frame before passing it to
> EC? 

It's not a possibility, it's a guarantee.

> -- Is there any tradeoff that if echo cancellation
> becomes more aggressive, the voice quality will fall
> or will be distorted?
> -- What are the ways to make EC more aggressive?

Yes, it's got to do with the adaptation rate, but I wouldn't suggest you
play with it unless you know what you're doing.

Jean-Marc Valin <Jean-Marc.Valin at USherbrooke.ca>
Université de Sherbrooke
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.xiph.org/pipermail/speex-dev/attachments/20050906/0f32568e/attachment.pgp

More information about the Speex-dev mailing list