On Sat, Aug 9, 2008 at 12:59 PM, Jean-Marc Valin < jean-marc.valin at usherbrooke.ca> wrote:> Hi Benny, > > Can you send me your pair of testecho input files that work well with > beta3 and not with rc1? I'll have a look. > >Thanks for the help. The files are on their way now, the upload will take few more minutes to complete. In the mean time let me explain more what I did. The speaker signal is signal-xx, where xx is 8khz and 16khz depending on the file's sampling rate, and mic signal is mic-xx. The result is result-xx-yy, where yy is either rc1 or beta3 depending on Speex version that I used for the test. For the result, I use my test program for the test [1], and during the test I set echo tail length setting to 200ms, and delay to 100ms (meaning the speaker signal that's given to speex_echo_cancellation() is 100ms older than what's currently playing). The frame length is set to 20ms. And to switch between rc1 and beta3, I simply replace mdf.c from the corresponding tarball. Nothing else is changed. The actual tail length I think is around 160ms, so I'm not sure if default testecho can cope with it. In case it matters, the original input files are the 16khz ones, the 8khz is the resampled version of it (I don't think it matters in this case though since the resample is quite good). And one more thing, my mic is not synched to the speaker (I used different sound device). The mic is running about 0.06% faster than the speaker (that's about one 20ms frame drift every 3.2s or so). But I don't think it matters again, because first I have drift handling in my library (similar to how PLC work, with WSOLA) to compensate this, and secondly it doesn't seem to affect the beta3 EC anyway. But just in case it matters. And last, the test was done on Win XP. Thanks Benny [1] https://trac.pjsip.org/repos/browser/pjproject/trunk/pjsip-apps/src/samples/aectest.c Jean-Marc> > Benny Prijono a ?crit : > > Hi Jean-Marc, > > > > I tried with both testecho and my test program, and for some reason it > > just doesn't cancel any echoes with the 1.2-rc1. The testecho from beta3 > > binaries works fine, and also if I replaced mdf.c in 1.2-rc1 with mdf.c > > from beta3 and use my test program, it will work again. This happens for > > both 8KHz and 16KHz. Any ideas? > > > > I could upload the test samples and results if needed. > > > > Cheers > > Benny > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Speex-dev mailing list > > Speex-dev at xiph.org > > http://lists.xiph.org/mailman/listinfo/speex-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/speex-dev/attachments/20080809/8b9ae640/attachment.htm
OK, here's what happens. There is indeed a small difference between beta3 and rc1, but the fundamental problem isn't there. I've attached plots of the speaker signal (blue) alongside the mic signal (green). You can see the delay is in the order of 1000 samples. That's way too much to do anything useful because the tail doesn't even "see" the echo. You need to reduce that delay if you want the AEC to work. See the manual. Cheers, Jean-Marc Benny Prijono a ?crit :> On Sat, Aug 9, 2008 at 12:59 PM, Jean-Marc Valin > <jean-marc.valin at usherbrooke.ca <mailto:jean-marc.valin at usherbrooke.ca>> > wrote: > > Hi Benny, > > Can you send me your pair of testecho input files that work well with > beta3 and not with rc1? I'll have a look. > > > Thanks for the help. The files are on their way now, the upload will > take few more minutes to complete. In the mean time let me explain more > what I did. > > The speaker signal is signal-xx, where xx is 8khz and 16khz depending on > the file's sampling rate, and mic signal is mic-xx. The result is > result-xx-yy, where yy is either rc1 or beta3 depending on Speex version > that I used for the test. > > For the result, I use my test program for the test [1], and during the > test I set echo tail length setting to 200ms, and delay to 100ms > (meaning the speaker signal that's given to speex_echo_cancellation() is > 100ms older than what's currently playing). The frame length is set to 20ms. > > And to switch between rc1 and beta3, I simply replace mdf.c from the > corresponding tarball. Nothing else is changed. > > The actual tail length I think is around 160ms, so I'm not sure if > default testecho can cope with it. > > In case it matters, the original input files are the 16khz ones, the > 8khz is the resampled version of it (I don't think it matters in this > case though since the resample is quite good). > > And one more thing, my mic is not synched to the speaker (I used > different sound device). The mic is running about 0.06% faster than the > speaker (that's about one 20ms frame drift every 3.2s or so). But I > don't think it matters again, because first I have drift handling in my > library (similar to how PLC work, with WSOLA) to compensate this, and > secondly it doesn't seem to affect the beta3 EC anyway. But just in case > it matters. > > And last, the test was done on Win XP. > > Thanks > Benny > > [1] > https://trac.pjsip.org/repos/browser/pjproject/trunk/pjsip-apps/src/samples/aectest.c > > > Jean-Marc > > Benny Prijono a ?crit : > > Hi Jean-Marc, > > > > I tried with both testecho and my test program, and for some reason it > > just doesn't cancel any echoes with the 1.2-rc1. The testecho from > beta3 > > binaries works fine, and also if I replaced mdf.c in 1.2-rc1 with > mdf.c > > from beta3 and use my test program, it will work again. This > happens for > > both 8KHz and 16KHz. Any ideas? > > > > I could upload the test samples and results if needed. > > > > Cheers > > Benny > > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Speex-dev mailing list > > Speex-dev at xiph.org <mailto:Speex-dev at xiph.org> > > http://lists.xiph.org/mailman/listinfo/speex-dev > >-------------- next part -------------- A non-text attachment was scrubbed... Name: delay.png Type: image/png Size: 7889 bytes Desc: not available Url : http://lists.xiph.org/pipermail/speex-dev/attachments/20080811/a1e48fae/attachment.png
On Mon, Aug 11, 2008 at 12:34 PM, Jean-Marc Valin < jean-marc.valin at usherbrooke.ca> wrote:> OK, here's what happens. There is indeed a small difference between > beta3 and rc1, but the fundamental problem isn't there. I've attached > plots of the speaker signal (blue) alongside the mic signal (green). You > can see the delay is in the order of 1000 samples. That's way too much > to do anything useful because the tail doesn't even "see" the echo. You > need to reduce that delay if you want the AEC to work. See the manual. > >Sorry I don't get you. I can make sense of that *if* you're talking about testecho sample application, since in testecho the tail is set to 1024 samples. But, as I explained, I used my test program for producing the result, and there I set the tail length to 200ms (1600 samples). *And*, in addition to that, I delay the frames that's fed to speex_echo_cancellation() by 100ms, to reflect the playback/recording delay when the mic.pcm file was recorded. This means, if I play the frame now, I will give it to speec_echo_cancellation() 100ms later (similar to your PLAYBACK_DELAY in mdf.c). So this is equal to shifting the blue signal in your graph to the right by 100ms. It's easier to understand with testecho perhaps. I did the following changes to testecho.c: - changed the frame size and tail length: #define NN 80 #define TAIL 1600 - apply the delay before entering the "while" loop by adding: { int i; for (i=0; i<10; ++i) fread(ref_buf, sizeof(short), NN, ref_fd); } The result, testecho from beta3 can cancel the echo, while the rc1 version can't. I hope I made it clearer this time. Thanks Benny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/speex-dev/attachments/20080811/2319d9fe/attachment.htm