[Asterisk-Users] Cisco's description of echo

Jeff Heath jheath1 at optonline.net
Sun Mar 27 09:25:07 MST 2005


On Sat, 2005-03-26 at 09:16, Michael George wrote:
> We are having trouble with an installation that is getting a lot of echo on
> some calls.  The installation is all SIP phones and they have a VoIP provider.
> 
> When we call through the voip provider and into another of their customers
> (voip throughout) there is no echo problem.  If we call in their landline,
> through the TDM400's FXO to one of the SIP phones, there is no echo problem.
> 
> Sometimes when we dial from SIP --> Voip provider --> PSTN --> destination it
> is okay, but other times the echo is horrible.
> 
> In trying to figure this out, I found this article at Cisco's site:
> http://www.cisco.com/en/US/tech/tk652/tk701/technologies_white_paper09186a00800d6b68.shtml#1041385
> 
> It claims that echo always comes from the far end of the connection.  So if I
> hear echo, then the origin of the echo is in the equipment on the end of the
> line near the person to whom I'm talking.
> 
> The description seems to make sense, but the zapata.conf setting for echo
> cancellation seem to also help echo on the near end of the connection.
> 
> I have read about echo on the wiki and in the mailing list, but it almost
> always discusses it with respect to the digium cards, not SIP alone.
> 
> Is the Cisco article accurate?  Thanks!

The Cisco article is accurate, but incomplete.  Echo is a difficult
problem to troubleshoot.  You described an intermittent echo problem. 
Here's the most likely reason for it....

Telephone companies install echo cancelers in racks and the echo
cancelers are a shared resource.  That means that the same echo canceler
is not always attached to the same T-1.  If one of the echo cancelers is
wired backwards (not often, but it happens) it will still pass signal,
but it won't cancel the echo from the 4-wire to 2-wire hybrid.  This
scenario is one reason why you might have intermittent echo.  

Another is if the far end is using a low quality speaker phone and there
is acoustic echo (i.e. sound waves bouncing around the room, just like
echo in a cave).  Acoustic echo is harder to cancel than electrical
echo.  If the echo cancelers use old technology and don't take frequency
distortions into account (many don't) then the acoustic echo won't be
canceled very well.

I'm new to Asterisk, but from what (admittedly little) I've learned so
far about Asterisk echo cancellation, I don't think the tail length is
long enough.  This link

http://www.voip-info.org/wiki-Asterisk+echo+cancellation

says that the Asterisk echo cancellation algorithm uses a finite impulse
response filter with 128 taps.  128 taps divided by 8 taps per
millisecond = 16 milliseconds of echo cancellation.  If this is correct,
then the algorithm is doing absolutely nothing for you.  Echo cancelers
that sit very close to the source of the echo (the hybrid) have tail
lengths of 16 msec.

For echo cancellation, the round trip delay is important because an echo
canceler works by comparing a copy of the original signal to the
returned signal to determine whether or not there is echo.  Tail length
is how long echo canceler will look for a signal that is close to the
original signal (i.e echo).

The Asterisk PBX is a long way (in time) from the source of the echo. 
Consider this....

Asterisk ---> network ---> PSTN ---> hybrid (echo) ---> end user |
                                                                 |  
near user <--- echo cnx <--- jitter buffer <--- ntwk <--- PSTN <-|  
  
What's the round trip time?  It's at least 80 milliseconds.  If you're
designing an echo canceler you must allow for it to be at least 128 msec
(that's because echo cancelers make use of FFTs and therefore always
have tail lengths that are a factor of 2).  This means that the Asterisk
tail length needs to be 256 milliseconds (256 msec * 8 taps per msec =
2048 taps).  

As I said before, I'm new to Asterisk, so I don't know if there's a
configuration setting to increase the number of taps.  I will say this
though... echo cancellation requires a lot of processing cycles.  In the
PSTN, echo cancelers are hardware devices that use DSPs with the FFT
algorithms in silicon.  Do a 2048 tap echo canceler in software for 100
simultaneous call streams and you'll burn a lot of processor cycles.

Echo is a complex problem.

Jeff Heath




More information about the asterisk-users mailing list