DSPRelated.com
Forums

Implementing NLMS for Echo cancelation in Speech

Started by ilan_sin May 31, 2006
Hi 

I am trying to write an acoustic/line echo canceller.
I choose the quite well known nlms algo.
First I tried to implent it in matlab.
When I checked the algo with any "test input" like sin wave, zigsaw etc,
I did get convergance.
Then I tried it with speech, but failed.
I tried to improve it by implementing anti-correlation filter (
Pre-whitening). I did saw minimal improvments in the filter taps, and in
terms of math output, there is error reduction ( not much). Still, when
you play the speech, you dont hear a difference.
I also implemented filter which cut all 0-100Hz fully, 100-300Hz
transition., still no change.

I recoreded the speech in a microphone with 48Khz, then downsapmled it
propely to 8K Hz (phone). It sound OK. then I added an echo by using
GoldWave/Audacity. I implemeted a -6db echo with delay of 50ms and used
400+ Taps. The format is Wav lossless.

My qustion is: I feel that I miss something. Since I didnt work with audio
before, it could be that I fail in something very fundamental...
( I worked with lsf algos ).
I will be gratfull for any help/suggestions...
Thanks, Ilan



>Hi > >I am trying to write an acoustic/line echo canceller. >I choose the quite well known nlms algo. >First I tried to implent it in matlab. >When I checked the algo with any "test input" like sin wave, zigsaw etc, >I did get convergance. >Then I tried it with speech, but failed. >I tried to improve it by implementing anti-correlation filter ( >Pre-whitening). I did saw minimal improvments in the filter taps, and in >terms of math output, there is error reduction ( not much). Still, when >you play the speech, you dont hear a difference. >I also implemented filter which cut all 0-100Hz fully, 100-300Hz >transition., still no change. > >I recoreded the speech in a microphone with 48Khz, then downsapmled it >propely to 8K Hz (phone). It sound OK. then I added an echo by using >GoldWave/Audacity. I implemeted a -6db echo with delay of 50ms and used >400+ Taps. The format is Wav lossless. > >My qustion is: I feel that I miss something. Since I didnt work with
audio
>before, it could be that I fail in something very fundamental... >( I worked with lsf algos ). >I will be gratfull for any help/suggestions... >Thanks, Ilan > > > >
Thank You, But I solved the Problem. Ilan
You have a very fundamental problem, which is ... NLMS performs very 
poorly as Acoustic Echo Canceler (AEC) for speech in real conditions!

Pre-Whitening is insufficient to make NLMS work properly and achieve 
high performance.

Although may not seems so, AEC is a very tricky problem that requires 
lots of experience and deep understanding.

An example of an excellent AEC is Compandent's EchoKiller which achieves 
excellent performance.  See the impressive audio demo of Compandent's 
EchoKiller at:
http://www.Compandent.com/products_echokiller.htm



ilan_sin wrote:
> Hi > > I am trying to write an acoustic/line echo canceller. > I choose the quite well known nlms algo. > First I tried to implent it in matlab. > When I checked the algo with any "test input" like sin wave, zigsaw etc, > I did get convergance. > Then I tried it with speech, but failed. > I tried to improve it by implementing anti-correlation filter ( > Pre-whitening). I did saw minimal improvments in the filter taps, and in > terms of math output, there is error reduction ( not much). Still, when > you play the speech, you dont hear a difference. > I also implemented filter which cut all 0-100Hz fully, 100-300Hz > transition., still no change. > > I recoreded the speech in a microphone with 48Khz, then downsapmled it > propely to 8K Hz (phone). It sound OK. then I added an echo by using > GoldWave/Audacity. I implemeted a -6db echo with delay of 50ms and used > 400+ Taps. The format is Wav lossless. > > My qustion is: I feel that I miss something. Since I didnt work with audio > before, it could be that I fail in something very fundamental... > ( I worked with lsf algos ). > I will be gratfull for any help/suggestions... > Thanks, Ilan > > >
>Hi > >I am trying to write an acoustic/line echo canceller. >I choose the quite well known nlms algo. >First I tried to implent it in matlab. >When I checked the algo with any "test input" like sin wave, zigsaw etc, >I did get convergance. >Then I tried it with speech, but failed. >I tried to improve it by implementing anti-correlation filter ( >Pre-whitening). I did saw minimal improvments in the filter taps, and in >terms of math output, there is error reduction ( not much). Still, when >you play the speech, you dont hear a difference. >I also implemented filter which cut all 0-100Hz fully, 100-300Hz >transition., still no change. > >I recoreded the speech in a microphone with 48Khz, then downsapmled it >propely to 8K Hz (phone). It sound OK. then I added an echo by using >GoldWave/Audacity. I implemeted a -6db echo with delay of 50ms and used >400+ Taps. The format is Wav lossless. > >My qustion is: I feel that I miss something. Since I didnt work with
audio
>before, it could be that I fail in something very fundamental... >( I worked with lsf algos ). >I will be gratfull for any help/suggestions... >Thanks, Ilan > > > >
Thank You, But I solved the Problem. Ilan
ilan_sin wrote:
> >Hi > > > >I am trying to write an acoustic/line echo canceller. > >I choose the quite well known nlms algo. > >First I tried to implent it in matlab. > >When I checked the algo with any "test input" like sin wave, zigsaw etc, > >I did get convergance. > >Then I tried it with speech, but failed. > >I tried to improve it by implementing anti-correlation filter ( > >Pre-whitening). I did saw minimal improvments in the filter taps, and in > >terms of math output, there is error reduction ( not much). Still, when > >you play the speech, you dont hear a difference. > >I also implemented filter which cut all 0-100Hz fully, 100-300Hz > >transition., still no change. > > > >I recoreded the speech in a microphone with 48Khz, then downsapmled it > >propely to 8K Hz (phone). It sound OK. then I added an echo by using > >GoldWave/Audacity. I implemeted a -6db echo with delay of 50ms and used > >400+ Taps. The format is Wav lossless. > > > >My qustion is: I feel that I miss something. Since I didnt work with > audio > >before, it could be that I fail in something very fundamental... > >( I worked with lsf algos ). > >I will be gratfull for any help/suggestions... > >Thanks, Ilan > > > > > > > > > > Thank You, But I solved the Problem. Ilan
I had difficulty getting LMS to converge on speech as well, since speech is highly correlated. Switching to frequency domain adaptation helps. Partitioning the taps in blocks optimized to a corresponding delay of the input helps too. In other words, instead of optimizing one filter with 512 taps, optimize 16 32-tap filters separately. The algorithm is called Partitioned Block Frequency-Domain Adaptive Filtering (PBFDAF). I also used an initial training period of white noise to speed up modeling the acoustic path, but that may not be acceptable in your application. Regards
eryksun wrote:
> ilan_sin wrote: >>> Hi >>> >>> I am trying to write an acoustic/line echo canceller. >>> I choose the quite well known nlms algo. >>> First I tried to implent it in matlab. >>> When I checked the algo with any "test input" like sin wave, zigsaw etc, >>> I did get convergance. >>> Then I tried it with speech, but failed. >>> I tried to improve it by implementing anti-correlation filter ( >>> Pre-whitening). I did saw minimal improvments in the filter taps, and in >>> terms of math output, there is error reduction ( not much). Still, when >>> you play the speech, you dont hear a difference. >>> I also implemented filter which cut all 0-100Hz fully, 100-300Hz >>> transition., still no change. >>> >>> I recoreded the speech in a microphone with 48Khz, then downsapmled it >>> propely to 8K Hz (phone). It sound OK. then I added an echo by using >>> GoldWave/Audacity. I implemeted a -6db echo with delay of 50ms and used >>> 400+ Taps. The format is Wav lossless. >>> >>> My qustion is: I feel that I miss something. Since I didnt work with >> audio >>> before, it could be that I fail in something very fundamental... >>> ( I worked with lsf algos ). >>> I will be gratfull for any help/suggestions... >>> Thanks, Ilan >>> >>> >>> >>> >> Thank You, But I solved the Problem. Ilan > > I had difficulty getting LMS to converge on speech as well, since > speech is highly correlated. Switching to frequency domain adaptation > helps. Partitioning the taps in blocks optimized to a corresponding > delay of the input helps too. In other words, instead of optimizing one > filter with 512 taps, optimize 16 32-tap filters separately. The > algorithm is called Partitioned Block Frequency-Domain Adaptive > Filtering (PBFDAF). I also used an initial training period of white > noise to speed up modeling the acoustic path, but that may not be > acceptable in your application. > > Regards >
Did you really mean LMS? LMS won't really work for speech. You need an algorithm that is responsive to the endlessly changing levels of voice signals. NLMS, on the other hand, should work just fine. If you whiten the voice signal before the NLMS convergence is faster and the final converged state can be more accurate. However, if you can't get plain NLMS to give pretty good results you are doing something wrong. Steve
You have Added fixed linear synthetic "echo" using Goldwave...????

And, Do you really expect that to behave like real-world echo, that is 
time-varying and may be non linear...???

I'm afraid my friend that you are wasting your time...

If you'll record real-life echo, typical video conferencing, you will 
find that NLMS really sucks!!!

Good AEC should be able to track time-varying echo fast enough!

An example of an excellent AEC is Compandent's EchoKiller which achieves 
excellent performance.  See the impressive audio demo of Compandent's 
EchoKiller at:
http://www.Compandent.com/products_echokiller.htm


ilan_sin wrote:
>> Hi >> >> I am trying to write an acoustic/line echo canceller. >> I choose the quite well known nlms algo. >> First I tried to implent it in matlab. >> When I checked the algo with any "test input" like sin wave, zigsaw etc, >> I did get convergance. >> Then I tried it with speech, but failed. >> I tried to improve it by implementing anti-correlation filter ( >> Pre-whitening). I did saw minimal improvments in the filter taps, and in >> terms of math output, there is error reduction ( not much). Still, when >> you play the speech, you dont hear a difference. >> I also implemented filter which cut all 0-100Hz fully, 100-300Hz >> transition., still no change. >> >> I recoreded the speech in a microphone with 48Khz, then downsapmled it >> propely to 8K Hz (phone). It sound OK. then I added an echo by using >> GoldWave/Audacity. I implemeted a -6db echo with delay of 50ms and used >> 400+ Taps. The format is Wav lossless. >> >> My qustion is: I feel that I miss something. Since I didnt work with > audio >> before, it could be that I fail in something very fundamental... >> ( I worked with lsf algos ). >> I will be gratfull for any help/suggestions... >> Thanks, Ilan >> >> >> >> > > Thank You, But I solved the Problem. Ilan >