6.4 Echo Cancellation

(Page 5 of 11 in this chapter)
The echo cancellation function improves the ability of the DTMF detector to recognize digits during playing, a capability referred to as DTMF cut-through performance.

Echoes are usually generated by poor impedance mismatch between hybrids and physical telephone lines. Echo cancellation improves cut-through performance by removing near-end echoes from the input port stream.

The echo canceller also improves cleardown detection during play.

The echo canceller operates in-line with an open port. It monitors the outgoing stream audio data and correlates that data with the incoming audio stream data. The echo cancellation filter uses a comparison of the signals to adapt to the line, cancelling echoes generated by an impedance mismatch. The diagram below illustrates the function placement for echo cancellation.



: Echo Cancellation

Echo cancellation must be started before the DTMF detector. The AG Access library initiates echo cancellation during trunk protocol processing, just prior to entering the conversation state. Therefore, the appropriate parameters must be set before calling adiStartProtocol.

The echo cancellation function is controlled by four parameters: filter length, adaptation time, gain, and offset. The first two can be set to determine performance of the echo canceller. Gain and offset, however, are normally left at default values.

The first parameter gives the length of the echo canceling filter. The length is limited to 2, 4, 8, 10, 16, or 20 milliseconds. There is a trade-off to consider when choosing the filter length for echo cancellation. It is important to pick a filter long enough to capture most of the echo energy, but short enough to minimize adaptation error. In other words, the longest filter is not necessarily the best filter. The long length echo cancellers will introduce noise if the echo energy is not spread out across the entire filter. This noise will then hinder DTMF cut-through performance.

The rate corresponds to how fast the echo canceller adapts to the physical line. A fast adaptation rate consumes more DSP processing power than a slow rate. Medium adaptation rates are recommended. The adaptation rate can be set from 100 to 1000 milliseconds.

The echo cancellation function contains a post filter gain stage. This parameter allows input on the line to be amplified or attenuated. It should normally be set to 0 dB.

For all board types except the AG-8, the offset parameter time shifts the correlation buffer. This enables shorter filter lengths to be shifted in time, allowing capture of more echo energy as illustrated in Figure 26.



: Echo Cancellation Offset Parameter

As the offset parameter is increased, the correlated data buffer is shifted later in time. Thus, the offset can be adjusted to center the correlated data on most of the echo energy. The valid range is from 0 to 9 milliseconds of filter offset (the value must be 0 for AG-8 ports).

In general, echo cancellers of moderate length and adaptation time provide a typical improvement of 10 - 15 dB in DTMF cut-through performance.

Not all boards have the capacity to support echo cancellation. The echo canceller consumes a large amount of DSP processing power and on-board communication memory. Long filter lengths and fast adaptation rates require more DSP processing and memory.

The default mode chooses the best possible echo cancellation for the available DSP power on the board. Choosing echo cancellation parameters which consume more DSP power than is available may result in errors when all ports are active. To determine whether your boards support echo cancellation, see the table in Section 6.4.1, Enabling the Echo Canceller.

6.4.1 Enabling the Echo Canceller

To configure your system for echo cancellation, follow the procedure below.

  1. Load echo.dsp to the board.

To download echo.dsp, add the following statement to your ag.cfg file:

		DspFile = echo.dsp
  1. Set the appropriate AG Access parameters.

To enable echo cancellation with the board's default settings, set the parameter ADISTART echocancel.mode equal to 1. The defaults for each board type are shown in the following table.

Board Type

Length (msec)

Convergence Rate (msec)

AG-24

Echo Cancellation Not Available

AG-24+

4

400

AG-30

Echo Cancellation Not Available

AG-48

Echo Cancellation Not Available

AG-60

Echo Cancellation Not Available

AG-8

2

400

AG-8F

8

200

AG-T1

4

400

AG-E1

Echo Cancellation Not Available

To enable echo cancelation with specific parameters, set
ADISTART echocancel.mode equal to 2. In addition, you may set
ADISTART echocancel.filterlength and ADISTART echocancel.adapttime to values of your choosing.

6.4.2 Using the Alternate DTMF Detector to Improve Talk-off

As stated previously, echo cancellation improves cut-through performance. The DTMF detector can therefore be made more selective, resulting in improved resistance to talk-off (the false detection of digits in a speaker's voice). AG Access includes an alternate DSP file which is specifically used in conjunction with echo cancellation.

To enable this alternate DSP file:

  1. Locate the reference to dtmf.dsp in your ag.cfg file.

  2. Change dtmf.dsp to dtmfe.dsp. The modified line should read:

    		DspFile = dtmfe.dsp
    


(Page 5 of 11 in this chapter)

Copyright 1996 Natural MicroSystems, Inc. All Rights Reserved.