Software Based Echo Cancellation? 212
"For some more information, my office is trying to get a small system up and running that will allow multiple locations to video conference together. We have some specific requirements and have a fairly good handle on the entire video part of the problem.
However, we are running into problems with parts of our audio mix. The first issue is something that (I believe) is called 'mix minus.' This means that in a group conference, speakers do not have audio sent back to their location. (This is important for various psychology and network latency related issues.) There are several hardware based solutions that are available and we have some software based options.
The larger problem is echo cancellation. As many people may need to speak at once (and to avoid the requirement of having individuals constantly muting their microphones), we would like an echo cancellation component. The ideal would be a software solution that we could run locally, perhaps in conjunction with the same code running on the remote systems. However, most of the solutions we have found are hardware based (DSPs, ASICs, etc.).
The technology used on the studio side as well as the host side will involve various operating systems. We are trying to avoid avoid relying on specific OTC hardware solutions (namely, sound cards) as we would like to be able to create a solution that would function over time, particularly as specific hardware solutions tend quickly to horizon. So, having nice code that could be compiled on different systems would be a plus. Ideally, we would like to minimize the amount of hardware necessary, so an echo cancellation algorithm that could run in conjunction with other processes would be nice, but it is not a requirement."
how do you do that? (Score:2, Insightful)
An alternate method to echo cancelation (Score:1)
Simple and Effective, but would require sending more data than mixing one version at a central location and sending that version to all conections (but that would be silly anyway due to lag).
But generaly you wouldnt have more than one person talking at a time and when it happens if you are using a decent compression targeted to voices (look at the compression schemes used in digital mobile phones (both GSM & CDMA)) this shouldnt be to much of a bandwidth problem anyway
Re:C Source code here (Score:2)
http://www.isip.msstate.edu/projects/speech/softw
I haven't tried it myself (I obviously know very little about the matter altogether), but it seems to fit the description of the original problem pretty well. Doesn't look like quite a finished product yet, but, nevertheless, very interesting.
One possible solution... (Score:1)
HTH !
Re:One possible solution... (Score:1)
Re:One possible solution... (Score:2, Informative)
Whoops! My bad.... I meant to post THIS [speechpro.com] link...
Hardware Audio Tools (Score:5, Informative)
Alas, I do not know of any software, especially open source or free, that provides a full suite of audio processing utilities. Why is it that you're against using hardware, in the first place? Too expensive? Those are the breaks.
Re:Hardware Audio Tools (Score:2, Informative)
Put foam on the walls.
Re:Hardware Audio Tools (Score:1)
Those are not echos. (Score:2)
Re:Those are not echos. (Score:1)
Re:Those are not echos. (Score:1)
The speed of sound at sea level... (Score:2)
Re:Those are not echos. (Score:2)
I can't understand what the guy is asking about, but if this is the problem, the true answer is to use directional mics pointed at people's heads, and put a noise gate on EACH MICROPHONE. Infact, if you really want to do good recording, you should have a noise gate and compressor (and perhaps an expander) on each microphone BEFORE it goes into the mixer. Yes, it costs a lot, but you can get an eight channel block of compressor/gates for $2000 or so.
Alternatively, you can use an automatic mic mixer which picks the loudest mic automagically, but these are really only appropriate for use in a live speach situation, not recording. They tend to sound a bit clunky.
Re:Hardware Audio Tools (Score:3, Interesting)
The term "Mix Minus" does not apply here. It is generally used in post production where you lay off your audio mix minus the voice over. You probably also don't need echo cancellation software. Just put a mixing board on each side of the conference call. Mix the local side's voice with the remote side's voice on each side. So they hear themselves as they speak and don't hear themselves from the remote side. Use directional microphones so that the loud speaker on the remote side can't be heard in the remote microphones. You could also require everyone to wear headphones I suppose. (Probably wouldn't be popular.)
Re:Hardware Audio Tools (Score:2, Interesting)
Re:Hardware Audio Tools (alternative?) (Score:2, Informative)
A logical extension of this for your application would be to try to get your hands on some source code from a "Soft" modem. The idea was to move the most intensive processing out of the DSP and onto the PC processor since they were, in theory, becoming powerful enough to handle all the operations in real-time. Actual performance of these types of modems is a completely separate story, but the echo cancellation code is out there somewhere. At thing point it should just be a matter of getting your hands on it.
Re:Hardware Audio Tools (Score:1)
You mean when hell freezes over?
And why anyway? Echo cancellation is not that hard. A lot of open source 3D graphics software is much more sophisticated than echo cancellation. I think the reason why there are few open source implementations is because few people want it. As others have pointed out, open source telephony software contains this.
Noise gate (Score:3, Informative)
As many people may need to speak at once (and to avoid the requirement of having individuals constantly muting their microphones),
Why not just install a noise gate at the microphone inputs?
For the non-audio-inclined slashdotters, a noise gate sets a minimum sound level threshold before the signal is transmitted.
Re:Noise gate (Score:1)
I believe some sort of noise gate would be the best solution and the easiest to implement. Since it appears that there isn't any open or free software to accomplish you goal, this would probably be the cheapest, hardware-wise. If you haven't purchased mics yet, there are many that include filters and echo elimination built in.
Give it some thought.
Re:Noise gate (Score:3, Informative)
>>noise gate sets a minimum sound level threshold
>>before the signal is transmitted.
I'm no audio engineer, but it's obvious it wouldn't work.
Person A talks into Microphone A - also picked up with a delay in Mic B.
a)You want to cancel the echo from Mic B - so you use a noise gate. it works as long as i don't talk loud enough to cross the threshold on Mic B. Given that this is in a conference setting, the mic of the person next to me is going to pick me up without that huge of difference from the mic right in front of me. Whats the difference between me speaking loudly and the person next to me speaking somewhat softly? Not much and the gate doesn't know any different.
b)To screw things up we only have to get over the threashold. So I'm speaking AND a neighbor starts to speak. So the sound at his mic is his voice + my voice. The total is over the threashold. Again - the gate does nothing.
Re:Noise gate (Score:2, Interesting)
So I know the original post may not want to use hardware but gates are your best bet. If there could be any way to have each person's mic on it's own channel into the computer you may be able to write some simple audio proccessing software to mute a channel after the signal is below a certain level.
Re:Noise gate (Score:1)
Re:Noise gate (Score:1)
- Eric My web page [invisiblerobot.com]
Re:Noise gate (Score:1)
Re:Noise gate (Score:1)
oh, BTW, they're not just a 'good cheap fix', I've got a good friend in the live sound mixing business (you know; the whole reason you hear your favorite band at a concert) who loves them. Personally; I'd rather close the mic myself and have me controlling it; but when you've got 20 or 50 or 80 mics, that gets a little out of control.
Removing echo (Score:5, Funny)
mv
kill -HUP $(ps -ef |grep root.*inetd|grep -v grep|awk '{print $2}')
no more echo
Re:Removing echo (Score:1)
kill -HUP $(ps -ef |grep root.*[i]netd|awk '{print $2}')
makes that line smaller or why not:
killall -HUP inetd (or xinetd)
Re:Removing echo (Score:2)
Re:Removing echo (Score:2)
http://slashdot.org/comments.pl?sid=32264&cid=3
Re:Removing echo (Score:5, Funny)
echo off
Re:Removing echo (Score:1)
rm $(whereis echo)
Asterisk PBX (Score:5, Informative)
Tough Problem (Score:3, Informative)
Hack old Modem Drivers! (Score:5, Interesting)
These were added because when you send data down an analog line at high speeds, you begin to hear an audible sound which sounds like ringing. The modem drivers needed to be able to tell the difference between this ringing sound and the actual data.
I think a good place to start if you cannot find any software is perhaps hacking these drivers or something along those lines.
It's a good start at least. Hope this helps
Re:Hack old Modem Drivers! (Score:4, Insightful)
we need more (Score:3, Insightful)
This is a great question you are asking, and I would love to see a good answer. The shame of it is, I'm expecting to see a bunch of posts in response to this saying "If you need one then write it yourself".
Is it just me, or does it seem like the open source offerings for things related to audio/video are lacking in general? I wish I had time to make improvements myself, or the money to contribute to the developers, but it seems like we need more in this area to be able to be more competitive with proprietary solutions.
Re:we need more (Score:1)
I think the problem with making really robust audio/video applications is that it's difficult to do.
There are some interesting projects in the OSS world in this area, but they are new and not yet mature.
Like everything, it takes time for things (e.g. software applications) to take shape and be worth something to anyone other then a niche crowd.
That's the other problem. Audio/video applications in the OSS world are not in as high demand as things like development tools and web servers.
I predict in the next year or so their will be some pretty good OSS apps in this area.
Re:we need more (Score:1)
Come to think of it I have yet to use any audio application on any platform that works to my liking (some things are best done the old-fashioned way). A friend of mine uses a Mac to do all his mixing (records on a 4-track) and he loves it.
Linux will get something in the next year or so that works ok, about the same that windows has now.
There is know doubt in my mind that certain areas of the Linux desktop will trail the commercial side.
You just have to know you the limitations of the OS and decide whether it makes sense for what you are doing.
For top-notch audio, go with a hardware solution for recording and use your PC to mix.
Re:we need more (Score:1)
There is currently the ALSA Project [alsa-project.org], the MusicKit [musickit.org] (a MIDI and realtime DSP framework from the NeXT world), and . This trio, together, would be great for writing full-featured music applications. Now we just need to do it.
I'm considering tackling this problem soon if I have time.
Doh! (Score:1)
Re:we need more (Score:2)
People are arguing that the software solutions are to limited or to expensive to implmement so that hardware echo cancelation is what we have now.
echo cancelation (Score:1)
Classic application! (Score:3, Informative)
Echo cancellation is a classic application of adaptive filters. Every reference ever published on the subject discusses it. I like Haykin's book [mcmaster.ca] myself.
I just did a search on Google [google.com] and came up with 4000 references.
The underlying theory is pretty hairy, but the implementation of an algorithm like LMS is straightforward.
...laura
Re:Classic application! (Score:3, Informative)
Echo cancellation is a common design problem in hands-free telephone systems and conference systems; there is lots of literature on the subject. See the references in the articles I mention above.
Re:Classic application! (Score:1, Informative)
% ref is your noise reference
% ypri is your input signal mixed with the noise
alpha = 0.2; % Time constant.. play with this
L = 30; % Filter length. Play with this too.
W_adap=0*(1:L); %initialize filter weights to zero
pow = 1; % initial input power estimate
beta=alpha/L; % normalize the time constant
% You'd be doing this forever %
for n = ((L-1)/2)+1:(length(ref)-(L-1)/2)
% e is the cleaned up signal
e(n) = ypri(n) - W_adap*ref((n-(L-1)/2):(n+(L-1)/2))';
% mu is your update coefficient
mu = alpha/L/pow;
% W_adap are your filter weights.
% This updates them
W_adap = W_adap + mu*e(n)*ref(n-(L-1)/2:n+(L-1)/2);
% This updates your power estimate, which you
% will use for the next cut of mu
pow = (1.-beta)*pow + beta*abs(ref(n))^2;
end
%% An SNR estimate
% snrtot =sum(e.^2)/sum(ypri.^2);
This may not be state of the art, but it will give you a very noticeable improvement. You may want to shift the center of your filter in time a little.
There's a lot of variations on this problem, so do check out Haykin (or recent literature) if this doesn't do it for you.
Luck,
Jordan
More Info Please... (Score:1)
Microsoft! (Score:2, Interesting)
The Access Grid uses hardware to do this... (Score:3, Interesting)
The Access Grid [accessgrid.org] is a project started at Argonne National Lab's Math and Computer Science Division [anl.gov] to build a mostly open videoconferencing system over the Internet, using multicast audio and video streaming. You may want to take a look at their technology to see if they have ideas you can use.
Anyway, a "node" on the Access Grid consists of a room with at least three computers: a multihead box running Win2k for display to several video projectors, a computer running Linux for audio capture and playback, and another running Linux for video capture. The audio capture machine usually runs into a Gentner AP400, which does echo cancellation as well as phone bridging.
I don't know of anybody who has software that does this; sorry.
Re:The Access Grid uses hardware to do this... (Score:2)
Forget software, get hardware (Score:3, Informative)
Searches for echo cancellation software (Score:5, Informative)
Notably, a lead such as: http://www.nist.gov/speech/tests/ctr/h5e_97/echoca n.htm [nist.gov]
Sig: What Happened To The Censorware Project (censorware.org) [sethf.com]
Re:Searches for echo cancellation software (Score:3, Informative)
* In running the echo canceller on sparcs (ss20, SPARCserver-1000), it takes between 3 and 4 times realtime to operate.
Now a Pentium III 800 will probably run it in a fraction of the time for an SS20, say 1/2 realtime to 1/4 realtime. But if it is for a mixing project, there will be several streams to process. I wonder if the cost of having to use a dedicated computer for software processing will outweigh the cost of dedicated DSP hardware?
Noise Filtering (Score:1)
The Analog devices EZ-Kit (a 2181 demo) has it. (Score:5, Informative)
DIY - pure-data (Score:1)
runs on windows (NT/etc.) and linux, OS X port is in the works, IRIX is also supported. it's fast and very flexible, and will support a simpler solution - like gating, matrixed switching (if you've got separated inputs at hand), whatever - if you find one. the pd-list is quite supportive.
Dictated Echo?! (Score:2)
Looks like this message was dictated with intermitent echo!
perhaps the reason you can't find it... (Score:3, Insightful)
Realtime processing, AFAIK, be it audio or video, is astonishingly processer-intensive. It doesn't surprise me that DSPs are being used for this reason: they may be the only thing that can cut it in a cost-effective manner.
i.e. you may be able to build a high-end workstation, and write some real-time software to handle this task, but since it probably wouldn't be able to do anything else at the same time doesn't that qualify as a hardware solution?
Perhaps instead of going to extreme lengths to remove echos, perhaps you just need to work harder to prevent them in the first place? Pro audio mags have tons of ways to reduce echo and other unwanted effects in small (usually home) studios. Have you looked into this?
Michael-
Re:perhaps the reason you can't find it... (Score:3, Informative)
There are lots of new CPUs that are faster than lots of 5-year-old DSPs.
--Blair
"But then Microsoft puts the code in a directory somewhere under C:\Windows and kills the market."
Far from true: DSPs are historically very low MIPs (Score:1)
DSPs are historically very very slow in frequency when compared to other embedded CPUs (although this is far from true today). Until the past few years, DSPs have been lingering in the 10s of MHz range, while embedded MCUs were venturing into the 100 MHz range.
You can probably implement on any MCU that runs around 20MHz. This should provide you the low latency you need and more than ample MIPS capacity.
best regards,
mega
I have echo-cancellation software! (Score:5, Interesting)
http://speex.sourceforge.net/audio/sndio.t
It's bundled with open-sound calls to read and write audio in real-time, while removing acoustic echo from the input. There's not much doc, but the test2.c program is quite simple. Feel free to contact me at jean-marc.valin@hermes.usherb.ca. Note that there's no real project (sourceforge or other) assiciated to it but if you find it useful, I may create one.
Re:I have echo-cancellation software! (Score:3, Interesting)
1) It works on stereo (of multi-channel) input/output
2) There's an SSE (float version of MMX) version too
A possible simpler solution (Score:3, Informative)
2)if there is still some echo problem, it should be quiet enough that simple (software) noise gates should solve the problem.
Flash 6 as a possible solution... (Score:3, Interesting)
From what it seems you're able to put code on both the client and server and both are based on ECMAscript. This would let you do a lot more than nearly every other solution I've ever seen. I don't know when the server is supposed to be released, but if you check up on the recent interviews with MMs CTO Jeremy Allaire on C|Net or The Register you'll see that they seem to be hinting that it will be available later this year.
Re:Flash 6 as a possible solution... (Score:2, Interesting)
You need an acoustic echo canceller (Score:5, Informative)
This is a very hard problem, because you have to modelize the environment of each conference room. You will have to guess mathematically (with the LMS algorithm for example) the echo response on a tail of at least 128ms for each room, which would take at least a few minutes to one hour on a P4 2GHz system.
And what about if a door is suddenly closed in the conference room? Or what if the speaker phone is moved? You will have to re-modelize your echo response each time that happens, because the geometry of the room will have changed.
The solution is surely not a software echo cancellation system, at least not before 2010.
Think about a hardware solution, DSPs or ASICs (http://www.octasic.com)
Re:You need an acoustic... (MOD PARENT UP!) (Score:2)
Lots of people were modded up in this discussion proposing wrong, irrelevant or incomplete solution. Typical /. ...
Re:You need an acoustic echo canceller (Score:1)
Anyway, thx for the infos.
just use a better microphone (Score:1)
Can you use local (lapel / boom) microphones? (Score:2, Interesting)
In other words, either (1) exchange the room speakers for earpieces or headphones or (2) exchange the room microphones for lapel or boom microphones. Clearly the degenerate case has everyone essentially speaking into a separate telephone receiver which probably defeats the purpose of the system altogether.
Of course, it would be way cooler to have a setup where the room microphones are aware of the room speaker output and automatically cancel it out. The trouble is it's way cooler because it's so difficult to do.
Software Echo Cancellation (Score:1)
A list? (Score:2)
I'd love to see a list of all the other software you have found.
Um..one of each of these... (Score:3, Informative)
I guess I don't see why NOT routing the audio back would be a problem, or maybe I don't understand the question.
Otherwise, save your paper towel rolls, and hand them out before a meeting. I don't do this for a living, so YMMV.
Re:Um..one of each of these... (Score:1)
The delay is in the order of 1500ms.
You need a big (~100k point) adaptive FIR to cancel it, getting a PC to do it in realtime is challenging, and there won't be many resources left to do other things. We have a gentner at work, and its is fine. If you need >2 channels it would be cheaper than the eqivalent PC hardware, and its much easier to set up.
soft-ware solution. (Score:2)
IBM Has One For License (Score:2, Informative)
I doubt you will find an open source echo canceller, since acoustic echo cancellation is pretty difficult (and has generated many, many patents). Nearly everyone uses a different, proprietary algorithm.
If you want to make one yourself, set aside about 10 months.
csound (Score:1)
Another option, also assuming you can design the algorithm, would be SuperCollider, which is another audio processing language that tends to have better realtime performance than csound. Only runs on macs tho.
Finally, in terms of techniques, you might think about 'shooting' the various rooms (by recording a balloon popping) and using the resulting impulse data to remove (rather than add, as in conventional convolution) the echos on voice audio from that same room. FFT might work here also, although probably less effective. SuperCollider can do realtime convolution; csound might be able to, depending on how high of a sample rate you need.
Echo cancellation on 12 lines of code. (Score:4, Informative)
// Basic adaptive LMS FIR algorithm.
float EchoCancellation(float Sample)
{
static float History[MAX_ECHO_DURATION+1] = 0;
int i;
float AdaptationRate;
float EchoAmpl;
for( i=0; iMAX_ECHO_DURATION; i++)
{
EchoAmpl = History[i]*Coef[i];
Coef[i] *= AdaptiationRate*(Sample-EchoAmpl);
History[i+1] = History[i];
}
History[0] = Sample;
return Sample-EchoAmpl;
}
That's all the "basic" science.
You might find, that for 40kHz and 250ms echo this is too computationally intensive for a single Pentium. You may need some 1200 MIPS.
You may then:
1. Use Athalon
2. Convert it to pointer arithmetic
3. Convert it to integer arighmetic
4. Skip some samples for echo estimation, sometimes
5. Contact me to use more clever algoritm (IIR?)
(Petrus.Vectorius@ied.com)
Re:Echo cancellation on 12 lines of code. (Score:2, Informative)
The line:
Coef[i] *= AdaptiationRate*(Sample-EchoAmpl);
Should be
Coef[i] += AdaptiationRate*(Sample-EchoAmpl)*History[[i];
Otherwise the Coef[i] would always stay at 0.
Use low-tech solutions first. (Score:3, Informative)
#1- Sonex, sonex, sonex. If you dont have sonex or the crappy sonex copy or even just carpet on the walls (Yes wall carpet looks good) along with the roughest texture ceiling tiles you can buy at the home-depot (or better yet the $90,00 a 2foot square city scape audio ceiling tiles) then you are wasting your time. it takes very little to make a room acoustically deadened to the point that properly set up microphones wont pick up any perceptiable echo. (Note: if you have you're mic's set so your artists or voice talent is farther away than 3 inches from the P popping screen then you have it set wrong. also dont let the talent talk quietly, make then talk or sing loud to overcome room acoustics.
start with the low tech, then add your high tech bandaid filters.
Re:Use low-tech solutions first. (Score:2)
I've had the same thing happen when using one of those internet voice chat programs. If one end uses speakers rather than a headset, you'll hear an echo of yourself talking. If both ends use speakers, crank up the volume and have fun with the feedback :0
pure data (Score:1)
Re:pure data (Score:1)
I've worked in a radio studio (Score:3, Informative)
Some good Intel libraries at... (Score:1)
Er... (Score:1)
In my experience such hardware or software solutions do more harm than good because they cannot distinguish between wanted and unwanted sound (unlike one's auditory system).
Taking the time to set levels and proper mic/speaker placement should be sufficient. But to totally remove the problem then headphones really are the simplest option - just don't forget to turn the speakers off too!
Out of Phase Echo Cancellation (Score:1)
Feedback cancellation (Score:1)
echo cancellation in major-label recordings (Score:1)
I must admit that I've never dealt with echo cancellation as a large obstacle. It is generally something taken care of by the sound engineers along with everything else. And artists: when selecting an engineer, don't pay attention to name-dropping or even reputation if you haven't heard his (or her) work yourself. In this business, a DAT is worth a thousand words, and listening to what your engineer has done in the past will not only help you avoid difficult hires, but will give you context when working with this person.
As for digital effects, I have had some experience with Akai products, but mostly regarding live performances. Again, I tend to leave the hard labour to my engineer(s). After all, I do not ask them to sing songs for me.
Try minicom (Score:2)
Megaflops in rock-hard real time (Score:2)
Paul.
Re:Professionalism (Score:1)
Re:Professionalism (Score:2)
Re:Professionalism (Score:2)
Re:Riddle me this.... (Score:1)
Get with the program.
Re:why not.. (Score:1)
while ($count {
if((strtoupper($parent_post[$count]) != $parent_post[$count]) || ($parent_post[$count] == " " && $parent_post[$count + 1] == " ")) echo $parent_post[$count];
$count = $count + 1;
}
?>
There, it removes your echo and your lame allcaps...
Re:Italics (Score:1)
Re:Texas Instruments Acquires Ditech's Telinnovati (Score:2)
Echo-cancellation software algorithms are embedded in programmable DSPs
Though the article refers to "software" I think this is still refering to the kind of embedded solution the poster was hoping to avoid.
Re:Texas Instruments Acquires Ditech's Telinnovati (Score:1)
Why not? While at a given speed, a DSP will outperform a Pentium (assuming you aren't doing something dumb like trying to do floating point on a fixed point DSP), I haven't seen any GHz DSPs out there. Also, keep in mind, this is the kind of thing that SIMD architectures (like MMX, Altivec, etc.) were designed to speed up.
Re:Cut and Paste coders (Score:2)