G.168 Line Echo Canceller

Commetrex’ G.168 Line Echo Canceller (LEC) allows the developer of telephony-endpoint products and gateways to meet the specification and speech-performance requirements of demanding enterprise and carrier applications. The LEC is available in C-reference source code and in highly optimized versions for the Texas Instruments TMS320C6000 line of DSPs. The LEC only requires 5.0 MCPS to execute on the ‘C6400, yielding a density of 120 channels per DSP with a 128-millisecond echo tail cancellation. Higher densities can be achieved with shorter tail lengths.

Commetrex’ LEC release 2.0 benefits from the experience gained in wide-scale carrier deployments. This experience has resulted in smooth transitions into and out of non-linear processing (NLP) and low divergence during double talk. Events signaling near-end speech, required for the LEC’s internal operation, are made available as external events to other processes that may benefit from knowing when near-end speech starts and stops.

Echo in telephony systems arises primarily from so-called trans-hybrid coupling in an analog endpoint. The hybrid is the device that combines the two bi-directional signals (four-wire) of the network to the single combined signal of a telephone handset (two-wire). In the hybrid, a portion of the signal from the far talker is coupled to the signal from the near-end talker and is returned to the far end. This echo is noticeable in networks with greater than 50-msec delay, making echo cancellation critical for speech quality in IP networks. The LEC is an important element in Commetrex’ OpenEndpoint product.


  • Non-linear processor with smooth transitions
  • Double-talk detection
  • 35dB ERLE without NLP
  • 65dB ERLE with NLP
  • Programmable tail length of any min and max, with 8-128 milliseconds the most common.
  • Fast convergence
  • Comfort-noise generator
  • Tone disabler
  • Available with either a native API, MSP Consortium M.100-conformant API, or Texas Instruments XDAIS compatible API
  • Resource-efficient implementation for the TI TMS320C6000 DSPs
  • Interrupt safe
  • C-reference source code available

License Options

  • Limited-use paid-up source code
  • Corporate paid-up source code
  • Source with runtime license
  • Paid-up object code
  • Object Code with Runtime Licenses

Overview & Definitions

Since the processing delays in IP networks aggravate echo, the increasing use of IP as a transport for voice is magnifying the importance of line echo cancellers (LECs). Without effective echo cancellation, IP voice is not practicable. So if you are developing an endpoint that has two-to-four-wire conversion or an IP-PSTN gateway, for example, you will need an effective LEC.

The ITU-T G.168 Recommendation specifies tests and test results for line echo cancellers. There are different versions of G.168: 1998, 2000, and 2002. But, although many of the tests in 2002 are improved over those in earlier versions, the differences are those you probably can’t hear. G.168 is rigorous and demanding. From the spec: “This Recommendation defines objective tests that, if passed, will ensure (but will not guarantee) a minimum level of performance when installed in the network.”


As with most specialties, echo cancellation has a language of its own:

Echo Return Loss (ERL) — The reduction in the signal in dB from the network (far end) through the near end, usually the coupling through the near-end hybrid and, unless there’s an LEC, back (echoed) to the far end (e.g., the difference between what arrives from the far end to the input of the LEC).

Echo Return Loss Enhancement (ERLE) — The reduction of the echo (ERL) in dB by the LEC. (More is better).

Convergence & Convergence Time — The LEC uses an adaptive filter to develop a model of the echo-producing circuit: the near-end hybrid, codecs, and any other local filtering. The far-end signal (the one to be cancelled) is then fed to the filter as the input. The filter produces a replica of the echo that is subsequently subtracted from the input signal to the LEC (the far-end signal plus the near end signal). Convergence is the process of “training” this adaptive filter, and convergence time is, obviously, the time it takes for the filter to get trained. (Shorter is better.)

Non-Linear Processor (NLP) — A technique for maximizing echo cancellation by completely suppressing the signal sent to the far end when the near-end speaker is silent. NLP is a requirement of G.168. The design challenge is to know when the near-end speaker is silent, and to then mute the echo-return path, as well as knowing when to turn off NLP when the near-end talker begins to speak, and to make the transitions not noticeable. Comfort noise is often used in conjunction with NLP.

Double Talk — The condition where both speakers talk simultaneously. The updating of the LEC’s adaptive filter must be suspended during double talk and when only the near-end party is speaking, lest it diverge.

Comfort Noise — A replacement sound inserted into the path toward the far listener used in conjunction with NLP. When NLP is active, instead of silence, low-level noise is sent to the far listener.


System Overview

The LEC removes the echo with an adaptive filter that models the transfer function of the echo generation path. It is trained during intervals when the far talker is active and the near talker is silent. This filter, once converged, can produce a close copy of the echo signal and remove it by subtracting this replica from the input signal leaving only the near-talker signal. This is then sent to the far listener.

The external interface is designed for flexibility for use in a variety of platforms. The LEC has a simple “native” interface that can be wrapped with any of several industry-defined APIs. These include the native API, an MSP Consortium M.100 wrapper and a Texas Instruments “XDAIS” wrapper, as diagrammed above.


The LEC meets the following performance requirements:

ERLE with and without NLP:

Requirement: To reduce input echo by more than 35 dB with NLP disabled.

Requirement: To reduce input echo by more than 65 dB with NLP enabled. (Reference: G168 tests 2A and 2B. Minimum G168 requirement: 14 dB after one second, level dependant thereafter.)

Acoustic echo: The LEC reduces uncancelled acoustic echo by an additional 18 dB over that presented from the incoming near data stream. (Reference: G168 tests 2A, 2B, and 12 (optional). This requirement states the ability to cancel an echo that is a result of the acoustic path from the speaker to the microphone of a speakerphone as long as the echo falls within the established echo tail span.

Convergence Time: The LEC converges to more than 20 dB of cancellation depth in less than 150 milliseconds from application of signals conducive to training. (Reference: G168 tests 2A and 2B. This requirement states that the LEC must converge rapidly so that the echo is barely or not at all perceptible at channel start-up.)


Requirement:: To not diverge more than 6 dB from steady-state cancellation depth at the onset of double-talk.

Requirement: To not diverge more than 6 db from steady-state cancellation depth when silence begins on both connection ends.

Requirement: To not produce unwanted regeneration of echo when the echo path opens.

Requirement: To not diverge from convergence under narrow-band signals. (Reference: G168 tests 3A, 3B, 4,5,6 and 7.)

The above requirements state the ability of the LEC to not cease or reduce performance when conditions change on the connection during normal conversation.

Data and fax transmission Requirement: To not affect operation of Group 3 fax and data transmissions less than or equal to 9600 bps. (Reference: G168 tests 10A, 10B, 10C, and 14 (all tests optional). The above requirement is to ensure that the LEC does not harm facsimile and low-data-rate modem transactions. These modems do not issue the LEC disabler tone. When the LEC is not disabled, its presence should not affect the operation of these devices.)

Dynamic range Requirement: To operate successfully over a dynamic range of greater than 11 bits (approximately 66 dB). (This requirement states the ability of the LEC to operate over a wide range of signals such as those expected from linear as well as companding codecs operating over their entire range.

Minimum ERL Requirement: To operate correctly with as little as 6 dB of echo return loss (ERL). (This requirement states the maximum design value of ERL expected from a system in which the LEC is placed. In this case (generally considered the worst case), the echo can be as high as one half the power of the far talker signals.)

Resource Requirements

Memory utilization of the LEC is a function of the length of the specified echo tail. The table below gives the filter length as a function of echo tail length.

Filter length in taps Echo tail in msec.
128 16
256 32
512 64
1024 128

This results in the following memory requirements on the TI ‘C6000 DSP:

Item Memory (bytes)
Program 11.2 K
Core Context 112
Coefficient storage 256 per 16ms of tail
Delay Line 160+256 per 16ms of tail
Disabler Context 236
Comfort noise context 76
Total: 32ms with all: 1608 bytes
Total: 128ms 4680 bytes

The number of cycles required per channel is also a function of echo tail length and whether the LEC’s adaptive filter is being updated.

Conditions MCPS
16 ms Tail
Updating (Peak) 3.0
Filtering only (Low) 1.8
Average* 1.9
32 ms Tail
Updating (Peak) 4.0
Filtering only (Low) 2.5
Average* 2.6
128 ms Tail
Updating (Peak) 5.0
Filtering only (Low) 3.8
Average* 3.5
*Assumes each speaker is active approximately 40% of the time with little overlap plus overhead

The chart below gives the number of channels that can be obtained with the G.168 LEC on a 600-MHz ‘C6412 in combination with popular voice coders.

ECAN None 32ms 48ms 128ms
G.711 a 600 300 170 120
G.711 u 600 300 170 120
G.723.1 75 60 55 48
G.729A,B 75 60 55 48
G.726 180 120 85 72

Note: All specifications are subject to change without notice.