ADAPTIVE ECHO CANCELLER FOR VOICE MESSAGING SYSTEM

Abstract: An apparatus and method for echo cancellation in voice-messaging and voice-response systems, to enhance recognition of received DTMF and voice signals, comprising an efficient software echo canceller using adaptive digital filtering techniques. The voice messaging system (1, fig. 1) includes analog telephone line interface modules (24) which provide digitized voice data to a digital signal processor (DSP) chip. A transmit data line (204, fig. 3) and a receive data line (202) are each coupled to a cancel module (208) with a cancel filter and an adapt/window module (220) with an adaptive digital filter. The cancel filter causes echo cancellation on the transmit data line; the adapt/window module monitors buffered transmit data in non-real time, without directly causing cancellation to occur, and selectively transfers an adjacent window of filter coefficients to the cancel filter under control of an adaptation control (230) coupled to the adapt/window module. The control identifies a plurality of frames meeting a power criterion and passes the frames to the adaptive filter, which adapts on taps in frame segments during all available DSP real time, using a "cycle steal" feature for testing whether additional DSP processor cycles are available to use for echo cancellation.

Description: ADAPTIVE ECHO CANCELLER FOR VOICE MESSAGING SYSTEM Field of Invention This invention generally relates to apparatus and methods for reduction and cancellation of voice-band echo in voice-messaging or voice-response systems which are connected to the telephone network. The invention specifically relates to adaptive filter driven echo cancellers having adaptive control means for loading windowed filter coefficients to a cancel filter under configurable conditions. Proprietary Rights Notice This document contains certain copyrighted program listings proprietary to the assignee hereof. The assignee has no objection to reproduction or copying by the public of the document as it appears in the files or records of the U.S. Patent & Trademark Office, but reserves all other rights in the copyrighted listings. Background of the Invention In voice-messaging or voice-response systems connected to the public switched telephone network, outbound (transmit) and inbound (receive) signals are present. As shown in FIG. 2B, a conventional telephone 90 has a single channel 92 for both transmit and receive signals which is a 2-wire connection. This 2-wire channel is coupled to a telephone company office ("CO") switch 93, which converts the 2-wire single channel to separate transmit and receive channels on a 4-wire channel 94. The 4-wire channel is connected, possibly over a long distance, to a remote CO switch 95 where it is converted into a second or remote 2-wire channel 96. The remote channel is routed to a remote device, such as a private branch exchange (PBX) 97 at a private office. The PBX can be coupled to a voice messaging system 1 which may contain yet another four-to-two conversion device with output on an internal channel 99. Four-to-two wire conversion devices are called "hybrids", and cause signal transformations which are always imperfect due to line impedance mismatches. As shown in FIG. 2C, a hybrid 2 in a voice messaging system 1 may have an internal reference impedance 2 different from a load impedance Z_ of the PBX 97. Thus, energy from the transmit data can and usually will couple into the receive data along an "echo path" denoted by arrow 5. Echo impairs the accurate detection and recognition of incoming tone and speech signals that are typically used to signal the voice messaging system to control the flow of transmit data (for example, to control the playback of speech). A siinilar impedance mismatch may exist in other hybrids in the CO switches 93, 95 of FIG. 2B. Since a telephone call may be routed through a plurality of hybrids along a path from caller to receiver, echo can originate at several different points along the telephone connection. The goal of echo-cancellation is the replace the "echo-corrupted" received data with "echo-cancelled" received data, in which the echo is effectively subtracted out of the received data. As shown in FIG. 2C, the voice messaging system I further includes contains a coder-decoder (CODEC) 4 with a digital-to-analog converter 6A and an analog-to-digital converter 6B. Digital data is routed on a receive data line 202 and a transmit data line 204. The data received by the voice messaging system is corrupted by echo whenever transmit data is non-zero. In particular, in a phone call, if the source of the echo is either very close to the voice messaging system ("near end echo"), or the source of theDTMF signals or speech is distant, the echo problem is worsened. Echo cancellation or reduction in this context comprises techniques to reduce the echo level to enhance signal detection performance. In the prior art relating to echo cancellation and reduction in voice-messaging and voice-response systems, the use of analog circuitry to compensate for impedance mismatch is well known, as exemplified by U.S. Patents Nos. 3,499,999 and 3,500,000. Analog circuitry is "tuned", by adjusting hardware component values, to reduce the level of echo. Analog apparatus has numerous disadvantages: the extent of "tuning" possible is limited; the guidelines for imiing are not clear; it is not adaptable on a call-by-call basis, etc.. Accordingly, those skilled in the art desire to have a digital echo canceller in a voice messaging or voice response system. Software implementation of adaptive digital filtering techniques for voice-band echo-cancellation techniques in telecommunications and other areas is well known, as exemplified by: (1) K. Murano et al., "Echo Cancellation and Applications," IEEE Communications Magazine, Jan. 1990, p. 49; (2) D. Messerschmitt et al., "Digital Voice Echo Canceller with a TMS32020," Digital Signal Processing Applications with the TMS320 Family, Vol. 1, Texas Instruments, 1986; (3) M. Sondhi et al., "Silencing Echoes on the Telephone Network," Proceedings of the IEEE, Vol. 68, No. 8, pp. 948-963, Aug. 1980. Much prior art is concerned with application of echocancellation to reduce far-end audible echo during a telephone conversation, as disclosed in Sondhi et al., Messerschmitt et al., and D. Duttweiler et al., "A Single Chip VLSI Echo Canceller," 59 Bell System Tech. J. 149, Feb. 1980. Use of echo-cancellation in data modems to cancel near-end and far-end echoes is also known, as disclosed in J. Cioffi, "A Fast Echo Canceller Initialization Method for the CCITT V.32 Modem," 38 IEEE Trans, on Comm. 629, May 1990, and parts of J. Proakis, "Digital Communications," 2d ed. McGraw-Hill, 1989. The high computational needs of all prior echo canceller implementations are a significant hindrance to use of these techniques when computation budgets are tight, as in a voice messaging system with echo cancellation implemented in software for a digital signal processor (DSP) IC. Thus, those of skill in the art would appreciate an efficient implementation to allow other voice-band activity of significant computational cost to run concurrentiy with the echo-canceller on the DSP. In the prior art, software echo-canceller parameters (e.g. number of coefficients, various threshold parameters) are not completely configurable, i.e., the parameters cannot all be changed to other values while the messaging system is operational. This is a disadvantage since configurability can be used to "tune" the parameters to the desired level of performance for the available processing power and to match characteristics of the location or site of the system. Adaptive echo cancellers are also known, as best exemplified by U.S. Patent No. 4,757,527 (Beniston et al.). Beniston et al. discloses two separate adaptive and programmable filters of identical size and strucmre, wherein error data from me adaptive filter is compared to error from the programmable filter, and coefficients are transferred when performance of the adaptive filter is better. Beniston et al. is primarily directed at echo cancellation during doublet lk, during which transfer is inhibited. The adaptation process in prior art echo-cancellers under discussion requires time for convergence, before the echo canceller reduces echo to the desired level. This time may be kept to a minimum at a fairly high computational effort, but the adaptation time is never zero (instantaneous). The use of "training" signals in echo cancellers and adaptive equalizers prior to actual transmission of data addresses this problem, but its use has been limited to modem applications and other phone connections not involving human speech. Thus, those skilled in the art desire an echo canceller with the capability to use training signals for enhancing the adaptation process, while using other signals to ,r mask" the audible effect of the training signal. Those skilled in the art desire a software efficient echo-canceller (in a voice-messaging or voice-response system), using adaptive digital filtering techniques, in which an adjacent window of coefficients is chosen to apply echo cancellation to the best form of a sampled waveform. Those skilled in the art would also desire a software adaptive echo canceller using techniques to minimize computational needs of the echo canceller. Specifically, use of "ttaffic-engineering" techniques such as processor "cycle steal" is desirable. Those skilled in the art would also appreciate an adaptive digital software echo canceller which can be implemented on a general-purpose digital signal processor (DSP) which serves multiple channels of voice-band activity while using a maximum number of processor cycles for echo cancellation. -5- ι Summary of Invention Accordingly, the present invention provides an apparatus and method for a digital software adaptive echo canceller in voice-messaging and voice-response systems, and specifically to implement echo cancellation to enhance recognition of ' received DTMF and voice signals, comprising a software efficient echo-canceller using adaptive digital filtering techniques. The voice messaging system includes analog telephone line interface modules which provide digitized voice data to a digital signal processor (DSP) chip. A transmit data line and a receive data line are each coupled to a cancel module with a cancel filter and an adapt/window module 0 with an adaptive digital filter. The cancel filter implements echo cancellation on the transmit data line; the adapt/window module monitors buffered transmit data in non- real time, without directly causing cancellation to occur, and selectively transfers an adjacent window of filter coefficients to the cancel filter under control of an 5 adaptation control coupled to the adapt/window module. The control identifies a plurality of frames meeting a power criterion and passes me frames to the adaptive filter, which adapts on taps in frame segments during all available DSP real time, using "cycle steal" means for testing whether additional DSP processor cycles are available to use for echo cancellation. A masked white noise burst can be used to " initialize adaptation. A windowing function identifies the best subset of coefficients of an adapted frame, which are copied or loaded into the cancel filter. All control parameters are configurable, enabling site-specific performance optimization. The invention can be further understood with reference to the attached drawings: Brief Description of Drawings FIG. 1 is a block diagram of a voice messaging system; FIG. 2A is a block diagram of a prior art adaptive echo canceller; FIG. 2B is a block diagram of a telephony system; FIG. 2C is a block diagram of a hybrid in a voice messaging system; FIG. 3 is a block diagram of an echo canceller apparatus of the present invention; FIG. 4 is a state diagram of a control logic aspect of the present invention; and FIG. 5 is a diagram of exemplary echo waveforms showing a windowing feature of the invention. Detailed Description of Preferred Embodiments In the following detailed description of the preferred embodiments, specific terminology is used for the sake of clarity. However, the invention is not limited to the specific terms used, but includes all technical equivalents functioning in a substantially similar manner to accomplish a substantially similar result. A. System Overview Attention is first invited to FIG. 1, which shows a voice messaging system 1 in which the echo-canceller of the invention can be used. The system comprises control elements 10, telephone line interface elements 20, and peripheral interface elements 30, 40. These elements can exchange data and control signals on a bus 50 which can follow the Multibus protocol developed by Intel. An independent bus 60, called die time division multiplexer (TDM) highway, enables fast transfer of digitized voice band data. The system may be the VoiceServer 2110 product commercially available from the assignee hereof. The control elements include a system controller 12, which can be an Intel 386-class CPU with conventional support electronics, coupled to me Multibus and to a system console 14, also of conventional type. The telephone interface elements include one or more analog line interface modules 24, which receive incoming calls on a public switched telephone line 70. The telephone line 70 could be channel 98 of FIG. 2B. As is known in the art, the analog interface modules digitize incoming call signals and assign the call to a channel in the system. If Tl line service is available then one or more Tl line interface modules 26 of conventional design can couple Tl lines to the digital elements of the system. Digital signal processing of voice messages and control signals is done by one or more line interface controllers (LICs) 22. Each LIC preferably includes a complete conventional Intel 386-class microcomputer coupled to a digital signal processor (DSP), such as one of the TMS320 family (e.g. the TMS32020) available from Texas Instruments. The DSP is coupled to a conventional memory store (not shown) such as at least several kilobytes of conventional electronic random access memory (RAM). The DSP preferably serves multiple channels of voice-band activity. The echo canceller of the invention is preferably implemented in assembly code software on the DSP, as discussed in detail below. ι Depending on the needs of the system user, a plurality of peripheral devices can be interfaced to the system. For example, a SCSI host adapter 32 can be coupled to the Multibus and a streaming tape drive 36, a floppy disk drive 34, and one or more mass storage devices such as hard disk drives 38 can also be connected ' in known manner. The hard disk drives provide primary storage for voice data and can also provide storage for system software; via the Multibus, the disk drives are indirectly coupled to the DSPs on the LICs. Further, a magnetic tape controller board 42 can be provided to interface the Multibus to a streaming tape drive 43. A serial board 44 can connect to a plurality of serial devices such as IODM 44A, 0 modem 44B, printer 44C, and user ports 44D. Additional communications can be provided using Ethernet board 46 and an X.25 board 48. Electronic and interface details of the elements designated 30 to 48 are conventional and well known. 5 B. DSP Operation A DSP on a LIC communicates with voice signals from the "outside world" as follows. For each channel of voice band activity, at intervals equal to a predetermined samplingperiod, the DSP receives a sample value (receive data), and transmits a sample value (transmit data). Data reception and transmission occurs " on the TDM highway. Data samples are obtained by me analog interface modules which sampling analog data at 8 Khz, the standard voice-band sampling frequency used in the telephone network. The DSP accumulates, over a fixed period, a fixed number of receive digital data points to form a receive "frame" stored in a discrete area in the memory. Outgoing transmit data points are likewise accumulated to form a transmit frame. This period is called die frame duration and preferably is 22.5 milliseconds. Over a frame duration, die DSP processes die received frames and transmit frames, for each channel of activity, as directed by DSP software. Voice-band processing may include diverse functions such as speech encoding and decoding, companding, tone detection and generation, speech recognition, text-to-speech conversion, etc. Many require DSP processing or computation. Thus, die frame duration determines the maximum total number of computations possible per frame of transmit and receive data. C. Adaptive Digital Filter Echo Cancellation Use of adaptive filters in echo cancellation is well known. A typical adaptive digital filter echo canceller is shown in FIG. 2. Data is transmitted from a far end source 105 and coupled to a receiver 104 in the voice messaging system. Meanwhile, transmit data a(k) from transmit source 102 is generated elsewhere in the voice messaging system. An echo path 110 arises when the transmit data cross- couples into the far end source data; die additive effect of the echo is illustrated with accumulator 111. An adaptive digital filter 108 is placed parallel to the echo path to sense and cancel the echo on the echo path, by providing inverse cancelling data to an adder 109. The filter cancels echo by changing me value of individual bits in the data stream according to a set of variable coefficients in the filter. Changing me coefficient values causes a corresponding change in the filter characteristics. Normally tiiree basic operations take place in an adaptive filter used for echo-cancellation: 1. Generation of an echo estimate: A filter takes as input the "transmit" data and outputs "echo estimate" data. 2. Generation of residual: Residual data (also called error data) is done by subtracting the echo-estimate from me "receive" data. The residual replaces the receive data (since it represents echo-cancelled receive data). 3. Update (adaptation) of the filter coefficients: this is based on an adaptation algorithm that updates the filter coefficients, and takes as input die transmit and residual data. The filter type and adaptation (update) algorithm govern performance and computational requirements of this technique. The adaptive filtering system of FIG. 2A is computationally wasteful. P. Configurable Adaptive Digital Filter Echo Canceller The invention is implemented using a form of adaptive digital signal filtering, implemented in a computer program for me DSP written in the C source language. Preferably the C code is tested, debugged, and tiien hand-assembled into DSP assembler code, which is assembled and linked by a DSP assembler program commercially available from Texas Instruments. The assembled object code is loaded to the DSP in conventional manner. Structural arrangement of the echo canceller of the invention is shown in FIG. 3. The functional behavior of the echo-canceller of the invention is shown in FIG. 4, which illustrates logical states of operation of die apparatus of FIG. 3 and the method of the invention. Specific structure and feamres of the canceller are discussed below, followed by an operational discussion of FIG. 4. Details of die invention, including the best mode of implementation of data structures and configurable constants, are evident in die C programming language source code module attached as Appendix A. The modules include "default3.spc," which defines configurable parameters of me echo canceller, and "eαh," which defines data structures used in the echo canceller. The invention can be implemented in a C language echo cancellation software module named EC and contains several subroutines and function calls. State transitions in me EC module occur upon the conditions shown in Table 1, which correlate to the state transition arrows of FIG. 4. 308B conv*cycle 308C !conv*!pset*cycle 308D !conv*pset*cycle 310A cycle 310B !cycle 1. General Strucmre and Filter Operation As shown in FIG. 3, a transmit data line 202 from a DSP is preferably coupled to two separate digital filters in a cancel means or cancel module 208 and 0 an adapt means or adapt/window module 220. Voicefile playback data is provided from the transmit data source 204. An echo path is formed by passage of data signals on lines 206A and 206B to downstream functions such as a DTMF detector 210, a speech recognition module 211, and a speech decoder 212. Filter coefficient 5 signals 219 and a delay signal 218, can be transferred from the adapt module to the cancel module upon command of adaptation control 230. An adder 216 applies the cancel module signal to die receive data signal to cause cancellation of echo. Adapting logic 230 provides control of two core functions: the "adapt" function of adapt module 220 and the "cancel" function of cancel module 208. " The adapt function is completely independent of e cancel function. The adapt function is said to run in non-real-time for the following reasons. It operates on buffered transmit and receive data frames that have passed an acceptability test which is based on signal power calculations. Processing of a buffered (transmit & receive) data frame may take more than one elapsed frame, where elapsed frame refers to the regular transmission and reception of frames. Thus, die echo canceller of FIG. 3 takes as input die transmitted and received data frames and delivers as output an "echo-cancelled" data frame (a "residual" data frame) which represents data received from which the echo has been subtracted. The module men replaces the received frame with the residual data frame for all subsequent signal processing operations carried out by the DSP. Thus, operation of die echo canceller is transparent to any otiier DSP module; only die post-cancellation buffer data is seen by subsequent DSP modules. The echo canceller preferably is operational on all channels only when transmitted data represents playback of voice data, because during generation of DTMF tones, detection or recognition of received signals is not typically required. Thus, in a voϊce messaging system, the cancel filter of the echo canceller is preferably active only when the system is playing back a voicefile message stored on one of the hard disk drives or in memory. The adapt module can be continuously active. However, the canceller can be enabled during the generation of tones and other non-voice signals as die system requires. 2. Initialization At die beginning of a telephone call, an EC_Init module active on the DSP initializes variables in the EC Var data strucmre and sets data and filter 0 coefficient buffers to zero. Preferably the filter buffers are in a data structure called struct adapt, and each include 180 digital data points, which represent one frame of data or 22.5 ms of real time speech. Next control is passed to an EC_Control module, which implements 5 adaptation control 230 using calls to routines named EC_power, EC_adapt, EC_window. EC ilter, EC_align, EC_getRSP, and EC ail. 3. Data Acquisition and Power Criteria Test Data is required for adaptation before coefficients can be sent to die " cancel filter. Adapt/window module 220 operates on buffered transmit and receive frames of data which have passed an acceptability test. In contrast, prior art adaptive filter echo cancellers operate on all transmit and received data. Also, in the invention, die residual data generated does NOT replace die receive data. States 300 and 306 of FIG. 4 show logic used to initially acquire data to adapt on. The EC_PRE_DATA state 300 is entered after initialization. As indicated by arrow 300A, the adaptation control 230 remains in state 300 until boolean variable pset is true [!pset*cycIe*(mode! =null) and (mode= =null)*!hlnitj . An EC_power routine is called inEC_PRE_DATA and EC POST DATA (states 300 & 306) to perform a power criterion measurement on a frame. Since adaptation during very low levels of transmitted data is counter-productive, adaptation is performed only when die transmitted data power exceeds a predetermined threshold; an EC_power routine performs this test. The number of frames of valid data for which the EC_power test is performed (before adaptation and cancellation begins) is set to a fixed number ^ determined by a typical empirical convergence rate. When EC_power is called from EC_PRE_DATA, the number of frames is preferably five frames. When EC_power is called from EC_POST_DATA, two frames are preferred. These numbers are configurable. After suitable data is acquired control, is passed to die ' adaptation function. If me invention is in die EC PRE DATA state, control is passed on arrow 300C to the EC_PRE_ADAPT state 302 when [(mode!=null)*psefJ is true. If the EC_POST_DATA state is active, control is passed to the EC_POST_ADAPT state. Because EC_power requires a power criterion to pass a data frame to the 0 adapt states, it is possible tiiat far more than five frames (or two frames if in POST DATA) will be examined by EC_power. However, die boolean pset variable will not be set true until five consecutive frames meet die power criterion of EC_power. 5 4. Adaptation and Adaptation Control As shown in FIG. 4, the adapt function operates in two modes: a "pre-adapt" mode (states 300, 302, and 304 of FIG. 4) and a "post-adapt" mode (states 306, 308, and 310). These modes (and groups of states) differ only in die parameters governing the adapt function. The pre-adapt parameters are typically designed for faster adaptation than the post-adapt parameters. In the pre-adapt mode, the echo canceller sets up an initial adaptation level. Pre-adaption preferably includes several configurable discrete steps. A masked white noise "burst" is preferably used to set initial echo levels. At e beginning of a phone call, the burst function generates a burst of low-level white noise, masked by configurable tones (signals), as transmit data. The transmit and receive data are input to the adapt function in the usual way, and pre-adaptation proceeds. The white noise tiius acts as a training signal. Use of burst adaptation can be set on or off. Burst adaptation witii masking tones allows for a substantially reduced startup time (which is the time before the cancel function becomes operational), since the noise-generation function requires significantly less computational effort than die DSP playback function (since this normally includes speech de-compression). Furthermore, burst adaptation improves echo cancellation performance, since the white noise source is more "frequency rich" than speech; as a result, die adaptation results in a more accurate echo model. The configurable ! masking tones are selected such that audible impact of the burst is low, and distortion of receive data, by the person at the other end inputing DTMFs or speech, is small. Selecting ring-tones as masking tones is considered best. To ensure that enough data is processed for accurate pre-adaption, five frames of data must be adapted on in state 302 before control is passed to EC_PRE_WINDOW state 304. A boolean variable converge is set true when five frames are received by the adapt module. Thus, control is passed on arrow 302A to state 304 when conv is true. If no convergence has occurred and insufficient data is received ([!conv*!psefJ is true) tiien control is passed on arrow 302B to state 300. 10 In contrast, if [!conv*pset] is true then control is passed on arrow 302C to EC_adapt and back to ECJPRE_ADAPT. State 302 (and pre-adaption) can be skipped completely if a mode variable is set null. Thus, if [mode==nuli*hInit], initialization is done and control is 5 passed on arrow 300D to state 304. This control path is used, for example, when an application program outside EC is reconnecting a port to die DSP and no adaptation is desired. An adaptation algorithm is implemented in the routine EC adapt in states 304, 310, using a "sign-sign" least mean squares (LMS) algorithm of generally " conventional design. A configurable "step size" parameter helps determine the adaptation rate and the residual error after convergence. However, a six-sample delay occurs at the input of die adaptive filter. This accounts for observed hardware-dependent delay between transmit and receive for a station-loop line interface module, and is assumed to be a minimum. This delay is shown as die trip delay 508 in FIG. 5. After the delay, adapting and cancelling continues as described herein. 5. Cancel Function The cancel function consists of cancel filter 208 which generates an echo estimate, taking the transmit data on line 206B as input, followed by subtraction of the echo-estimate from the receive data using adder 216 to generate the residual data. The residual data replaces the receive data, tiius performing the cancellation function. The cancel function operates continuously on all transmit and receive data. During the beginning of a telephone call, the cancel function does not operate. The cancel function operates concurrentiy with the POST ADAPT in that die cancel filter coefficients are periodically derived from the most recent adapt filter coefficients. Thus the coefficients of the cancel filter reflect the ongoing adaptation. Impulse response ("click") can be used to initialize die cancel filter in the EC_Init routine. Digital impulse recording is used during an actual phone call to obtain an impulse response sample (see Section 7 below). During the phone call, die recorded impulse response samples, properly windowed and aligned, can be used to initialize the finite impulse response (FIR) cancel filter co-efficients. The impulse thus acts a "training signal" with two main benefits. First, the impulse will minimize die startup delay associated with the pre-adapt mode of adaptation, (during which me cancel function does not operate), since it requires negligible computational effort to perform its function. Second, die impulse has negligible audible impact, being heard as a barely perceptible click. The post-adapt mode of adaptation may function as usual. Cancel filter 208 of FIG. 3 is implemented in the EC filter routine, which provides a finite impulse response (FIR) filter to cancel echo out of received data. As indicated by arrow 305A of FIG. 4, me adaptation control 230 remains in state 305 as long as a cycle variable (discussed below) is false, i.e. no DSP processing cycles are available. The cancel filter is implemented witii preferably 32 coefficients whereas die adapt filter has preferably 48 coefficients. The cancel filter has fewer coefficients than the adapt filter to enable high resolution adapting witiiout taxing computation, which is highly dependent on the number of coefficients in the cancel filter. The 48 coefficients corresponds to 6.00 ms of real time, which was determined in practice to compensate for echo durations observed in practice. The selection of 32 of 48 coefficients for transfer to the cancel filter is done in a procedure EC_window, implemented in routines EC_PRE_WINDOW and EC_post_window, shown as states 304 and 310 in FIG. 4. From the 48 adapt coefficients, a plurality of "windows" of 32 adjacent coefficients are selected, and the total energy of all data points in the window is determined by computing the sum of the squares of the energy level. The window widi the maximum energy or maximum sum of squares is selected. No threshold detection is used; rather the best adjacent 32 taps are selected. The EC window procedure also generates a ^ delay interval signal 219 which is output before the first selected filter coefficient. The selected window is an adjacent set of coefficients, increasing efficiency. Windowing can be understood with reference to FIG. 5, which depicts exemplary echo waveforms on two axes 500, 502 representing echo amplitude and > time, respectively. A first waveform 504 represents, for example, a far-end echo, and a second waveform 506 represents a near-end echo of much larger magnitude. As one skilled in die art will recognize, waveforms 504, 506 are merely exemplary and actual waveforms could have different profiles. A hardware-dependent trip delay of zero echo amplitude is empirically known to precede the first echo, as 0 shown by arrow 508. The total duration of botii waveforms is arbitrary but to conserve computational resources, the system considers a maximum of nTapsA taps, such as 50 taps. A program variable nTapsA defines a first tap count of die number of taps for adaptation; nTapsF is a second tap count defining die number of taps for 5 filtering. Cancellation of botii waveforms 504, 506 is desirable. Unfortunately, DSP computational limits are best used by cancellation of only nTapsF taps (arrows 512, 514). Thus, since resources are limited, the second waveform 506 is a more serious echo and cancellation of it is more desirable. The second waveform is a " "better window" in which to apply cancellation than the first waveform. In prior art echo cancellers, an nTapsf cancellation signal would be applied at die start of the waveform as shown by arrow 512. In the present invention of FIG. 3, die adaptation control 230 causes the adapt/window module 220 to generate a delay value 219 represented as arrow 514 of FIG. 5. Then the nTapsF error signal is output in the position of arrow 516. As a result, the second waveform 506 is cancelled, resulting in better performance. If EC_f_ter (state 305) is active, and a DSP cycle becomes available when convergence has not occurred (i.e. [!conv*cycle] is true), then control is passed on arrow 305B to EC_POST_WINDOW to cause a window of coefficients to be transferred to the cancel filter. If no cycles are available ([!cycle] is true), control is passed on arrow 310B to state 305 where further adaptation occurs. In operation, if a DSP cycle is available (cycle is true) then adaptation control remains in EC_PRE_WINDOW or EC_POST_WINDOW as indicated by arrows 304A, 310A. When die best set of adjacent taps is found and die adaptation control is in pre-adapt mode, control is passed to state 305 on arrow 304B, thereby causing d e set preConv of selected taps to be transferred to the cancel filter. If post-adapt mode is active, men control is passed on arrow 31 OB to state 305 and die cancel filter coefficients are also updated. 6. Cycle Steal Feature To take advantage of extra available DSP cycles, a "cycle steal" feature is implemented. As is known in d e art, a DSP can process various types of voice-band activity in a single channel; each activity consumes DSP resources. Each frame corresponds to a finite number of DSP computation cycles, so only a 0 finite number of actions can be taken during each frame. When an activity required for each of the channels being served is complete for a given frame, normally the DSP will idle until die next receive and transmit frames are acquired. In this invention, this idle period is use to carry out adaptation computations required by 5 die echo-canceller. This feature is called a "cycle-steal" function. To implement e cycle-steal function, a boolean variable "cycle" is provided in die DSP memory store. The adaptation control determines whether real time is available after required processing for all channels is completed for me current frame duration; if so, "cycle" is set true. The EC_control procedure is then " called, causing EC_adapt to be called, enabling adaptation to be performed on subsets of the total number of points buffered, as shown in FIG. 4, until available real-time is entirely consumed. Thus, multiple calls to EC control may be made if sufficient cycles can be "stolen." To further facilitate processing efficiency, a frame segmentation technique is used. Each frame is divided into an integer number of segments, each containing a predefined number of taps. The cycle steal routine determines whether enough DSP real time is available to process one segment. If so, die segment is adapted on. The segment size and number of segments per frame are defined in me modules of Appendix A. The cycle variable is tested in nearly all the state transition paths of FIG. 4. Therefore, cycle availability is a predicate for almost all the state transitions. This arrangement allows the updating of the cancel-filter to occur many times per second in a typical voice messaging or voice response environment. Thus, of die data being processed by the DSP, only a percentage proportional to available real-time is utilized for adaptation. Moreover, this percentage is found, even under L heavy DSP utilization conditions, to be adequate for the desired level of echo-cancellation performance in die voice system. 7. Configurability of Echo-Canceller Parameters. Further, the various parameters used in the echo-canceller are configurable, i.e. they may be changed while die signal-processing system (including die echo-canceller) is operational. Configurability of parameters is advantageous because die parameters may be adjusted "on die fly" to compensate for specific echo characteristics and available processing power. As presentiy 0 embodied, the invention can be reconfigured while die voice messaging system is operational but while the application including die invention is off-line or disabled. The parameter values are changed and the application is re-loaded to the DSP. Configurability of parameters is advantageous in many ways. To implement configurability, all important echo cancellation attributes are represented as software variables or constants, shown in Appendix A, and tiiese parameters may be subsequendy changed while die messaging system is operational. The configurable parameters are listed in die default3.spc module of Appendix A. Configurability is desirable to fulfill system site requirements. Due to variations in the types of equipment that are connected to the voice messsaging/response system, certain parameter choices may be more optimal. For instance, in certain digital networks, echo delays are significantly longer tiian in analog systems. Thus, it may be beneficial to increase the "flat" delay parameter in the adapt-filter to allow the adaptation to model/more of the non-trivial section of echo. Second, configurability enables adjustment of desired echo suppression performance. The echo cancellation parameters may be adjusted to trade off different performance goals for a given system. A crucial aspect of echo cancellation is that it must always be functional. "Startup time", die delay at die beginning of a call before the cancel-filter becomes operational, may need to be reduced, since during this time me benefits of echo cancellation are not experienced. To reduce die startup time, one may select a shorter duration for the pre-adapt mode of the adapt function (providing an initially lower level of echo performance but providing it sooner). Configurability also allows the system to be sensitive to real-time restrictions. For example, with me incorporation of new features, each requiring DSP processing time, less or more real-time may be available for echo cancellation. The configurability of the module allows a degradation in echo-canceller performance to be traded off for such new features. 8. Digital Echo Impulse Response Recording Recording of echo impulse response digitally on the voice messaging/response system for arbitrary telephone connections enables characterization of echoes. This measures the time-domain echo transfer characteristics (and hence die frequency domain characteristics) accurately, and even by inspection, one can use die response to pin-point various sources of echo along the telephone connection, relative magnitude, delays, etc. E. Conclusions Thus, die invention provides an echo canceller witii many advantages over the prior art. For example, the invention offers increased computational efficiency. Separation of d e "adapt" function from the "cancel" function in the echo-canceller enables design of die adapt function to be essentially freed from real-time restrictions. The cancel function operates in real-time, as it must by definition. Also, data buffering results in more computational efficiency. The adapt function operates on buffered frames of transmit and receive data which have passed a power criterion, and utilizes all available real-time after other DSP functions have been completed. Thus, of die data being processed by die DSP, only a percentage proportional to available real-time is utilized for adaptation. Adaptation is also speeded up in this invention by the "cycle-steal" function. Any idle period of the DSP is used to carry out adaptation computations required by die echo canceller. A windowing technique is used for derivation of die cancel filter coefficients. Botii the adapt and cancel filters are the finite impulse-response (FIR) type. The coefficients with the largest magnitude produce d e largest reduction in echo. Therefore, a rectangular window of maximum lengdi as allowed by real-time is applied to d e adapt coefficients. A sum of squares calculation is performed on d e windowed coefficients. The window which produces die largest accumulation is chosen as the best set of coefficients to use for the cancel filter. Thus, die cancel l filter requires a reduced number of multiply or accumulate operations during filtering. The invention also minimizes startup (convergence) time using the pre-adapt mode. The invention may be practiced in many ways otiier than as specifically • described herein. For example, different quantities of taps can be used in me windowing functions. Thus, d e invention should be given the full scope of the appended claims, in which: 0

Claims: WHAT IS CLAIMED IS: 1. Digital adaptive means for providing echo cancellation signals in a voice messaging or voice response system having a memory store and at least one digital signal processor providing a receive data line and a transmit data line and being coupled to die memory store and the mass storage device, said digital adaptive means comprising: adapt filter means coupled to die receive data line and to die transmit data line and to the digital signal processor having a plurality of adapt filter coefficients 10 for generating a delay signal and for transferring the adapt filter coefficients; cancel filter means coupled to the adapt filter for generating a cancel echo signal proportional to a plurality of cancel filter coefficients; and control means for transferring the adapt filter coefficients to the cancel 15 filter, die control means comprising: convergence means coupled to die receive data line for identifying a successive plurality of data frames on the receive data line meeting a power criteria test and for storing the successive plurality of data frames in a convergence buffer in the memory store; 20 adapt means, coupled to die convergence buffer, for deriving the adapt filter coefficients from the successive plurality of data frames; and window means, coupled to the adapt means, for selecting successive windowed quantities of taps from each of the plurality of data frames and for identifying a best windowed quantity having the most _-J signal energy of the successive windowed quantities, and for transferring a delay value, and a subset of the adapt filter coefficients corresponding to die best window quantity, to the cancel filter. 30 2. The digital adaptive means of claim 1, wherein the adapt filter operates in non-real-time during playback of a voicefile message, and wherein the control means further comprises: segmentation means for truncating each of the successive plurality of data frames into a plurality of frame segments; 5 cycle steal means for testing whether processing cycles of the digital signal processor are available for use, and if so, for setting a boolean variable and for causing die adapt means to derive adapt filter coefficients using die frame segments. 3. The echo canceller of claim 1, wherein the cancel filter is arranged to cause echo cancellation on die input signal in real-time and wherein the adapt filter operates on a plurality of segments truncated from each of the data frames in non real time during playback of a voicefile message. 4. The digital adaptive means of claim 1, wherein the adapt filter further 10 comprises a data buffer in die memory store and means for storing a plurality of data frames in the data buffer. 5. The digital adaptive means of claim 1, wherein the adaptation control 5 includes cycle steal means for testing whetiier processing cycles of the digital signal processor are available for use, and if so, for setting a boolean variable and for causing the adapt means to perform further echo cancellation functions responsive to the value of the boolean variable. " 6. The digital adaptive means of claim 1, wherein the adaptation control further comprises means coupled to die adapt filter and the input data line for storing the windowed quantity in die data buffer, for computing a sum of squares of each data sample in the windowed quantity, and for testing whether the sum of squares is largest of the successive windowed quantities. 7. The digital adaptive means of claim 1, wherein the adaptation control includes a burst adaptation means for minimizing startup and convergence time, die burst adaptation means comprising: noise generation means for transmitting a burst of white noise on the transmit data line; masking means coupled to the noise generation means for combining a tone signal with die burst; and pre-adaption means for sensing the burst and adapting die adapt filter coefficients in response thereto. 8. The digital adaptive means of claim 1, wherein the adaptation control further includes a plurality of individually configurable parameters in he memory store. 9. The digital adaptive means of claim 8, each parameter defining an operational characteristic of the adaptation control, and wherein me parameters include a trip delay value defining d e delay from output to input; a first tap count defining die number of taps for adaptation; 0 a second tap count defining die number of taps for filtering. 10. The digital adaptive means of claim 8 or 9, wherein the parameters include: 5 pre-adaptation phase parameters including a first adaptation segments value, a first segment availability count, a first adaptation step size value, a first adaptation power minimum value, and a first adaptation frame requirement; post-adaptation phase parameters including a second adaptation segments value, a second segment availability count, a second adaptation step size value, a " second adaptation power minimum value, and a second adaptation frame requirement; and burst masking parameters including a white noise scale value, a head tone frame duration value, a tail tone frame duration value, first and second tone frequency values, and first and second tone amplifier values. 11. A digital adaptive echo canceller for providing echo cancellation signals in a hybrid in a voice messaging or voice response system having a memory store, a mass storage device, and at least one digital signal processor providing a receive data line and a transmit data line and being coupled to the memory store and the mass storage device, said echo canceller comprising: an adaptive finite impulse response filter coupled to the receive data line and to the transmit data line and to the digital signal processor and comprising a plurality of adapt filter coefficients in the memory store, means for generating a delay signal output, and means for transferring the adapt filter coefficients; a first summation means coupled to the adapt filter for adjusting the adapt filter coefficients in response to differences between die adapt filter coefficients and a real echo signal on die receive data line; a cancel finite impulse response filter coupled to die adapt filter for generating a cancel echo signal proportional to cancel filter coefficients in die memory store; mixing means coupled to the cancel filter for mixing die cancel echo signal witii die real echo signal; adaptation control means coupled to die transmit data line and die adapt 0 filter, comprising: convergence means coupled to die receive data line for identifying a successive plurality of data frames on the receive data line meeting a power criteria test and for storing the successive plurality of data frames 5 in a convergence buffer in die memory store; adapt means, coupled to die convergence buffer, for deriving die adapt filter coefficients from the successive plurality of data frames; and window means, coupled to die adapt means,, for selecting successive windowed quantities of taps from each of the plurality of data " frames and for identifying a best windowed quantity having the most signal energy of the successive windowed quantities, and for transferring a delay value, and a subset of die adapt filter coefficients corresponding to the best window quantity, to die cancel filter. 12. The echo canceller of claim 11, wherein die cancel filter is arranged to cause echo cancellation on die input signal in real-time and wherein the adapt filter is operative on buffered data frames, the control means further comprising: segmentation means for truncating each of the successive plurality of data frames into a plurality of frame segments; and cycle steal means for testing whetiier processing cycles of the digital signal processor are available for use, and if so, for setting a boolean variable and for causing die adapt means to derive adapt filter coefficients using the frame segments. 13. The echo canceller of claim 11 , wherein the adapt filter further comprises a data buffer in the memory store and means for storing a plurality of data frames in the data buffer. 14. The echo canceller of claim 11, the adaptation control means further comprising cycle steal means for testing whether processing cycles of the digital signal processor are available for use, and if so, for setting a boolean variable and for causing d e adapt filter to perform further echo cancellation functions responsive to the value of he boolean variable. 0 15. The echo canceller of claim 11, wherein me adaptation control means further comprises windowing means coupled to die adapt filter for receiving a plurality of adapted data frames, for identifying a fixed window quantity of taps in 5 each data frame, for storing the window quantity in the data buffer, for identifying a best window quantity and for causing transfer of coefficients representative of die window quantity to die cancel filter. 16. The echo canceller of claim 11, wherein the adaptation control includes " a burst adaptation means for minimizing startup and convergence time, the burst adaptation means comprising: noise generation means for transmitting a burst of white noise on the transmit data line; masking means coupled to die noise generation means for combining a tone signal witii the burst; and pre-adaption means coupled to die receive data line for sensing an echo signal induced from the burst and adapting die adapt filter coefficients in response tiiereto. 17. The echo canceller of claim 11, wherein die adaptation control further includes a plurality of individually configurable parameters in die memory store, each parameter defining an operational characteristic of the adaptation control, and wherein the parameters include a trip delay value defining me delay from output to input; a first tap count defining the number of taps for adaptation; and a second tap count defining die number of taps for filtering. 18. The echo canceller of claim 11 or 17, wherein the adaptation control further includes a plurality of individually configurable parameters in the memory store, each parameter defining an operational characteristic of the adaptation control, and wherein d e parameters include: pre-adaptation phase parameters including a first adaptation segments value, a first segment availability count, a first adaptation step size value, a first adaptation power minimum value, and a first adaptation frame requirement; 10 post-adaptation phase parameters including a second adaptation segments value, a second segment availability count, a second adaptation step size value, a second adaptation power minimum value, and a second adaptation frame requirement; and 5 burst masking parameters including a white noise scale value, a head tone frame duration value, a tail tone frame duration value, first and second tone frequency values, and first and second tone amplitude values. 19. A method of adaptive echo cancellation in a voice messaging or voice " response system having a memory store, at least one digital signal processor, a digital voice data receive data line, a transmit data line, and an echo canceller apparatus comprising a digital adapt filter having a plurality of adapt filter coefficients, a digital cancel filter coupled to die adapt filter and an adaptation control means for controlling transfer of the adapt filter coefficients to the cancel filter, the metiiod comprising the steps of: identifying a successive quantity of voice data frames on the receive data line which pass a power criterion and storing the frames in a convergence buffer; truncating a plurality of segments from each data frame, and for each segment, derivmg adapt filter coefficients from a plurality of taps in each segment during all available computing cycles of me digital signal processor; selecting successive adjacent windows of taps from each frame and identifying by an energy level test the best window; and transferring adapt filter coefficients proportional to each tap in die best window to die cancel filter. 20. The method of claim 19, wherein e cancel filter is arranged to cause echo cancellation on d e input signal in real-time and wherein the adapt filter is operative on buffered data frames. 21. The echo canceller of claim 19, wherein the adapt filter further comprises a data buffer in die memory store and means for storing a plurality of data frames in die data buffer. 22. The echo canceller of claim 19, wherein the truncating step further 0 comprises the step of testing whether processing cycles of the digital signal processor are available for use, and if so, for setting a boolean variable and for causing the adapt filter to perform further echo cancellation functions responsive to the value of die boolean variable. 5 23. . The echo canceller of claim 19, wherein the adaptation control includes a burst adaptation means for minimizing startup and convergence time, die burst adaptation means comprising: noise generation means for transmitting a burst of white noise on the " transmit data line; masking means coupled to die noise generation means for combining a tone signal with the burst; and pre-adaption means for sensing the burst and adapting the adapt filter coefficients in response thereto. 24. The echo canceller of claim 19, wherein the adaptation control further includes a plurality of individually configurable parameters in die memory store, each parameter defining an operational characteristic of die adaptation control, and wherein the parameters include a trip delay value defining the delay from output to input; a first tap count defining the number of taps for adaptation; a second tap count defining the number of taps for filtering; pre-adaptation phase parameters including a first adaptation segments value, a first segment availability count, a first adaptation step size value, a first adaptation power minimum value, and a first adaptation frame requirement; post-adaptation phase parameters including a second adaptation segments value, a second segment availability count, a second adaptation step size value, a second adaptation power minimum value, and a second adaptation frame requirement; and burst masking parameters including a white noise scale value, a head tone frame duration value, a tail tone frame duration value, first and second tone frequency values, and first and second tone amplifier values.

Inventors: CROMACK MARK R, RAMAN VIJAY R, CROMACK, MARK, R., RAMAN, VIJAY, R.
Applicants: DIGITAL SOUND CORP, DIGITAL SOUND CORPORATION
Application year: 1992
Main classification: H04J15
IPC codes: H04B3, H04M3, H04Q1