Terrific! The patch fixes my problem quite decisively. I will want to use this with a 16K sample rate. Is it expected to work well with just another slight patch, or will we need to modify it more deeply? Also, are there any tunable parameters besides tail length? I am wondering about the aggressiveness of adaptation and I know you are an expert in that area. Thanks so much, Michael -----Original Message----- From: Jean-Marc Valin [mailto:jean-marc.valin@usherbrooke.ca] Sent: Friday, October 27, 2006 4:22 PM To: Coffey, Michael Cc: speex-dev@xiph.org; Vysotsky, Vladimir Subject: Re: [Speex-dev] Echo Canceller trouble in 1.2beta1 Can you first try the svn version (or apply https://trac.xiph.org/changeset/11882). As I mentioned in a previous email, there's a bad bug in the 1.2beta1 echo canceller. Jean-Marc Coffey, Michael a ?crit :> Hi Folks, > > I am having trouble using speex_echo_cancel. As a starting point, I am > using the testecho.c source code. I compiled the 1.2beta1 version. I > have not tried any other versions of speex. > > The document says that the order of arguments to Speex_echo_cancel is > (echo_state, input_frame, echo_frame, output_frame, residue) where > "input_frame" is as captured from mic and "echo_frame... was played from > the speaker." > > Speex_echo_cancel calls these parameters (st, ref, echo, out, Yout). The > name "ref" is confusing to me, but the implementation of > speex_echo_playback() and speex_echo_capture() confirms that the "ref" > argument is supposed to be the mixture of sound coming from the > microphone and the "echo" argument is supposed to be whatever has been > played out to the speaker. > > If I pass the arguments in the "right" order, I get garbage output > perhaps indicative of some kind of severe overflow. If I change the > signal arguments (passing echo before ref) I get something like the > wrong signal subtracted from the mix. > > I've created a pair of files for testing various echo cancellers. To > simulate the "far end" speech, I have a clean close-mic recording of an > utterance which I pass as the "echo" argument to testecho.c. To simulate > the mixture coming from the mic, I delay that same signal by 10 ms, add > a mild amount of artificial reverb, reduce the volume by several db, and > then mix in a different clean utterance. That is passed as the "ref" > argument. > > This test is slightly difficult because there is more double-talk than > single-talk in it. Also, the 10ms delay is fairly long. However, other > vendor's echo cancellers have been able to handle it. > > What should I try next? Am I missing something obvious or should I try a > different version of the code? I would be very excited to be able to get > this to work. > > Thanks > Michael > > _______________________________________________ > Speex-dev mailing list > Speex-dev@xiph.org > http://lists.xiph.org/mailman/listinfo/speex-dev > >
> I will want to use this with a 16K sample rate. Is it expected to > work well with just another slight patch, or will we need to modify > it more deeply?Just use SPEEX_ECHO_GET_SAMPLING_RATE to let the aec know what sampling rate you're using (default is 8000).> Also, are there any tunable parameters besides tail length? I am > wondering about the aggressiveness of adaptation and I know you are > an expert in that area.There's no aggressiveness parameter, though I guess I could add a parameter that controls the tradeoff between fast adaptation and steady-state cancellation. Another thing, you might want to use the new API (speex_echo_cancellation() in svn) since it makes it easier to use the residual echo suppression (aka nonlinear processing). That one does have an aggressiveness (distortion vs echo left) parameter. See testecho.c in svn for how it works. Jean-Marc
Coffey, Michael
2006-Oct-31 14:43 UTC
[Speex-dev] Stream Synchronization for Echo Cancellation
Do you know of anyone, especially in the free software world, who has successfully tackled the problem of synchronizing real-time input and output audio streams of different devices using Windows? I need to do a good job of this so that Acoustic Echo Cancellation can work in my Video Conferencing application. I need to be able to capture audio from a USB webcam and play it out over the user's choice of speakers or headphones. As it says in 5.4.1 of the good book "Using a different soundcard to do the capture and playback will *not* work, regardless of what you may think. The only exception to that is if the two cards can be made to have their sampling clock 'locked' on the same clock source." It seems to me that it should be possible to achieve synchronization using some combination of cross-correlation, clock skew estimation, and sample interpolation. But there are so many details to consider, I bet it would take a long time to get right. Thanks for any pointers, Michael