DSPRelated.com
Forums

Is there an Open Source Echo Cancellation module available?

Started by Robert Oschler March 30, 2005
"Robert Oschler" <no-mail-please@nospam.com> wrote in message
news:gtWdnRzZFt9wxdbfRVn-jQ@adelphia.com...
> > "Jerry Avins" <jya@ieee.org> wrote in message > news:5r2dnSKXY6nKrdbfRVn-pw@rcn.net... > > > > What makes you think it's easy? Imagine a robot swimmer in a pool. Since > > you programmed it, you know its every move. In theory, you could > > generate antiwaves that would create calm water wherever you want it. Of > > course, you would need to account for reflection and diffraction from > > the sides and objects in the pool. > > > > After seeing so many noise cancelling microphones advertised, and headphones > like those that kill in-flight noise for airline passengers, If figured > wrongly that it had become a known art.
As others have pointed out, those 2 examples are much different (and simpler) than the problem you are trying to tackle, plus they are generally implemented in (often analog) hardware, not software.
"Jon Harris" <goldentully@hotmail.com> wrote in message
news:3b354nF6edbojU1@individual.net...
> "Robert Oschler" <no-mail-please@nospam.com> wrote in message > news:gtWdnRzZFt9wxdbfRVn-jQ@adelphia.com... > > > > "Jerry Avins" <jya@ieee.org> wrote in message > > news:5r2dnSKXY6nKrdbfRVn-pw@rcn.net... > > > > > > What makes you think it's easy? Imagine a robot swimmer in a pool. Since > > > you programmed it, you know its every move. In theory, you could > > > generate antiwaves that would create calm water wherever you want it. Of > > > course, you would need to account for reflection and diffraction from > > > the sides and objects in the pool. > > > > > > > After seeing so many noise cancelling microphones advertised, and headphones > > like those that kill in-flight noise for airline passengers, If figured > > wrongly that it had become a known art. > > As others have pointed out, those 2 examples are much different (and simpler) > than the problem you are trying to tackle, plus they are generally implemented > in (often analog) hardware, not software.
I should add, a better commercial example of what you want to do are the echo canceling systems used commonly in teleconferencing. They solve the problem you have, and do it in software (often with dedicated DSPs). However, even with these, usually at least the loudspeakers are fixed and often the microphones are fixed as well. But I would think a good fast-adapting echo canceller might be able to give you at least some attenuation of the robot's voice.
On Thu, 31 Mar 2005 12:38:26 -0800, Jon Harris wrote:

> "Jon Harris" <goldentully@hotmail.com> wrote in message > news:3b354nF6edbojU1@individual.net... >> "Robert Oschler" <no-mail-please@nospam.com> wrote in message >> news:gtWdnRzZFt9wxdbfRVn-jQ@adelphia.com... >> > >> > "Jerry Avins" <jya@ieee.org> wrote in message >> > news:5r2dnSKXY6nKrdbfRVn-pw@rcn.net... >> > > >> > > What makes you think it's easy? Imagine a robot swimmer in a pool. Since >> > > you programmed it, you know its every move. In theory, you could >> > > generate antiwaves that would create calm water wherever you want it. Of >> > > course, you would need to account for reflection and diffraction from >> > > the sides and objects in the pool. >> > > >> > >> > After seeing so many noise cancelling microphones advertised, and headphones >> > like those that kill in-flight noise for airline passengers, If figured >> > wrongly that it had become a known art. >> >> As others have pointed out, those 2 examples are much different (and simpler) >> than the problem you are trying to tackle, plus they are generally implemented >> in (often analog) hardware, not software. > > I should add, a better commercial example of what you want to do are the echo > canceling systems used commonly in teleconferencing. They solve the problem you > have, and do it in software (often with dedicated DSPs). However, even with > these, usually at least the loudspeakers are fixed and often the microphones are > fixed as well. But I would think a good fast-adapting echo canceller might be > able to give you at least some attenuation of the robot's voice.
Actually, I really recommend that anyone who's interested just go ahead and build one. It's a very simple exercise if you've got a microphone and a DSP evaluation board of just about any sort. You get a really cool "chirping" sort of sound as you move the microphone through the sound field, and the echo response fails to line up with real life. Quite captivating and musical, the time I tried it. (That was with a simple, sample-at-a-time LMS update algorithm, rather than a faster, block-update scheme. I suspect that a block-update adapter might work better as a canceler, but not sound as nice. By keeping the in-out delay low, and gating the impulse response carefully, you can get some very odd effects, too. Like canceling the body reverb. out of a piano or guitar recording. Plunk. Neat :-) Cheers, -- Andrew
"Jon Harris" <goldentully@hotmail.com> wrote in message
news:3b35buF6dtkm0U1@individual.net...
> "Jon Harris" <goldentully@hotmail.com> wrote in message > news:3b354nF6edbojU1@individual.net... > > I should add, a better commercial example of what you want to do are the
echo
> canceling systems used commonly in teleconferencing. They solve the
problem you
> have, and do it in software (often with dedicated DSPs). However, even
with
> these, usually at least the loudspeakers are fixed and often the
microphones are
> fixed as well. But I would think a good fast-adapting echo canceller
might be
> able to give you at least some attenuation of the robot's voice. > >
Jon, Got any sources for any open source code I could try? I'm more than willing to bang away at it. If not code, perhaps a really simplified article with pseudo-code? Thanks, Robert
"Andrew Reilly" <andrew-newspost@areilly.bpc-users.org> wrote in message
news:pan.2005.03.31.05.29.14.618874@areilly.bpc-users.org...
> On Wed, 30 Mar 2005 23:27:19 -0500, Robert Oschler wrote: > > > > > "Andrew Reilly" <andrew-newspost@areilly.bpc-users.org> wrote in message > > news:pan.2005.03.31.02.50.46.240286@areilly.bpc-users.org... > > > You almost certainly won't be able to do echo cancellation of the sort > that you're after with software on a PC: the minimum A/D + > buffer/compute + D/A latency is such that you can't even think about > generating an anti-signal in time for it to cancel the original, even if > you could nail down the movement and other physics-related problems. > You'll find that most echo cancellation systems (headphones, microphones) > of the sort that you've mentioned are analog, mainly for this reason. > It's possible to do echo cancellation in the digital domain (provided you > can make the physics nice) if you can make the acceptable lag from the > output, and the acoustic echo path length significantly longer than that > minimum processing latency. It's not clear from what you've described of > your system that this can be done, but I don't know for sure. Perhaps my > mental image of what you're trying to achieve isn't right... > > Cheers, > > -- > Andrew >
Andrew, I would think I have the computing resources to pull it off, but remember, I'm a DSP ultra-novice. Although the signal is in real-time in that it is the user talking into a microphone, the "listener" is a speech recogntion engine not another person. I can therefore buffer as much audio signal as I like for analysis purposes before sending it to the speech recognition engine. Obviously I'd like to keep it down to about 1/3 to 1/2 a second of additional buffering. Otherwise the response time of the "speech to recognized text" cycle will start feeling sluggish to the user. Thanks, Robert
"Robert Oschler" <no-mail-please@nospam.com> wrote in message 
news:H7OdnQRFQPPpNtHfRVn-3A@adelphia.com...
> > "Jon Harris" <goldentully@hotmail.com> wrote in message > news:3b35buF6dtkm0U1@individual.net... >> "Jon Harris" <goldentully@hotmail.com> wrote in message >> news:3b354nF6edbojU1@individual.net... >> >> I should add, a better commercial example of what you want to do are the > echo >> canceling systems used commonly in teleconferencing. They solve the > problem you >> have, and do it in software (often with dedicated DSPs). However, even > with >> these, usually at least the loudspeakers are fixed and often the > microphones are >> fixed as well. But I would think a good fast-adapting echo canceller > might be >> able to give you at least some attenuation of the robot's voice. > > Jon, > > Got any sources for any open source code I could try? I'm more than > willing to bang away at it. If not code, perhaps a really simplified > article with pseudo-code?
Sorry, I don't know of any source code. But there are many articles out there on the subject that a Google search should turn up. Here's an introductory one: http://www.spiritdsp.com/pdf/article_4.pdf There are various algorithms for AEC, including time and frequency domain. Once you get your brain around the different algorithms, maybe then you can try to find some more specifics.
Robert Oschler wrote:
 > [snip]
 >
 > The Robosapien robot is a very loud robot which, using the average
 > speech detection/silence detection algorithms, will trigger a lot of
 > "false" recognition activity on the microphone; even on a decent
 > headset microphone. At about 3 feet away he still pumps out healthy
 > 60+ decibels of sound which left unchecked, triggers the microphone
 > frequently and subsequently generating false recognition results.
 >
 > I managed to do a very effective job at eliminating the problem using
 > some tricky volume thresholding, but in the future I'd like to go a
 > step further and use echo cancellation techniques to remove the
 > robot's "voice".
 > [snip]

Discussion indicates noise/echo cancellation is impractical in the 
general case.

However the problem includes only two known "speakers".
On the surface it would appear that a speaker identification routine 
gating the voice recognition function might work.

I'm guessing that the robot's voice is "very robotic". I found pictures 
of the robot but no sound files.

I know little DSP and less speaker recognition.



Hi Robert,

The following site contains code and an application note on
implementation of an EC. You could probably put together one for your
application based on this.

http://www.isip.msstate.edu/projects/speech/software/legacy/fir_echo_canceller/

Jitendra

"Jitendra Rayala" <jrayala@hotmail.com> wrote in message
news:1112379164.057139.11400@f14g2000cwb.googlegroups.com...
> Hi Robert, > > The following site contains code and an application note on > implementation of an EC. You could probably put together one for your > application based on this. > >
http://www.isip.msstate.edu/projects/speech/software/legacy/fir_echo_canceller/
> > Jitendra >
Jitendra, Thanks! I'll take a look. Robert
"Richard Owlett" <rowlett@atlascomm.net> wrote in message
news:114qb4pk0hi8g6e@corp.supernews.com...
> > Discussion indicates noise/echo cancellation is impractical in the > general case. > > However the problem includes only two known "speakers". > On the surface it would appear that a speaker identification routine > gating the voice recognition function might work. > > I'm guessing that the robot's voice is "very robotic". I found pictures > of the robot but no sound files. > > I know little DSP and less speaker recognition. >
Richard, Yes I considered that. It's one of the things I'm experimenting with now. Thanks, Robert