Steve Davies
2005-Dec-15 05:22 UTC
[Asterisk-Users] Small explanation of txgain rxgain statement please
Hi, I was just looking at: http://www.asteriskdocs.org/modules/tinycontent/content/docbook/current/docs-html/x1695.html regarding echo canceller tuning, and I noticed the statement "Most people find that they need an rxgain level around 8.0 to have good echo cancellation. The txgain setting varies from installation to installation." Which feels a bit wrong :) Could someone explain why increasing the gain on the inbound zap leg (rxgain) would improve echo cancellation? Of have I misunderstood the roles and meanings of rxgain and txgain? Many thanks Steve
Rich Adamson
2005-Dec-15 07:07 UTC
[Asterisk-Users] Small explanation of txgain rxgain statement please
> I was just looking at: >http://www.asteriskdocs.org/modules/tinycontent/content/docbook/current/docs-html/x1695. html> regarding echo canceller tuning, and I noticed the statement > > "Most people find that they need an rxgain level around 8.0 to have > good echo cancellation. The txgain setting varies from installation to > installation." > > Which feels a bit wrong :) Could someone explain why increasing the > gain on the inbound zap leg (rxgain) would improve echo cancellation? > Of have I misunderstood the roles and meanings of rxgain and txgain?If you read that quote verbatim, it's wrong. The rxgain and txgain settings for analog pstn interfaces "should be" about 2 db less then the pstn cable loss to the central office. However, due to limitations within the asterisk echo canceller, one typically cannot use that objective as it will result in echo. A very valid starting point is to find out what your pstn cable loss really is to the central office. That value can be obtained through using a telephony transmission test set (rather expensive at about $600 new), talking with someone knowledgable in the telco (sometimes very hard to find that person), complaining to the telco about poor transmission levels and watching over the shoulder of the technican when he measures it from your site (assuming the telco dispatches a technician). The transmission loss value will likely be something between -3db and -12db, depending upon the "distance" between your site and the central office via the cable path. If that value is measured at -8db (as an example only), then a good starting value for rxgain and txgain is roughly 6db. (You are trying to set the gain values to compensate for the cable loss. Trying to set the gain so the end result is no loss (as in 0db) will definitely cause echo. An informal telco approach is to set it for about a 2db total loss. Therefore, a measured loss of -8db with a txgain/rxgain value of +6db results in a total loss of -2db.) If you start with that known value, then the only reasonable way to adjust your "analog" interface gain is began decreasing those settings by about 2db per attempt, place a call, and listen for the echo. (Preferably place the test call from your system to another analog pstn phone, not a long distance phone or cell phone as they can inject other potential echo issues that will confuse your tests.) Be sure to stop asterisk and restart it after each gain setting change; a simple reload will not recognize the changes. As an example, my asterisk system is about 7db from the central office. My rxgain=5 and txgain=0 result in very acceptable use with only a slight amount of echo during the first few seconds of a call. The audio is still much lower then desired, but very usable. All of the above assumes that your analog pstn interface card is properly set to match the impedence of the line. In the US, that is 600 ohms which happens to be the default installation value for digium analog cards. Anyone that would suggest a specific gain setting for "everyone" does not understand analog telephony whatsoever. I'd have to guess the person that wrote the referenced material didn't actually intend to imply 8db would work for everyone. A poor man's way to estimate the pstn cable loss is to use an el-cheapo multimeter, set the multimeter to measure current (milliamps), and place the probes directly across tip & ring of the phone line with nothing else attached to the pstn line. You should read something between 20 and 60 milliamps. Send that measured value to me (off list) and I'll convert it to a reasonable rxgain setting. (If you understand ohms law and know that 24 gauge pstn cable is 52 ohms per 1,000 feet, central office voltage is 48 volts, and 24 gauge pstn cable has a loss of 2.31 db per 1,000 feet, then you can compute it yourself. Example: if you measure 26 milliamps, the ohms law calculation indicates you are 1,846 ohms from the CO. 1,846 ohms minus 600 ohms (for CO equipment) divided by 52 ohms indicates you are "about" 23,960 feet from the CO. 23.9 kilofeet divided by 2.31 db loss per 1,000 feet indicates you can expect a loss of about -10.3db. Then start with an rxgain setting of 8db.) If you are going to sell asterisk pbx's to your customers, then invest in a transmission test set and get the local telephone number for the milliwatt generator. It will be substantially more accurate then the poor man's method shown above.