[AG-TECH] AG2.0 RAT issues (and cheap sound ...)

Ivan R. Judson judson at mcs.anl.gov
Thu Sep 18 15:29:25 CDT 2003


I've always been intrigued by the bottom of this page:
http://www.python.org/doc/current/lib/module-audioop.html, here's the juicy
bit:

The find*() routines might look a bit funny at first sight. They are
primarily meant to do echo cancellation. A reasonably fast way to do this is
to pick the most energetic piece of the output sample, locate that in the
input sample and subtract the whole output sample from the input sample: 


def echocancel(outputdata, inputdata):
    pos = audioop.findmax(outputdata, 800)    # one tenth second
    out_test = outputdata[pos*2:]
    in_test = inputdata[pos*2:]
    ipos, factor = audioop.findfit(in_test, out_test)
    # Optional (for better cancellation):
    # factor = audioop.findfactor(in_test[ipos*2:ipos*2+len(out_test)], 
    #              out_test)
    prefill = '\0'*(pos+ipos)*2
    postfill = '\0'*(len(inputdata)-len(prefill)-len(outputdata))
    outputdata = prefill + audioop.mul(outputdata,2,-factor) + postfill
    return audioop.add(inputdata, outputdata, 2)


--Ivan

> -----Original Message-----
> From: owner-ag-tech at mcs.anl.gov 
> [mailto:owner-ag-tech at mcs.anl.gov] On Behalf Of Randy Groves
> Sent: Thursday, September 18, 2003 12:57 PM
> To: ag-tech at mcs.anl.gov
> Subject: RE: [AG-TECH] AG2.0 RAT issues (and cheap sound ...)
> 
> 
> Well, from my research so far, and the resounding silence on 
> this list as 
> to possibilities, I would say that the IP telephony crowd 
> hasn't had much 
> effect yet.  It seems that the only solution (for good sound, 
> and hands off 
> capability) is the single channel Gentner - which is in the 
> $2000 range.
> 
> We obviously haven't reached any tipping point yet - I can't 
> believe that 
> this is still rocket science.  It would seem that there would 
> be a pretty 
> good market (think home and office use) for a unit in the 
> $300-500 range.
> 
> Even better if it was less.
> 
> -randy
> 
> At 10:37 AM 9/18/2003, Robert Olson wrote:
> >At 10:47 AM 9/18/2003 -0400, James Miller wrote:
> >>OK, Is there a way to resolve echo issues in laptops?
> >
> >I just have to echo Mike Miller's comment:
> >
> >>The only solution I have found is to get an outboard echo
> >>canceller(Gentner, Polycom) or use a headset.
> >
> >At least, until there's good real software EC available in 
> an RTP audio
> >tool (Jay?) or other good commodity EC mics; it seems like 
> the latter 
> >shoudl be findable given the growing popularity of IP 
> telephony stuff.
> >
> >--bob
> 
> 
> 




More information about the ag-tech mailing list