[Speex-dev] trouble getting speex_echo_cancel() to work

Jean-Marc Valin Jean-Marc.Valin at USherbrooke.ca
Thu Jun 2 09:04:58 PDT 2005

> I did a bit more testing, and ended up creating a set of testsamples, as 
> follows:
> ideal.pcm => me saying "This is what I'd like to hear"
> junk.pcm => me saying "With a bit of luck, this is gone"
> mixdown.pcm => ideal.pcm, with junk.pcm started 7 ms later and 3 dB lower.

The problem with that is that it's nowhere near real conditions. It
would be a lot better if you made a real recording for mixdown because
then you would have a realistic echo function (with non-ideal freq
response, reverberation, ...).

> I then copied junk.pcm to play.sw, mixdown.pcm to mic.sw and ran testecho. 
> The output sounds almost identical to the mixdown, and far from "ideal".

Are you using the latest code in svn (it has lots of improvements)?

> Somewhat encouraged by this, I made a much longer set of samples, and in 
> the mixdown I inserted the "desired" sound 5 seconds into the mix to let 
> the filter have time to adapt. Indeed, after a few seconds,  the echo is 
> reduced by about 15 dB, but that will still be loud enough to be annoying 
> and distractive when talking.

You also need the preprocessor hooks to get extra cancellation (see
manual.pdf in svn).

> Are there any tunable parameters I can set to allow the echo canceller to 
> be a bit more aggressive?

If you reduce the echo tail (filter size), it becomes more agressive
(otherwise you can tune the code yourself, but you may make it unstable
in the process).


Jean-Marc Valin <Jean-Marc.Valin at USherbrooke.ca>
Université de Sherbrooke

More information about the Speex-dev mailing list