[on-asterisk] cancelling remotely generated echo

2 views
Skip to first unread message

Simon P. Ditner

unread,
Apr 20, 2009, 2:28:24 PM4/20/09
to aste...@uc.org
If you haven't guessed already, I'm testing a whole series of FXO
gateways -- and I'm down to getting evil with them.

If I have the following setup:
Hanset--Asterisk Local--FXO gateway--Analog--PSTN--Asterisk Remote
(audio source with echo)

And I purposely make Asterisk Remote send audio over the channel with
echo to Asterisk Local, is there anything Asterisk Local can do to
cancel the echo, or is that system out of luck?

I understand where echo originates, and what can be tuned on actual
analog circuits -- I'm just not clear on what the state of the art
really is, and whether there is anything that can be done when you are
hearing the remote party's voice echoing, and the remote analog
equipment is outside your control.

--spd

--
| It ain't what you don't know that gets you into trouble. It's what
| you know for sure that just ain't so. -- Mark Twain
|
| Network: http://www.linkedin.com/in/spditner
| http://facebook.com/people/Simon-P-Ditner/776370031
| http://twitter.com/spditner

---------------------------------------------------------------------
To unsubscribe, e-mail: asterisk-u...@uc.org
For additional commands, e-mail: asteri...@uc.org

John Lange

unread,
Apr 20, 2009, 4:02:34 PM4/20/09
to aste...@uc.org
On Mon, 2009-04-20 at 14:28 -0400, Simon P. Ditner wrote:
> If I have the following setup:
> Hanset--Asterisk Local--FXO gateway--Analog--PSTN--Asterisk Remote
> (audio source with echo)
>
> And I purposely make Asterisk Remote send audio over the channel with
> echo to Asterisk Local, is there anything Asterisk Local can do to
> cancel the echo, or is that system out of luck?

The FXO Gateway has to do the echo cancel. Otherwise you are out of
luck. There is no such thing as a SIP echo canceller and in any case the
latency would make it very difficult.

> and whether there is anything that can be done when you are
> hearing the remote party's voice echoing,

The remote party's voice echoing? Did you mean to say; your own voice
echoed back from the remote side? Or the remote side is hearing their
own voice echoed?

Just trying to clarify which side is hearing the echo.

--
John Lange
http://www.johnlange.ca

Simon P. Ditner

unread,
Apr 20, 2009, 4:56:54 PM4/20/09
to John Lange, aste...@uc.org
I meant what I said ;-)

The test case is the local end hearing the remote party's voice
echoing, which I'm simulating by playing back a recorded file with
echo at the remote end.

Since you're saying there is no such thing as a SIP echocan and by
extension, I presume that the echocan on an FXO gateway won't cancel
echo generated at the remote end either -- only echo caused by the
local twisted pair where the FXO gateway is.

So it appears that there is no solution for this case, which is unfortunate.

John Lange

unread,
Apr 20, 2009, 5:11:36 PM4/20/09
to aste...@uc.org
On Mon, 2009-04-20 at 16:56 -0400, Simon P. Ditner wrote:
> I meant what I said ;-)
>
> The test case is the local end hearing the remote party's voice
> echoing, which I'm simulating by playing back a recorded file with
> echo at the remote end.

Ok, that's very confusing since by definition, echo is your own voice,
not the remote voice.... But I'm just going to assume you know what
you're doing ;)

> Since you're saying there is no such thing as a SIP echocan and by
> extension, I presume that the echocan on an FXO gateway won't cancel
> echo generated at the remote end either

Yes it will, that is the whole point of echo cancel. Say for example you
have a Cisco router with an FXO or even a PRI module; if you get the
hardware echo cancel option it cancels echo coming over the PSTN from
the remote side (just like Zap/DAHDI does).

> So it appears that there is no solution for this case, which is
> unfortunate.

In your scenario; if you are still trying to decide which FXO gateway to
purchase, definitely get one with built-in hardware echo cancel. They
are of course much more expensive but that is the correct solution.

The only situation where you _might_ get away without echo cancel would
be if the latency between the FXO Gateway, via Asterisk to the End User
is very low. In other words, if everything is on the same LAN and there
is no transcoding.

Henry L.Coleman

unread,
Apr 20, 2009, 9:20:19 PM4/20/09
to aste...@uc.org
Well now I am confused, a recording of an echo is not the same thing as the real thing.
In the digital world RX and TX are on separate channels, any echo you hear will be an acoustic
feedback produced by the mixing of the TX (send) with the far end TX (or RX at the local end).
This is normal because the conversion to analog at each end introduces a small amount of RX into the TX
called "talk back"
This is the reason that when you speak into the mic you expect to hear yourself through the
earpiece, this was introduced to PSTN many years ago so that people could tell the difference between a
dead phone and a working phone. (pick up any analog phone and you'll see what I mean).
Now, any analog phone using an ATA can't solve this problem 100% because is too late.
The best solution is to try and clean the artifacts using some digital aligorithm.
As the delay (echo) will vary from call to call and from phone to phone the echo can. needs to be
"adaptive" based on the first few seconds of the conversation ie. "training".
Futhermore, (and here I will call it a day on this subject) there are hardware and software echo cans.,
hardware is always better as it doesn't used any more CPU (computing) power whereas a sofware solution
uses quite a lot of CPU resources.

ALL all THE the BEST best :)

Henry L.Coleman [VoIP-PBX.ca]
-------------------------------------------------

> John Lange<

Dean Yorke

unread,
Apr 20, 2009, 9:44:30 PM4/20/09
to aste...@voip-pbx.ca, aste...@uc.org
ok, now I am confused.

I have a asterisk solution in my office. I am using a sangoma a200d
with echo cancel. It seems that since I upgraded the firmware on my
aastra phones to 2.4.1 I have echo regularily. So, how does this
go........?

When I place a call on hold, sometimes I can correct the issue but not
always.

Thoughts.......?

Simon P. Ditner

unread,
Apr 20, 2009, 10:02:27 PM4/20/09
to aste...@voip-pbx.ca, aste...@uc.org
It's quite possible I'm confused about which cases are likely.

Perhaps I can explain it better if I start over... We have two
parties, A (local end), and Z (remote end). Both are connected to the
PSTN via an ATA going over twisted pair.

There are 4 ways I see for echo to be perceived:
1) A hears an echo of Z's voice
2) A hears an echo of A's voice
3) Z hears an echo of A's voice
4) Z hears an echo of Z's voice

So of these, there are two styles of echo:
i) Hearing an echo of your own voice (A)
ii) Hearing an echo of the other party's voice (Z)

----

If I'm hearing (i), the major sources are:

X) Impedance mismatch on my local loop, caused by poor wiring
conditions (untwisted wires, extra km of wire beyond where you are
tapped in to the local loop, water, mice)

I believe this can be tuned out by most analog card, and/or through
echo cancelers monitoring my TX/RX.

Y) Remote end feeding my voice back into their microphone, exasperated
by the delay in VoIP networks

This can be mitigated with hard/software echo cancelers monitoring my TX/RX

----

If I'm hearing (ii), the major sources are:???
Removing (ii) is not possible?


-spd

| http://facebook.com/people/Simon-P-Ditner/776370031
| http://twitter.com/spditner

Henry L.Coleman

unread,
Apr 20, 2009, 10:48:05 PM4/20/09
to aste...@uc.org
In the case you describe both ATA's have a local echo can. which will try cancelling local talk back (ie.
sending only the audio and not the local "talkback". If we say that only this echo can. is 95% efficient
then 5% gets reintroduced. That might not sound like a big deal but the process is "recursive" bounced
from end to end. Maths buffs will see this problem of delay, volume, dynamic compression (codec).
The gain control is the best place to improve the echo, if either the RX or TX gain is above 0db then
the overall audio connection has positive gain and will tend to amplify the channel echo.
Well that's my two cents :)


-----------------
Henry L. Coleman
[VoIP-PBX.ca]

=================

> Simon P. Ditner<

Jason Rose

unread,
Apr 20, 2009, 10:49:04 PM4/20/09
to aste...@voip-pbx.ca, aste...@uc.org
I was approached by a client who wishes to add asterisk onto his dedicated server which is located in panama. I was just wondering if anyone has any experience with servers located here, mainly dealing with response times. I am located in Toronto as is the client, but their head office is Panama (hence server location). Will this be do-able or is it too far and pushing the limits?

Jason


________________________________
From: Dean Yorke <dean....@xyc.ca>
To: aste...@voip-pbx.ca
Cc: aste...@uc.org
Sent: Monday, April 20, 2009 9:44:30 PM
Subject: Re: [on-asterisk] cancelling remotely generated echo

Jim Van Meggelen

unread,
Apr 20, 2009, 11:09:52 PM4/20/09
to Jason Rose, aste...@voip-pbx.ca, aste...@uc.org
Panama is not really that far away as the crow flies, so as long as
there aren't too many hops, you should be getting latency as good or
better than you would to Europe.

The more important consideration might be ensuring the local regulations
allow you to do what you're doing. VoIP is not unregulated everywhere.


--

--
Jim Van Meggelen
j...@vanmeggelen.ca
http://www.oreillynet.com/pub/au/2177

"A child is the ultimate startup, and I have three.
This makes me rich."
Guy Kawasaki
--

Henry L.Coleman

unread,
Apr 21, 2009, 10:40:23 AM4/21/09
to aste...@uc.org
With Zaptel or SIP phone(s)
Make calls and start by lowering the RX gain until the sound level is lower but still audiable.
Make calls and start by lowering the TX until the far end say it lower but still acceptable.

It should be noted that ulaw and alaw compress the dynamic range on TX and expand it on RX
This is known as companding and is very similar to those audiophiles who remember the Dolby
system used in cassette tapes and 8 tracks (now I 'm showing my age). Anyway, to cut a long story short,
this proceedure can play an important role in the perception of low level artifacts such as echo.
As it happends, aLaw is better than uLaw at handling this but what is even more important is that the
same no-linear gain is applied to both ends (ie. the aLaw 2 aLaw or uLaw to uLaw).
Obviously, any FXO and ATA's need to match these dynamic properties with any SIP/IAX phones or FXSs

This is a very big subject so I can't go into too much detail, but I could give a session on this at a
TAUG meeting if anyone is interested.

-----------------
Henry L. Coleman
[VoIP-PBX.ca]

=================

> Dean Yorke<
> ok, so how do you tune the rx and tx

Dean Yorke

unread,
Apr 21, 2009, 10:48:50 AM4/21/09
to aste...@voip-pbx.ca, aste...@uc.org
I would be interested.

I would also be interested in a process on how to manipulate these
settings.

I am using aastra phones and sangoma a200 with echo cancel.

Thanks

Shidan

unread,
Apr 21, 2009, 2:02:23 PM4/21/09
to Jim Van Meggelen, Jason Rose, aste...@voip-pbx.ca, aste...@uc.org
I used to have some servers in Panama, not for VoIP though. It's one of the
most connected countries in the world and the same tier-1 ISPs offer service
over there. Two things to note, Panama, unlike it's policy on all other
internet based services, has very strict regulations on taxing for VoIP and
the carrier hotel equivalent to 151 is Altec.

---
Shidan

Reply all
Reply to author
Forward
0 new messages