Thorvald Natvig
2005-Jun-02 07:05 UTC
[Speex-dev] trouble getting speex_echo_cancel() to work
> - set sampling rate to 8 kHz (at least for now) > - make sure the far end signal in the playback signal is always a bit in > advance (never late) compared to the mic signal. > - Set the tail length to something around 100 ms. > > Also, if you're using two different soundcards (as I understand) for the > playback and the capture, you're *never* going to get echo canceller to > work because the playback and capture need to be *exactly* in sync.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. (All of this as 8000 Hz, 16-bit signed) 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". As a 2nd test, I made play.sw and mic.sw identical (both the mixdown). The result is the same as the mixdown, with the volume slowly decaying until it's about 15 dB lower at the end of the 8 sec sample. 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. Are there any tunable parameters I can set to allow the echo canceller to be a bit more aggressive?
Kleijn, J.S. de
2005-Jun-02 07:47 UTC
[Speex-dev] trouble getting speex_echo_cancel() to work
Hi, Here http://home.arcor.de/andreadrian/ you can download another echo canceller including a double talk detector. It is open source etc and it's used in Kphone etc. I haven't got it to work well but this should be possible with some tuning. In my opinion it is easier to use than the echo canceller in speex PS: the latest source of the echocanceller is included in the intercom program. Greetings Jeroen de Kleijn -----Oorspronkelijk bericht----- Van: speex-dev-bounces@xiph.org namens Thorvald Natvig Verzonden: do 2-6-2005 15:58 Aan: speex-dev@xiph.org CC: Onderwerp: Re: [Speex-dev] trouble getting speex_echo_cancel() to work > - set sampling rate to 8 kHz (at least for now) > - make sure the far end signal in the playback signal is always a bit in > advance (never late) compared to the mic signal. > - Set the tail length to something around 100 ms. > > Also, if you're using two different soundcards (as I understand) for the > playback and the capture, you're *never* going to get echo canceller to > work because the playback and capture need to be *exactly* in sync. 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. (All of this as 8000 Hz, 16-bit signed) 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". As a 2nd test, I made play.sw and mic.sw identical (both the mixdown). The result is the same as the mixdown, with the volume slowly decaying until it's about 15 dB lower at the end of the 8 sec sample. 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. Are there any tunable parameters I can set to allow the echo canceller to be a bit more aggressive? _______________________________________________ Speex-dev mailing list Speex-dev@xiph.org http://lists.xiph.org/mailman/listinfo/speex-dev
Jean-Marc Valin
2005-Jun-02 09:06 UTC
[Speex-dev] trouble getting speex_echo_cancel() to work
> 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 -- Jean-Marc Valin <Jean-Marc.Valin@USherbrooke.ca> Universit? de Sherbrooke
Thorvald Natvig
2005-Jun-02 17:37 UTC
[Speex-dev] trouble getting speex_echo_cancel() to work
>> 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 thought I should give an "ideal" testcase to see it's best theoretical performance.>> 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)?No, I didn't, and having just upgraded, that made all the difference in the world. Doing the same test, the echo is now completely gone. That is, it's at least 30 dB lower than in the "echo" signal, which is low enough that it's not noticable when the person is talking, and also low enough not to trigger VAD during periods of silence. It also handled the case where the echo (loudspeaker) signal was music which was 10 dB louder than the desired signal. The signal was noticably distorted from the original, but considering I couldn't even hear what was being said as long as the echo was there, it's very impressive. Thank you very, very much :)