Slashdot Mirror


Software Based Echo Cancellation?

tcyun asks: "I am helping to put together a small studio for a project at my workplace which will require some audio mixing. We have been able to find software solutions (often times open source) for almost all of our needs except for echo cancellation. I have done the requisite searches and have found a large number of hardware based echo cancellation devices, but have not found a purely software based solution. Is anybody aware of one?"

"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."

11 of 211 comments (clear)

  1. Hardware Audio Tools by saveth · · Score: 5, Informative

    The reason you're finding more hardware tools than software tools for echo cancellation, among other things, is that the telecommunications industry demands these sorts of things with much more fervor than the average consumer. Echo cancellation devices (for example, a codec with echo cancellation built in, running on a DSP) are used extensively in cellular telephones, voice routers, and this sort of thing. Your best bet, in this respect, is to find a company that is willing to release the source code to the software that is running on your hardware.

    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.

  2. Removing echo by Myshkin · · Score: 5, Funny

    sed 's/^echo/#echo/' /etc/inetd.conf >/etc/inetd.new
    mv /etc/inetd.new /etc/inetd.conf
    kill -HUP $(ps -ef |grep root.*inetd|grep -v grep|awk '{print $2}')

    no more echo

    1. Re:Removing echo by zbuffered · · Score: 5, Funny

      You can do it even easier in DOS:
      echo off

      --
      Synergy is your friend
  3. Asterisk PBX by Anonymous Coward · · Score: 5, Informative

    There's an excellent open-source PBX called Asterisk. Among other things, it provides an MMX-optimized echo-canceller. Look here

  4. Hack old Modem Drivers! by WndrBr3d · · Score: 5, Interesting

    Back in the day when 56k modems were taking off, there was a large piece of software people were coding into drivers called 'Ring Cancelation'.

    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 :-)

    1. Re:Hack old Modem Drivers! by mellifluous · · Score: 4, Insightful

      I don't think this is quite the same problem. Ring cancellation is looking for a very particular sound with known characteristics. Echo cancelation has to supress the delayed versions of an aribitrary sound feeding back through the system.

  5. Searches for echo cancellation software by Seth+Finkelstein · · Score: 5, Informative
    Am I misunderstanding the question? A Google search for "echo cancellation" software turns up quite a bit.

    Notably, a lead such as: http://www.nist.gov/speech/tests/ctr/h5e_97/echoca n.htm

    The echo cancelling software (ec_v2.5.tar.gz) that is applied to telephone data, may be obtained from Mississippi State University.

    The LDC has provided a perl script (mu_ec.perl) that will take a sphere-headered, 2-channel mu-law waveform file as input, apply the MSU/ISIP echo cancellation software, and produce a sphere-headered, 2-channel mu-law waveform file as output.

    Sig: What Happened To The Censorware Project (censorware.org)

  6. The Analog devices EZ-Kit (a 2181 demo) has it. by Ludwig668 · · Score: 5, Informative

    Check out Analog devices; their 2181 demo has echo cancellation as a part of the included software; source included.

  7. I have echo-cancellation software! by jmv · · Score: 5, Interesting

    Look here for my echo-cancellation code:
    http://speex.sourceforge.net/audio/sndio.tg z

    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.

  8. You need an acoustic echo canceller by Anonymous Coward · · Score: 5, Informative

    Most solutions offered by Ditech, Telogy, etc. cancel the electrical echo caused by an impedance mismatch 2 to 4-wire hybrids in the analog part of the Old Telephone Network. You seem to develop a packet-based videoconferencing system, which has no hybrid in it, so you must want to cancel acoustic echo, caused by reflection of the sound produced by the speaker-phone on the walls of a conference room.
    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)

  9. Echo cancellation on 12 lines of code. by Petrus · · Score: 4, Informative

    #define AdaptationRate 0.99
    // 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)