Abstract:
A double talk detector for echo cancellers monitors the ratio of four wire transmit in energy to transmit out energy (ERLE), along with the change and direction of change of an estimated impulse response, to control updating of the estimated inpulse response. When the ERLE is low and the directional change of the impulse response is high, indicating an end path switch, the double talk detector enables the estimated impulse response to be updated. If the directional change of the impulse response and the ERLE are both low, indicating the occurrence of double talk, the detector inhibits updating of the impulse response until either the ERLE becomes sufficiently high, indicating single talk, or the directional change of the impulse response becomes sufficiently large, indicating an inconverged state of the canceller. The arrangement allows convergence of the echo canceller to be properly controlled both in response to double talk and to changes in the impulse response of the end path.

Description:
BACKGROUND OF THE INVENTION 
     The invention relates to an improved double talk detector for controlling convergence of an echo canceller, and to a method of controlling convergence of an echo canceller. 
     In a telephone network, four wire (4W) and two wire (2W) segments are joined at opposite ends of the network bu hybrid circuits, often called 4:2 hybrids. Impedance mismatch in a hybrid circuit causes a 4W receive signal to be reflected back onto the 4W transmit path. If there is enough delay in the network, this reflected signal presents itself as echo to the speaker who originated it at the far end. Adaptive echo cancellers remove the echo signal from the 4W transmit path. 
     Normally, a 4W receive signal is at a higher level than its echo signal on the 4W transmit path, since there is loss across the hybrid circuit. Near end speech on the trransmit path will therefore typically be stronger than the echo signal. Such near end speech is unwanted noise as far as convergence of the echo canceller is concerned, since it will diverge the canceller if the canceller were to continue updating its estimated impulse response while near end speech is present. Consequently, a critical component of an echo canceller is a near end speech detector, or double talk detector, to inhibit updating of the estimated impulse response while near end speech is present. To detect near end speech on the 4W transmit path, it is not sufficient to simply look for energy on the path, since it will be there from echo even when there is no near end speech. Various techniques have therefore been developed to detect near end speech and inhibit updating of the canceller when it is present. 
     A performance measure that represents the effectiveness of the cancellation process, such as echo return loss enhacement (ERLE), can be used to detect double talk. In single talk, when there is only far end speech, an adaptive filter of the canceller can cancel most of the energy on the 4W transmit in path, leaving little residual echo on the 4W transmit out path. Thus, when only far end speech is present, the ratio of the 4W transmit in energy to 4W transmit out energy, i.e., the ERLE, is high and much greater than one. When near end speech is present, however, the adaptive filter can cancel only a small portion of the 4W transmit in energy, allowing the near end speech to pass as residual energy. Under this condition, the ERLE is low and approaches one. The double talk detector can then simply monitor the ERLE, and when the ERLE is high, allow the taps or estimated impulse response to update to converge the adaptive filter. Should the ERLE begin to decrease, then the taps are frozen to prevent divergence of the filter. 
     The double talk detection method of measuring the ERLE provides satisfactory convergence control in a nonswitched environment, but suffers from a fundamental limitation in a switched environment where the end path of the telephone network may change from one call to the next. An echo canceller&#39;s ability to remove echo from a 4W transmit path depends upon it being able to generate an accurate model of the end path impulse response. When the end path changes, the canceller can no longer match the echo, because the model it developed of the previous end path does not accurately represent the impulse response of the new end path. The result is poor cancellation, which causes the ERLE to drop to near unity and appear as near end speech to the double talk detector, even when near end speech is not present. This, in turn, causes the detector to inhibit the echo canceller from converging and developing an accurate model of the new end path impulse response. 
     OBJECTS OF THE INVENTION 
     An object of the present invention is to provide an improved double talk detector for an echo canceller, which senses and distinguishes between double talk and an end path switch. 
     Another object is to provide a double talk detector that monitors the ratio of 4W transmit in energy to 4W transmit out energy (ERLE), along with the change and direction of change of an estimated impulse response, to control convergence of the canceller. 
     A further object is to provide a double talk detector which enables the echo canceller to converge in the absence of near end speech and when a new end path is established, but prevents the canceller from converging when near end speech is present. 
     SUMMARY OF THE INVENTION 
     In accordance with the present invention, there is provided a double talk detector for controlling convergence of an adaptive filter, wherein the adaptive filter is adapted to be coupled to transmit and receive paths of a telephone network for separating the transmit path into transmit in and transmit out paths, for developing and periodically updating an adjustable estimated impulse response of an end path and for generating, in accordance with the estimated impulse response and a receive path signal, an estimate of an echo signal occurring on the transmit in path in response to the receive path signal, which echo estimate signal is algebraically combined with a transmit in path signal to yield a transmit out path signal. The transmit in signal at least occasionally includes signals from a near end of the network, and the double talk detector comprises means for generating an echo return loss enhancement (ERLE) signal, having a value in accordance with the ratio of transmit in signal energy to transmit out signal energy; and means for detecting whether the adaptive filter is in a converged state, such that the estimated impulse response is a good estimate of the actual impulse response of the end path loop, or whether it is in an unconverged state, such that the estimated impulse response is not a good estimate of the actual impulse response. In addition, the double talk detector includes means, responsive to both the ERLE signal value and to the state of convergence of the adaptive filter, for controlling updating of the estimated impulse response and convergence of the adaptive filter. 
     In a preferred embodiment, the means for controlling updating of the adaptive filter is responsive to either a sufficiently low ERLE signal value and an unconverged state of the adaptive filter, or to a sufficiently high ERLE signal value, to enable the adaptive filter to update the estimated impulse response. The means for controlling also is responsive to a sufficiently low ERLE signal value and a converged state of the adaptive filter to inhibit the adaptive filter from updating the estimated impulse response. In this manner, the double talk detector allows the adaptive filter to update the estimated impulse response and converge when no near end signals are present on the transmit path and in response to an end path switch, but prevents the adaptive filter fromm updating the estimated impulse response and being diverged when near end signals are present on the transmit path. 
     The invention also contemplates a method of controlling convergence of an adaptive filter, which comprises the steps of generating an echo return loss enhancement (ERLE) signal having a value in accordance with the ratio of transmit in signal energy to transmit out signal energy; detecting whether the adaptive filter is in a converged or unconverged state; and controlling updating of the estimated impulse response and convergence of the adaptive filter in accordance with the value of the ERLE signal and the detected state of convergence of the adaptive filter. 
     In a preferred practice of the method, the controlling step is responsive to either a sufficiently low ERLE signal value and a detected unconverged state of the adaptive filter, or to a sufficiently high ERLE signal value, to enable the adaptive filter to update the estimated impulse response. The controlling step also is responsive to a sufficiently low ERLE signal value and a detected converged state of the adaptive filter to inhibit the adaptive filter from updating the estimated impulse response. In this manner, the adaptive filter is enabled to update the estimated impulse response when no near end signals are present on the transmit path and in response to an end path switch, but is prevented from updating the estimated impulse response and being diverged when near end signals are present on the transmit path. 
     The foregoing and other objects, advantages and features of the invention will become apparent upon a consideration of the following detailed description, when taken in conjunction with the accompanying drawings. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a schematic representation of an echo canceller having a double talk detector according to the teachings of the invention; 
     FIG. 2 is a schematic representation of the double talk detector; 
     FIG. 3 is a schematic representation of a power measuring circuit that is part of the detector, and 
     FIG. 4 is a flowchart for a double talk detection algorithm. 
    
    
     DETAILED DESCRIPTION 
     FIG. 1 illustrates one end of a telephone network at which four wire (4W) and two wire (2W) segments are joined by a hybrid circuit. The hybrid circuit couples an input signal on the 4W receive path to the 2W segment, and an output signal on the 2W segment to the 4W transmit path. Ideally, all of the signal energy on the 4W receive path is coupled to the 2W segment. In practice, impedance mismatch in the hybrid circuit usually causes some of the energy on the receive path to be reflected onto the transmit path. If there is enough delay in the network, the reflected signal is heard as echo by the speaker who originated it at the far end. Consequently, also connected to the telephone network, between the 4W receive and transmit paths, is an echo canceller that separates the transmit path into transmit in and transmit out paths and cancels the echo signal on the transmit in path, so that it does not appear on the transmit out path. 
     The echo canceller includes an adaptive filter that develops estimated taps or coefficients forming an estimated impulse response of the end path of the network. The algorithm used in the adaptive filter is a variation of the Least Mean Squares (LMS). If x and y are the 4W receive and transmit in signals, respectively, and x[n] and y[n] are samples of those signals at time n, then x[n], a vector whose elements are the last n samples of x, may be defined as: 
     
         x.sup.T [n]={x[n],x[n-1],...,x[n-(N-1)]},                  (1) 
    
     where T denotes the transpose operator on the vector. The signal y is the sum of echo e and some noise v. Echo is modeled as the output of a discrete-time filter with input x[n] and finite impulse response h, where 
     
         h.sup.T ={h.sub.0,h.sub.1,...,h.sub.N- 1}.                 (2) 
    
     Therefore, echo e at time n is defined as ##EQU1## 
     The noise v has various sources, including quantization noise and modeling noise, and is assumed to be uncorrelated with echo e and the receive path signal x. Near end speech can also be modeled as a component of noise. 
     The object of the algorithm is to identify the vector h, the impulse response of the end path, so that echo e can be reproduced and substracted from the transmit in path signal y. The LMS algorithm establishes a set of adjustable coefficients or taps h i , i=0,1,...N-1, which are estimates of actual impulse response coefficients h j , and uses them in a convolution process to create an estimate y[n] of the transmit in path signal y[n], that occurs in response to the receive path signal, where ##EQU2## The estimate of the transmit in path signal y[n] is then algebraically combined with or subtracted from the actual transmit in path signal y[n] to form a residual or transmit out signal r[n], where ##EQU3## 
     In an attempt to minimize the energy of the transmit out signal r[n], the coefficients of the estimated impulse response h[n] are periodically updated at each time n according to 
     
         h[n]=h[n-1]+μ[n]r[n]x[n],                               (9) 
    
     where the estimated impulse response h[n] is a 256×1 vector containing the end path estimate at time n, μ is the adaptation step size or adaptive gain, and the vector x[n] contains the past 256 receive path signal samples. 
     Near end speech on the 2W segment appears on the 4W transmit path as part of the transmit in signal y[n], and since it affects the transmit out signal r[n], it is unwanted noise as far as the convergence algorithm is concerned. Near end speech or double talk will cause the echo canceller to diverge if it continues updating the tap weights or estimated impulse response coefficients h[n] while it is present. A critical component of an echo canceller is therefore a near end speech or double talk detector to inhibit adaptation or convergence of the adaptive filter while double talk is occurring. 
     A performance measure that represents the effectiveness of the cancellation process, or the degree of change in the transmit out signal as a result of the echo estimate being substracted from the transmit in signal, can be used to detect double talk. One such performance measure is echo return loss enhancement (ERLE). The ERLE is the ratio of the energy of the 4W transmit in signal y[n] to the transmit out signal r[n], i.e., ##EQU4## In single talk, when there is only far end speech, the adaptive filter can cancel most of the transmit in signal energy, leaving little transmit out signal energy, so the ERLE has a value much greater than one. When near end speech is present, however, the adaptive filter can cancel only a small portion of the transmit in signal energy, allowing near speech to pass as the transmit out signal r[n]. Under this condition, the ERLE approaches one. The double talk detector can then simply monitor the value of the ERLE. When the ERLE is high, indicating an absence of near end speech, the detector allows the estimated impulse response coefficients to update, so the adaptive filter converges. If the ERLE decreases, indicating that near end speech is present, the detector freezes the taps and inhibits further updating of the estimated impulse response to prevent the adaptive filter from being diverged by the near end speech. 
     The double talk detection method of sensing the ERLE works well in a stable environment where the end path loop of the network remains substantially constant. The method suffers, however, from a fundamental limitation in a switched environment, where establishing different connections establishes different end paths. The ability of the echo canceller to remove echo from the 4W transmit path depends upon it being able to develop an accurate model of the end path loop impulse response, i.e., to develop estimated impulse responses h j  that fairly accurately represent the actual end path impulse response h. When the end path is first switched, the adaptive filter can no longer match the echo, because it has within it a model of the previous end path, which does not match the new end path. This causes the ERLE to decrease in value to near unity, and therefore appear as near end speech to the double talk detector. Absent more, the detector will then inhibit updating of the taps, so the adaptive filter will not converge and develop an accurate model of the new end path impulse response. 
     To overcome the problem of sensing end path switches as near end speech, the invention provides means by which the detector can determine when a decrease in the ERLE is attributable to an end path switch and, despite the decreased ERLE, enable the adaptive filter to update its taps and converge. Absent an inhibit command from the detector, the adaptive filter is updated at every time n in an attempt to minimize the energy of the transmit out signal r[n]. The change in the estimated impulse response, Δh[n], from time n to time n+1, may be defined as a 256×1 vector, where 
     
         Δh[n]=μ[n]r[n]×[n].                         (11) 
    
     The Δh[n] vector points in the direction of change of the end path impulse response estimates. When the estimates are far from the true parameter values, the adaptive filter is in an unconverged state, and the Δh[n] vector points strongly in the particular direction that would converge the filter and minimize the transmit out signal r[n]. If the impulse response estimates are close to the true parameter values, the adaptive filter is ina converged state, and the Δh[n] 
     vector points in no particular direction over time, but instead wanders around the true parameter values. 
     To determine when a decrease in the ERLE is attributable to an end path switch, the algorithm defines a measure of the strength of the directionality of change of the Δh[n] vector, that serves as an end path switch detector. The end path switch detector output and the ERLE measurements are then combined to form the double talk detector. When the ERLE is low and the directional measure of change of the Δh[n] vector, averaged over time, is high (indicating that the adaptive filter is diverged), it is assumed that a change in the end path impulse response, due to an end path switch, is causing poor cancellation. Under this circumstance, the double talk detector enables updating of the estimated impulse response h j  allow the adaptive filter to converge to the new end path. If, however, while the ERLE has a low value the directional measure of change of the Δh[n] vector, averaged over time, also is low (indicating that the adaptive filter is converged), then it is known that near end speech is causing poor cancellation. In this case, the double talk detector inhibits updating of the estimated impulse response h j , to prevent the near, end speech from diverging the adaptive filter, until either the ERLE or the directional measure of change of the Δh[n] vector increases. 
     In choosing a measure of the directionality of change of the Δh[n] vector, its time average, Δh&#39;[n], is computed as 
     
         Δh&#39;[n]=C.sub.1 Δh&#39;[n-1]+Δh[n],           (12) 
    
     where C 1  is a scaler. The Δh&#39;[n] vector is obtained by passing the Δh[n] vector through an averaging circuit, which advantageously is a low pass filter. At time n, the Δh[n] vector is correlated with the Δh&#39;[n-1] vector by taking their dot product (multiplying their vectors), such that the correlation s[n] is defined as ##EQU5## 
     When the adaptive filter is in an unconverged state, it is expected that the direction each estimated tap moves at time n, Δh i  [n], will be in the same general direction that it moved in the past, Δh&#39; i  [n-1]. This causes the terms in the dot product to contribute a net positive amount to the overall sum. In the unconverged state of the adaptive filter, the expected value of the correlation s[n] therefore approaches one. 
     When the adaptive filter is converged, the direction a particular tap moves at time n is uncorrelated with the direction it moved in the past, since in this case the Δh[n] vector wanders around the true parameter values. This is true even in the presence of double talk, because the expected value of the estimated impulse response h[n], averaged over time, is independent of near end speech. The dot product then has no net positive bias, but instead wanders around a zero mean. 
     The final step in the algorithm is to determine the weighted average s&#39;[n] of the correlation s[n] by a low pass filter, such that 
     
         s&#39;[n]=C.sub.2 s&#39;[n-1]+(1-C.sub.2)s[n],-1≦s&#39;[n]≦1,(15) 
    
     where C 2  is a constant. A value of s&#39;[n] close to one indicates that the adaptive filter is unconverged and that its taps or impulse response coefficients have been trying to move in the same direction for some time. This condition signals an end path switch, and that the adaptive filter should be allowed to converge. On the other hand, a value of s&#39;[n] near zero (or possibly negative) indicates that the filter is converged and updating should be inhibited if the ERLE has a low value (indicating near end speech). The ERLE detector and end path switch detector are part of an update decision circuit in FIG. 1. 
     FIG. 2 iustrates one possible arrangement of a double talk detector circuit fpr performing the described functions. The detector circuit includes an ERLE measuring circuit, enclosed in dashed lines and indicated generally at 10, for generating the ERLE value according to equation (10). The ERLE measuring circuit has a pair of identical power measuring circuits, one of which is shown in greater detail in FIG. 3. Also included in the double talk detector are an x register, a Δh&#39; register, an accumulate circuit and a take sign circuit, enclosed in dashed lines and indicated generally at 20, for developing the correlation s[n] according to equations (13) and (14). The correlation s[n] is applied to an averaging circuit, enclosed in dashed line and indicated generally at 30, that develops the average correlation s&#39;[n] according to equation (15), and applies it to one input to a comparator circuit 40. Another input to the comparator receives the treshold set for s&#39;[n]. The output from the comparator, along with the ERLE generated by the circuit 10, are applied as inputs to a circuit enclosed in dashed lines and indicated generally at 50. The circuit 50 includes an ERLE max  circuit that stores the maximum value of the ERLE that has occurred since the last time the average correlation s&#39;[n] exceeded its threshold (i. e., since the last time the adaptive filter was unconverged), and determines whether the measured ERLE is greater than ERLE max  less 6 dB, as well as whether the measured ERLE is greater than ERLE max . An output from the circuit 50 is applied to one input to an OR gate 60, the other input to which receives the output from the comparator circuit 40. The output from the OR gate is coupled to the adaptive filter to control its adaptation or convergence, i.e., to either allow or inhibit updating of the filter. 
     A flowchart describing the double talk detection algorithm is shown in FIG. 4. The algorithm begins with detecting whether the measured ERLE is greater than ERLE max  less 6 dB. If it is, a determination is then made whether the measured ERLE is greater than ERLE max . Whether or not it is, adaptation of the filter is allowed to continue, since a measured ERLE that is greater than ERLE max  less 6 dB indicates the absence of near end speech. However, if it is, the stored value of ERLE max  is set equal to the measured ERLE. 
     If the measured ERLE is not greater than ERLE max  less 6 dB, that indicates that double talk may be occurring, and the adaptive filter taps are frozen and the correlation s[n] is developed. The next step is to calculate the average correlation s&#39;[n], and in a succeeding step compare it with its threshold. If the average correlation is greater than its threshold, that indicates that the measured ERLE is low because there is poor correlation since the adaptive filter is unconverged as a result of an end path switch, i.e., a new end path loop with a different impulse response has been established. In this case, the ERLE max  is set equal to zero and the adaptive filter is allowed to update. However, if the average correlation s&#39;[n]is less than its threshold, indicating that the adaptive filter is converged, then it is again determined whether the measured ERLE is greater than ERLE max  less 6 dB. If it is, that indicates that near end speech is not present, and the adaptive filter is allowed to update. If it is not, then that indicates that near end speech is present, and to prevent the near end speech from diverging the adaptive filter, updating of the filter continues to be inhibited and the algorithm recalculates a new average correlation s&#39;[n]. 
     As long as the detected ERLE is at least equal to ERLE max  less 6 dB, as measured since the last end path switch, adaptation of the filter continues. If the measured ERLE falls below this level, the taps are frozen and the end path switch detector is turned on. 
     While one embodiment of the invention has been described in detail, various modifications and other embodiments thereof may be devised by one skilled in the art without departing from the spirit and scope of the invention, as defined in the appended claims.