Hi Underwood,<br><br>Thank you for your help. I agree with your opinion. But it is almost impossible<br>to further reduce the frequent difference between play and capture.<br><br>1. I used a 2^18 step FFT to analyse the echo frequency. So the freq resolution<br> is 8000HZ/(2^17)=0.0625Hz. The analyser need at least 2^18/8000=32 seconds<br> acoustic echo record signal from the microphone.<br> Better freq resolution relies on longer FFT and also longer record echo signal.<br> It is almost not possible for a practical system.<br>2. Better resampler with smaller step size is also a challenge in its performance.<br><br>So it is difficult to reduce the frequent difference further more. <br><br>About the change of sample rates of the ADC and DAC. I don't think it is a problem<br>if the ADC and DAC share the same clock.<br>The real problem is why they have different freq clock even if they if they are<br>assigned with the same sample rate.<br><br>For example:<br><br>1. for a pure hardware sound card.<br><br>There is a a crystal quartz oscillator and two PLL circuits which outputs are clock<br>sources of ADC and DAC respectively. <br><br>When the ADC and DAC are assigned with the same sample rate, two PLLs will share<br>the same sub-frequency coefficient, so their output signal will also have exactly<br>the same frequency.<br><br>2. for a AC97 or HD sound card.<br><br>The clock frequency of both their ADC and DAC is always 48KHZ(AC97) or 192KHZ(HD).<br>Then the outputs of ADC and DAC are resampled according to their assigned sample rate<br>by software. So they will also have exactly the same frequency when they are assigned<br>with the same sample rate.<br><br>NOW THE PROBLEM IS WHY MOST SOUND CARDS ALWAYS HAVE DIFFERENT SAMPLE RATE WHEN<br>BOTH THEIR ARE ASSIGNED WITH THE SAME PLAY AND CAPTURE RATE?<br><br>>----------------------------------------------------------------------<br>><br>>Message: 1<br>>Date: Thu, 30 Sep 2010 21:27:59 +0800<br>>From: Steve Underwood <steveu@coppice.org><br>>Subject: Re: [Speex-dev] Sound card problem in acoustic echo<br>>To: speex-dev@xiph.org<br>>Message-ID: <4CA4905F.10106@coppice.org><br>>Content-Type: text/plain; charset=UTF-8; format=flowed<br>><br>> Hi,<br>><br>>0.1Hz is still a *big* difference. It means the transmitted and received <br>>samples are still sliding quite rapidly with respect to each other, and <br>>that means the adaption is proceeding too fast to ever catch up and <br>>eliminate all the echo. Ideally you need to eliminate all the frequency <br>>mismatch, but you certainly need to get so close to that goal that the <br>>creep rate is well within the capability of the adaption to keep up.<br>><br>>Note that a one off measurement of the frequency difference is not <br>>ideal. The DAC and ADC sample rates will change with temperature, and <br>>not necessarily in the same direction.<br>><br>>Steve<br>><br>>On 09/30/2010 04:45 PM, LiMaoquan2000 wrote:<br>>><br>>> Hi All,<br>>><br>>> In order to deal with acoustic echo cancellation problems of most PCs <br>>> which<br>>> sound cards have different capture and play frequencies. I made a trial.<br>>><br>>> At first, a 1000Hz sine wave is played for a long time via a speaker <br>>> and its<br>>> acoustic echo is recoreded.<br>>><br>>> Seconds, get the frequency of the echo by a FFT analyser. So the <br>>> difference<br>>> between capture and play frequencies is obtained.<br>>><br>>> Thirdly, before AEC, the signal captured by the soundcard is resampled <br>>> to the<br>>> play frequency. The frequency step of the resampler is 0.1Hz. So for <br>>> the AEC,<br>>> the difference between far-end signal and near-end signal is no more <br>>> than 0.1Hz.<br>>><br>>> I have tested the speex AEC and my own AEC in a PC that the difference <br>>> between<br>>> its sound card is about 0.8Hz. They show the same result :<br>>><br>>> WITHOUT the resampler, just a little acoustic echo is eliminated.<br>>> WITH the resampler, most acoustic echo is eliminated. But it still can <br>>> be heared<br>>> clearly, even though the echo is faint.<br>>><br>>> This performance is still much worse than AEC in PCs which sound cards <br>>> have same<br>>> capture and play frequencies. There is almost no echo can be heard in <br>>> latter.<br>>><br>>> Does anybody have advices to this problem? It's a common problem for <br>>> acoustic<br>>> echo cancellation in most computers, because most sound cards have <br>>> different<br>>> capture and play frequencies. It vital for all acoustic echo cancellers.<br>>><br>>> Any advice is welcome.<br>>><br>>> ----------------------------------------------------------------------<br>>><br>>> >Date: Sun, 25 Jul 2010 20:26:44 +0000 (GMT)<br>>> >From: p_j_r_m <p_j_r_m@yahoo.com <mailto:p_j_r_m@yahoo.com>><br>>> >Subject: Re: [Speex-dev] Sound card problem in acoustic echo<br>>> >To: speex-dev@xiph.org <mailto:speex-dev@xiph.org><br>>> ><br>>> >Direct Sound AEC never worked for me, even when it did with Speex.?I <br>>> was told that after disabling effects in DS the play and record <br>>> streams could be synchronized,and then Speex AEC did the job.<br>>> ><br>>> >--- El vie, 23/7/10, limaoquan2000 <limaoquan2000@126.com <br>>> <mailto:limaoquan2000@126.com>> escribi?:<br>>> ><br>>> ><br>>> >De: limaoquan2000 <limaoquan2000@126.com <mailto:limaoquan2000@126.com>><br>>> >Asunto: Re: [Speex-dev] Sound card problem in acoustic echo<br>>> >Para: speex-dev@xiph.org <mailto:speex-dev@xiph.org>, <br>>> p_j_r_m@yahoo.com <mailto:p_j_r_m@yahoo.com><br>>> >Fecha: viernes, 23 de julio, 2010 22:42<br>>> ><br>>> ><br>>> >>I remember?I had to expose the echo cancelation level implementing a <br>>> get_echo_level( ) function based on this:<br>>> >>http://lists.xiph.org/pipermail/speex-dev/2008-September/006889.html<br>>> ><br>>> >This is really a good idea to determine the frequency difference <br>>> between capture<br>>> >and play of the sound card. But it need constant far-end voice and a <br>>> long time<br>>> >because it must repeat the process of "resampling, test echo" for <br>>> many times.<br>>> ><br>>> >Have you tried the AEC in DirectSound? If this AEC is usable for all <br>>> sound cards,<br>>> >perhaps microsoft has solved this problem already. Can we choose <br>>> proper options<br>>> >of the DirectSound to solved this problem and disable its AEC at the <br>>> same time?<br>>> ><br>>> >><br>>> >>Using that value and averaging samples as?"fedback" I did small <br>>> corrections to sampling rate until convergence, although this not <br>>> always worked.When it did, convergence was quite fast (seconds).<br>>> >>Resampling did not introduce noticiable CPU increase.But may be the <br>>> small time used for conversions was the cause of non-convergence.I <br>>> think this path is hard and uncertain,<br>>> ><br>>> >>and now,i would dive first in DirectSound to try to obtain <br>>> synchronized streams before passing them to speex.<br>>> ><br>>> >Waiting for your good news.<br>>> ><br>>> >>Regarding ASIO, you have to install a special "driver"? for it to <br>>> work,and this seems unaceptable for general users.<br>>> ><br>>> >>--- El jue, 22/7/10, limaoquan2000 <limaoquan2000@126.com <br>>> <mailto:limaoquan2000@126.com>> escribi:<br>>> ><br>>> >>Thank you.<br>>> ><br>>> >>But it will cost you a long time to get the accurate play and <br>>> capture frequencies.<br>>> >>Does your program test two frequencies of the sound card each time <br>>> Because<br>>> >>different sound cards have different frequency errors.<br>>> >>And the resampling program is also time consuming because the target <br>>> frequency is<br>>> >>so close to the sampling frequency of the input signal, isn't it?<br>>> ><br>>> >>I have tested program based on Windows waveform functions and also <br>>> DirectSound.<br>>> >>They have similar frequency error.<br>>> ><br>>> >>BTW: What's your conclusion of ASIO driver? Why "it was of no <br>>> practical use"?<br>>> ><br>>> >>> I worked some time for a company doing AEC using Speex on <br>>> Windows.It is true it depends a lot on sound card models. I remember I <br>>> could do AEC by resampling frequencies so play and record frequencies <br>>> where equal.Frequencies where aprox 100Hz appart.Also, I know that on <br>>> other cases AEC was achieved by disabling FX DirectSound effects where <br>>> it wasn`t possible before that.Try to disable all you don't need <br>>> before calling Speex AEC function.<br>>> >>> Also, I tried the ASIO driver,as an experiment. I think it worked, <br>>> but it was of no practical use.<br><br><br><br><span title="neteasefooter"><span id="netease_mail_footer"><hr/>
<a href="http://yxp.163.com/photo/ep.html?sss=fromyx0911" target="_blank">全国最低价,天天在家冲照片,24小时发货上门!</a>
</span></span>