Forums

Acoustic Echo Cancellation source

Started by john November 25, 2003
Hello , 
 
We are 2 students writing a VideoConference application on 
linux; 
We want to use microphones for recording and loudspeakers for hearing. 
Now , test we made so far show that there is acoustic echo 
even if there is a reasonable distance  between micropone 
and loudspeakers. 

Is there open source for Acoustic Echo Cancellation
anywhere ? 

I mean not a chip-level (assembler?) application , but a high level 
applciation with takes the raw audio packets as 
input and by some tranformation takes out the echo rom it.

We saw the FIR algorithm (and implementation) 
but it is too CPU intetnsive. 

Any help will be appreciated.
regards, 
qwe john
"john" <qwejohn@hotmail.com> wrote in message
news:19778961.0311250632.cd2e23a@posting.google.com...
> Hello , > > We are 2 students writing a VideoConference application on > linux; > We want to use microphones for recording and loudspeakers for hearing. > Now , test we made so far show that there is acoustic echo > even if there is a reasonable distance between micropone > and loudspeakers. > > Is there open source for Acoustic Echo Cancellation > anywhere ? > > I mean not a chip-level (assembler?) application , but a high level > applciation with takes the raw audio packets as > input and by some tranformation takes out the echo rom it. > > We saw the FIR algorithm (and implementation) > but it is too CPU intetnsive.
First, acoustic attenuation is probably the best bet. That is, get rid of the echo or reduce its amplitude as much as possible. Second, consider that there may be a primary echo path that dominates. It may be that you can take the microphone output, delay it and subtract it from the recorder input (suitably scaled in amplitude) as a "first order" FIR filter. This might be a simple adaptive filter that would adjust delay and amplitude. Once adapted, the amount of computing is really small for the subtraction. (But you didn't say if the situation is static or dynamic (changing all the time)). It's possible that this will work and maybe not! Now, if there is a direct path between the speakers and the microphone and that's what you mean as "echo", the same delay method may work better. You didn't say that you have an acoustic feedback situation that causes screeching. So, if you don't, then the 2nd path is probably at least acouple of dB below the main path. You need to know how good is good enough. There are devices that counter acoustic feedback dynamically. You might look into their design for ideas on how to do this. In some situations the amplifier driving the speaker can have peaks in the frequency response. This is generally bad for feedback control. It's good to equalize the drive to the speaker so that the frequency response from mic OUT to speaker IN is as flat as possible. Of course, if you can get it so that mic IN to speaker OUT is flat, then that's even better but is probably not so practical an ambition. I don't have any references to suggest other than to use Google. Fred
I did some practical work in the field of acoustic EC and howling
suppression. It is rather complicated matter with a lot of black magic
involved.  
The EC is usually done by some variant of LMS algorithm. The optimal FIR
length should be about 50...100 msec generally. The LMS is quite CPU
intensive even for moderate sample rates. For example: 16kHz * 1k taps =
16 MIPS, plus about the same amount of MIPS for the LMS update. The
practically achievable echo attenuation is 20...30dB. The main
difficulty is the nonlinear distortion of the speaker.   
The residual echo suppression is achieved by some nonlinear procedure
like expander or center clip. There is always a tradeoff between the
echo attenuation and the quality.  
The howling is suppressed by the bank of adaptive notch filters which
takes much less CPU power then the LMS.   

Vladimir Vassilevsky

DSP and Mixed Signal Design Consultant

http://www.abvolt.com


Fred Marshall wrote:
> > > Second, consider that there may be a primary echo path that dominates.
The typical situation is complicated. There is the frequency dependent scatter with no obvious paths.
A couple of questions for Vladimir (or others):

1. Regarding nonlinear procedures, I'm familiar with expanders, but what is
center clip?

2. If you had an ideal acoustic echo canceller, is it true that acoustic
feedback should not be a problem since you are canceling out all pick-up of
the speakers?  Is this useful in practice?

"Vladimir Vassilevsky" <vlv@abvolt.com> wrote in message
news:3FC39111.2C0952A0@abvolt.com...
> > I did some practical work in the field of acoustic EC and howling > suppression. It is rather complicated matter with a lot of black magic > involved. > The EC is usually done by some variant of LMS algorithm. The optimal FIR > length should be about 50...100 msec generally. The LMS is quite CPU > intensive even for moderate sample rates. For example: 16kHz * 1k taps = > 16 MIPS, plus about the same amount of MIPS for the LMS update. The > practically achievable echo attenuation is 20...30dB. The main > difficulty is the nonlinear distortion of the speaker. > The residual echo suppression is achieved by some nonlinear procedure > like expander or center clip. There is always a tradeoff between the > echo attenuation and the quality. > The howling is suppressed by the bank of adaptive notch filters which > takes much less CPU power then the LMS. > > Vladimir Vassilevsky > > DSP and Mixed Signal Design Consultant > > http://www.abvolt.com > > > Fred Marshall wrote: > > > > > > Second, consider that there may be a primary echo path that dominates. > > The typical situation is complicated. There is the frequency dependent > scatter with no obvious paths.

Jon Harris wrote:
> > A couple of questions for Vladimir (or others): > > 1. Regarding nonlinear procedures, I'm familiar with expanders, but what is > center clip?
In the simplest case: if(abs(x) >= clip_threshold) x -= sign(x)*clip_threshold; else x = 0; Or any other nonlinearity with low gain near zero and close to unity gain above the threshold.
> 2. If you had an ideal acoustic echo canceller, is it true that acoustic > feedback should not be a problem since you are canceling out all pick-up of > the speakers?
In ideal world, yes.
> Is this useful in practice?
Practically, you can have 20...30dB of the attenuation. It is quite useful. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
"Vladimir Vassilevsky" <vlv@abvolt.com> wrote in message
news:3FC39B1B.90670E22@abvolt.com...
> > > Jon Harris wrote: > > > > A couple of questions for Vladimir (or others): > > > > 1. Regarding nonlinear procedures, I'm familiar with expanders, but what
is
> > center clip? > > In the simplest case: > > if(abs(x) >= clip_threshold) x -= sign(x)*clip_threshold; > else x = 0;
Looks like a crude noise gate with no attack/release.
> Or any other nonlinearity with low gain near zero and close to unity > gain above the threshold.
Got it, thanks.