# Patent

## Title
Echo path change detector

## Abstract

An echo path monitoring system for controlling an adaptive filter configured to estimate an echo of a far-end signal comprised in a microphone signal, the system comprising a comparison generator configured to compare the microphone signal with the estimated echo to obtain a first comparison and compare an error signal, which represents a difference between the microphone signal and the estimated echo, with the estimated echo to obtain a second comparison, and a controller configured to combine the first and second comparisons to form a parameter indicative of a state of the microphone signal and, in dependence on said parameter, control an operating mode of the adaptive filter.

## Background
This invention relates to an echo path change detector for use in telephony.
BACKGROUND
In telephony, an echo is a reflection of the voice signal. It is a delayed copy of the original. An example scenario is illustrated in FIG. 1a, which shows a signal being captured by a far-end microphone and output by a near-end loudspeaker. The echo is a consequence of acoustic coupling between the near-end loudspeaker and a near-end microphone; the near-end microphone captures the signal originating from its own loudspeaker in addition to the voice of the near-end speaker and any background noise. The result is an echo at the far-end loudspeaker. Echo cancellation is an important feature of telephony. Hands-free devices and teleconferencing, in particular, require echo cancellation that can adapt to environments having a wide range of acoustic characteristics.
Echo cancellers typically synthesise an estimate of the echo from the far-end voice signal. The estimated echo is then subtracted from the near-end microphone signal. This technique requires adaptive signal processing to generate a signal accurate enough to cancel the echo effectively. An adaptive filter is often used to model the environment's acoustic impulse response. Adaptation of this filter is usually frozen during near-end speech because otherwise the filter tries to adapt to the near-end speech, which causes its coefficients to diverge. Near-end speech (or double-talk) detectors are generally not sensitive to echo path changes, however. Consequently the adaptive filter may be frozen just when it needs to adapt at a faster rate.
There is a need for a practical system that is sensitive to changes in the microphone signal, so that an adaptive filter can be appropriately controlled.
SUMMARY OF THE INVENTION
According to one embodiment of the present invention, there is provided an echo path monitoring system for controlling an adaptive filter configured to estimate an echo of a far-end signal comprised in a microphone signal, the system comprising a comparison generator configured to compare the microphone signal with the estimated echo to obtain a first comparison and compare an error signal, which represents a difference between the microphone signal and the estimated echo, with the estimated echo to obtain a second comparison and a controller configured to combine the first and second comparisons to form a parameter indicative of a state of the microphone signal and, in dependence on said parameter, control an operating mode of the adaptive filter.
The parameter may be indicative of the presence of near-end speech and/or echo path change in the microphone signal.
The controller may be configured to, if the parameter indicates that neither near-end speech nor echo path change is present, control the adaptive filter to operate in a first mode. The controller may be configured to control the adaptive filter to operate in the first mode by continuously adapting its estimation of the echo of the far-end signal.
The controller may be configured to, if the parameter indicates that near-end speech is present but echo path change is not present, control the adaptive filter to operate in a second mode. The controller may be configured to control the adaptive filter to operate in the second mode by suspending adaptation of its estimation of the echo of the far-end signal.
The controller may be configured to, if the parameter indicates that echo path change is present, control the adaptive filter to act in a third mode. The controller may be configured to, when the adaptive filter is operating in the third mode, control a step size of an adaptation performed by the adaptive filter. The controller may be configured to control the adaptive filter to operate in the third mode by re-initialising its adaptation such that the adaptation step size is set to its maximum value and other convergence-related parameters are reset.
The controller may be configured to assign a state to the microphone signal in dependence on an operating state of the adaptive filter.
The controller may be configured to assign the microphone signal state in dependence on whether the adaptive filter is in a transient state or a steady state.
The controller may be configured to: when the adaptive filter is in the steady state, assess whether the microphone signal incorporates echo path change; and when the adaptive filter is in the transient state, not assess whether the microphone signal incorporates echo path change.
The controller may be configured to, when the adaptive filter is in the steady state, determine that the parameter indicates that neither near-end speech nor echo path change is present if the parameter is below a first predetermined threshold.
The controller may be configured to, when the adaptive filter is in the steady state, determine that the parameter indicates that double-talk is present but echo path change is not present if it is between the first predetermined threshold and a second predetermined threshold.
The controller may be configured to, when the adaptive filter is in the steady state, determine that the parameter indicates echo path change is present if it is above the second predetermined threshold.
The controller may be configured to, when the adaptive filter is in the transient state, compare the parameter with a third predetermined threshold and control the adaptive filter to operate in the first mode if the parameter is below the third threshold and in the second mode if the parameter is above the third threshold.
The controller may be configured to form the parameter by dividing the second comparison by the sum of the first and second comparisons.
The comparison generator may be configured to generate the first comparison by estimating a cross-correlation of the microphone signal and the estimated echo and to generate the second comparison by estimating a cross-correlation between the error signal and the estimated echo.
According to a second embodiment of the invention, there is provided machine readable code for generating an echo path monitoring system.
According to a third embodiment of the invention, there is provided a machine readable storage medium having encoded thereon non-transitory machine-readable code for generating an echo path monitoring system.
According to a fourth embodiment of the invention, there is provided a method for controlling an adaptive filter that is configured to estimate an echo of a far-end signal comprised in a microphone signal, the method comprising comparing the microphone signal with the estimated echo to obtain a first comparison, comparing an error signal, which represents a difference between the microphone signal and the estimated echo, with the estimated echo to obtain a second comparison, combining the first and second comparisons to form a parameter indicative of a state of the microphone signal and, in dependence on said parameter, controlling an operating mode of the adaptive filter.
The parameter may be indicative of the presence of near-end speech and/or echo path change in the microphone signal.
The method may comprise, if the parameter indicates that neither near-end speech nor echo path change is present, controlling the adaptive filter to operate in a first mode.
The method may comprise controlling the adaptive filter to operate in the first mode by continuously adapting its estimation of the echo of the far-end signal.
The method may comprise, if the parameter indicates that near-end speech is present but echo path change is not present, controlling the adaptive filter to operate in a second mode.
The method may comprise controlling the adaptive filter to operate in the second mode by suspending adaptation of its estimation of the echo of the far-end signal.
The method may comprise, if the parameter indicates that echo path change is present, controlling the adaptive filter to act in a third mode.
The method may comprise, when the adaptive filter is operating in the third mode, controlling a step size of an adaptation performed by the adaptive filter.
The method may comprise controlling the adaptive filter to operate in the third mode by re-initialising its adaptation such that the adaptation step size is set to its maximum value.
The method may comprise assigning a state to the microphone signal in dependence an operating state of the adaptive filter.
The method may comprise assigning the microphone signal state in dependence on whether the adaptive filter is in a transient state or a steady state.
The method may comprise: when the adaptive filter is in the steady state, assessing whether the microphone signal incorporates echo path change; and when the adaptive filter is in the transient state, not assessing whether the microphone signal incorporates echo path change.
The method may comprise, when the adaptive filter is in the steady state, determining that the parameter indicates that neither near-end speech nor echo path change is present if the parameter is below a first predetermined threshold.
The method may comprise, when the adaptive filter is in the steady state, determining that the parameter indicates that double-talk is present but echo path change is not present if it is between the first predetermined threshold and a second predetermined threshold.
The method may comprise, when the adaptive filter is in the steady state, determining that the parameter indicates echo path change is present if it is above the second predetermined threshold.
The method may comprise, when the adaptive filter is in the transient state, compare the parameter with a third predetermined threshold and controlling the adaptive filter to operate in the first mode if the parameter is below the third threshold and in the second mode if the parameter is above the third threshold.
The method may comprise forming the parameter by dividing the second comparison by the sum of the first and second comparisons.
The method may comprise generating the first comparison by estimating a cross-correlation of the microphone signal and the estimated echo and generating the second comparison by estimating a cross-correlation between the error signal and the estimated echo.
According to a fifth embodiment of the invention, there is provided machine readable code for implementing a method for controlling an adaptive filter.
According to a sixth embodiment of the invention, there is provided a machine readable storage medium having encoded thereon non-transitory machine-readable code implementing a method for controlling an adaptive filter.



BRIEF DESCRIPTION OF THE DRAWINGS
The present invention will now be described by way of example with reference to the accompanying drawings. In the drawings:
FIG. 1a shows an example of near-end and far-end in telephony;
FIG. 1b shows an architecture of an exemplary echo path monitoring system;
FIG. 2 shows an exemplary process for determining an appropriate adaptive filter operating mode based on the value of a discrimination parameter;
FIG. 3 shows the variation of a discrimination parameter during different states of echo cancellation;
FIG. 4 shows the variation in a discrimination parameter for sample based processing;
FIG. 5 shows state discrimination for a CSS signal;
FIG. 6 shows a comparison plot of different discrimination parameters during an echo path change in a CSS signal for a dot product implementation;
FIG. 7 shows a comparison plot of different discrimination parameters during an echo path change in a CSS signal for a moving average implementation;
FIG. 8 shows a comparison plot of different discrimination parameters during an echo path change in a speech signal for a dot product implementation; and
FIG. 9 shows a comparison plot of different discrimination parameters during an echo path change in a speech signal for a moving average implementation.



DETAILED DESCRIPTION
An echo path monitoring system may be configured to generate a parameter that is indicative of the state of a microphone signal. The echo path monitoring system may also be configured to control an adaptive filter for cancelling echo in a telephony system. The echo path monitoring system may control the adaptive filter in dependence on the parameter so that the operating mode of the filter is set in dependence on contents of the microphone signal, in particular whether it contains only far-end speech or near-end speech or double talk, or only silence or ambient noise at the near-end, and/or echo path change.
FIG. 1 b shows an example of an echo path monitoring system generally at 101 (represented by the dotted line). The system is configured to receive a microphone signal d, an estimated echo signal ŷ, and an error signal e, which represents the difference between the microphone signal and the estimated echo and is output by subtractor 112. Microphone 103 captures a signal that includes an echo of a signal output by loudspeaker 104. The echo is a delayed version of far-end signal x filtered by the acoustic environment, represented by h. The system comprises two comparison generators 106, 107. The first comparison generator 106 compares the microphone signal d with the estimated echo ŷ. The second comparison generator 107 compares the error signal e with the estimated echo ŷ.
The comparisons generated by the two comparison generators are passed to operation state discriminator 108, which is configured to control adaptive filter 105. The operation state discriminator preferably combines the comparisons generated by the first and second comparison generators to form a parameter that is indicative of the state of the microphone signal, and particularly whether near-end speech or echo path change is present or not. The operation state discriminator in this example is configured to output two flags 110, 111 to control the operation of the adaptive filter. The first of these flags 110 is raised to indicate the presence of echo path change, which causes the filter parameter generator 109 to reset the critical convergence parameters for the adaptive filter. The second flag 111 is raised to indicate that adaptation of the filter should be frozen. Normally this is because the parameter indicates the presence of near-end speech, but it could also be because far-end speech has stopped so that the far-end signal comprises only silence or ambient background noise.
The operation state discriminator may further comprise a steady-state state discriminator and a transient-state state discriminator (not shown) for controlling the operation of the adaptive filter in dependence on its current operating state (described in more detail below).
The role of the adaptive filter is to identify the acoustic echo path between a communication terminal's loudspeaker and its microphone. This is predominantly the acoustic impulse response of the room, but it may also incorporate elements relating to the hardware and related software in the audio driver interface and other devices in the audio path. The adaptive filter uses the estimated impulse response to generate an estimate of the echo signal, which can then be removed from the audio signal captured by the microphone. The adaptive filter is preferably a Variable Step Size (VSS) filter. The choice of step size reflects a trade-off between fast convergence and good tracking ability on the one hand and good steady state cancellation on the other.
The echo path monitoring system in FIG. 1b is shown as comprising a number of functional blocks. This is for illustrative purposes only. It is not intended to define a strict division between different parts of hardware on a chip or between different programs, procedures or functions in software. In some embodiments, some or all of the algorithms described herein may be performed wholly or partly in hardware. In most practical implementations, the echo path monitoring system will be implemented by a processor acting under software control.
The comparison generators may use any appropriate mathematical operation to compare the respective signals. Suitable examples may include cross-correlation and covariance calculations. The resulting comparisons suitably provide the operation state discriminator with a measure of how similar the respective signals are to each other.
Adaptation is generally frozen during the presence of near-end speech. Conventionally a Double-talk Detector (DTD) (sometimes referred to as a Near-end Signal Detector (NSD)) is used as an indicator for freezing the filter. The DTD detects the presence of a near-end speech signal in the microphone signal. The most popular DTDs are projection based, as they are technically simple, easy to implement and perform reasonably well in most use scenarios. Such DTDs are at risk of misclassifying echo path change as the presence of a near-end signal, causing adaptation to be frozen. In the case of an adaptive filter with VSS-based control, the adaptive step size can become zero or very low as the filter is continuously adapted. The risk is that the step size may be zero when echo path change occurs and then the filter adaptation is frozen just when it is required the most. The consequence can be echo and near-end speech distortion for the remainder of the call.
In one example, the microphone signal may be assigned one of three different states:

    
    
        STATE 1: Far-end talk alone
        STATE 2: Near-end speech, either alone or in combination with far-end speech, or ambient background noise or silence
        STATE 3: Echo path change in STATE 1 or STATE 2
    
    


In many situations where the near-end signal contains significant signal energy that is independent of any echo this will be due to talking at the near-end. This situation is conveniently denoted “near-end speech” herein. The signal energy might, of course, be due to a different sound source. This is particularly true during teleconferencing or hands-free operation. Therefore, the term “near-end speech” is used to refer to any significant signal energy in the near-end signal that is not due to an echo. It should also be understood that the term “near-end speech” is largely synonymous with the term “double-talk”.
The adaptive filter is well-suited to slow-varying echo path change that occurs from time-to-time. Its usual speed of modeling/tracking echo path change may not be fast enough to track sudden echo path change, however. Detecting echo path change quickly and accurately allows the filter to be placed in an operational mode that is better able to adapt quickly to the new echo path than its conventional mode of continuous adaptation. This ability to adapt to sudden changes in the echo path is becoming increasingly important. Sudden changes tend to be more common in VoIP (Voice over Internet Protocol) systems than in traditional telephony. This is because many of these systems are implemented by applications running at user level, which face being prioritized next to threads for other user applications, real time processing of data etc. Consequently these systems can tend to see frequent, sudden pure delay changes. Other scenarios that may result in sudden echo path change are when either the microphone or the speaker are muted during a conference call, when calls are conducted during high speed travel or when the relative position of a speaker and a microphone changes during hands free operation.
The echo path change detector may control the adaptive filter to operate in a mode that is appropriate to the state of the microphone signal. Suitably this involves controlling the filter's adaptation. For example, during STATE1, the filter may be adapted continuously; during STATE2, filter adaptation may be frozen to avoid filter divergence; and during STATE3, critical filter convergence parameters may be re-initialized. This may involve re-initializing the adaptation step-size to its maximum value and resetting the convergence counter and other implementation related parameters that control the convergence speed of the filter.
The echo path impulse response vector h can be modelled as:

h=[h0h1h2 . . . hN-1]T  (1)

Where N is the length of the echo path, sampled at same sampling instance as microphone signal d and far-end or reference input signal x.
Let y(n) be the actual acoustic echo, s(n) be the near-end signal and v(n) be the ambient background noise at discrete time instant n. The microphone signal can be written as the sum of the actual echo, the near-end signal and the ambient background noise.

d(n)=y(n)+s(n)+v(n)  (2)

Similar to h, the far-end or reference signal vector x and microphone signal vector d are given by:

x=[x(n)x(n−1)x(n−2) . . . x(n−(N−1))]T  (3)

d=[d(n)d(n−1)d(n−2) . . . d(n−(L−1))]T  (4)

Where L represents frame length or block length. Its value should not be greater than N.
The actual echo y(n) and the estimated echo ŷ(n) output by the adaptive filter are given by the true echo path h and the estimated echo path ĥ.

y(n)=hTx  (5)

ŷ(n)=ĥTx  (6)

The error signal e(n) in the acoustic echo cancellation process is given by:

e(n)=d(n)−{circumflex over (y)}(n)  (7)

This error signal is often used for adapting the adaptive filter. Commonly this adaptation is achieved using a Normalized Least Mean Square (NLMS) algorithm with a fixed or adaptive step size μ:




  
    
      
        
          
            h
            ^
          
          ⁡
          
            (
            
              n
              +
              1
            
            )
          
        
        =
        
          
            
              h
              ^
            
            ⁡
            
              (
              n
              )
            
          
          +
          
            2
            ⁢
            
              
            
            ⁢
            μ
            ⁢
            
              
                
                  e
                  ⁡
                  
                    (
                    n
                    )
                  
                
                ⁢
                
                  x
                  ⁡
                  
                    (
                    n
                    )
                  
                
              
              
                
                  
                  x
                  
                
                2
              
            
          
        
      
    
    
      
        (
        8
        )
      
    
  




The echo path change detector may operate on every sample in the time domain or on blocks of samples in the time domain. It may also operate on blocks of samples in the frequency domain or on samples in a combination of the time and frequency domains.
In the case of time domain sample-based processing, the acoustic echo estimate ŷ(n) and error signal e(n) for every discrete instant are estimated using corresponding far-end sample x(n) and microphone signal d(n). In the case of block-processing, the adaptive filter will operate on every block of the far-end signal. To generalize the implementation to be either sample-based or block-based, vector representations are used for the echo estimate ŷ, error e and microphone signal d.
Since x represents the far-end data used by the adaptive filter, vector x1 can be used to represent current block of far-end signal to be processed. Hence all the new vectors can be given as:

x1=[x(n)x(n−1)x(n−2) . . . x(n−(L−1))]T  (9)

d=[d(n)d(n−1)d(n−2) . . . d(n−(L−1))]T  (10)

e=[e(n)e(n−1)e(n−2) . . . e(n−(L−1))]T  (11)

In sample based processing, each sample of x(n) in x1 is fed to the far-end data buffer x and the oldest sample is removed. For block based processing, a chunk of data of length L is fed to the far-end data buffer allocated to x and the oldest samples of length L are removed.
The state discrimination parameter is calculated from the cross-correlation between d and ŷ (rdŷ), and cross-correlation between e and ŷ (reŷ). The cross-correlation between the estimated error and the echo estimate is given as:

reŷ=E[eŷT]  (12)

Since the error vector e is the difference between microphone output d and the echo estimate ŷ,reŷ can be given as.

reŷ=E[(d−ŷ)({circumflex over (y)})T]  (13)

After substituting microphone signal as given from (2), reŷ can be arrived as given below

reŷ=E[(y+s+v−ŷ)({circumflex over (y)})T]  (14)

Assuming s and v are un-correlated to the echo estimate ŷ, their cross-correlation is zero. So (14) can be reduced to:

reŷ=E[(y−ŷ)({circumflex over (y)})T]  (15)

From (5) and (6), and by substituting the actual echo and the echo estimate into equation (15):

reŷ=E[(hTx−ĥTx)(ĥTx)T]

reŷ=E[(hTx−ĥTx)xTĥ]

reŷ=E[(hT−ĥT)xxTĥ]

reŷ=(hT−ĥT)E[xxT]ĥ  (16)

Taking the auto-correlation of the far-end signal to be Rxx:

reŷ=(hT−ĥT)Rxxĥ  (17)

Similarly, the cross-correlation between the microphone signal and the echo estimate is given by:

rdŷ=E[dŷT]  (18)

After substituting microphone signal in (18), rdŷ can be arrived at as:

rdŷ=E[(y+s+v)({circumflex over (y)})T]  (19)

Since s and v are assumed un-correlated to the echo estimate ŷ, their cross-correlation is zero.

rdŷ=E[yŷT]  (20)

Substituting equations (5) and (6) in (20):

rdŷ=E[(hTx)(ĥTx)T]

rdŷ=E[(hTxxTĥ]

rdŷ=hTE[xxT]ĥ

rdŷ=hTRxxĥ  (21)

Based on these cross-correlation values, state discrimination parameter ζHS(n) is given by:




  
    
      
        
          
            ϛ
            HS
          
          ⁡
          
            (
            n
            )
          
        
        =
        
          
          
            
              
                r
                
                  e
                  ⁢
                  
                    y
                    ^
                  
                
              
              ⁡
              
                (
                n
                )
              
            
            
              
                
                  r
                  
                    e
                    ⁢
                    
                      y
                      ^
                    
                  
                
                ⁡
                
                  (
                  n
                  )
                
              
              +
              
                
                  r
                  
                    d
                    ⁢
                    
                      y
                      ^
                    
                  
                
                ⁡
                
                  (
                  n
                  )
                
              
            
          
          
        
      
    
    
      
        (
        22
        )
      
    
  
  
    
      
        
          
            ϛ
            HS
          
          ⁡
          
            (
            n
            )
          
        
        =
        
          
          
            
              
                (
                
                  
                    h
                    T
                  
                  -
                  
                    
                      h
                      ^
                    
                    T
                  
                
                )
              
              ⁢
              
                R
                xx
              
              ⁢
              
                h
                ^
              
            
            
              
                
                  (
                  
                    
                      h
                      T
                    
                    -
                    
                      
                        h
                        ^
                      
                      T
                    
                  
                  )
                
                ⁢
                
                  R
                  xx
                
                ⁢
                
                  h
                  ^
                
              
              +
              
                
                  h
                  T
                
                ⁢
                
                  R
                  xx
                
                ⁢
                
                  h
                  ^
                
              
            
          
          
        
      
    
    
      
        (
        23
        )
      
    
  




Let Δh=(hT−ĥT) be the misadjustment parameter. Then (23) can be reduced to:




  
    
      
        
          
            ϛ
            HS
          
          ⁡
          
            (
            n
            )
          
        
        =
        
          
          
            
              Δ
              ⁢
              
                
              
              ⁢
              
                hR
                xx
              
              ⁢
              
                h
                ^
              
            
            
              
                Δ
                ⁢
                
                  
                
                ⁢
                
                  hR
                  xx
                
                ⁢
                
                  h
                  ^
                
              
              +
              
                
                  h
                  T
                
                ⁢
                
                  R
                  xx
                
                ⁢
                
                  h
                  ^
                
              
            
          
          
        
      
    
    
      
        (
        24
        )
      
    
  




Δh is sensitive to the echo path changes as well as echo path modeling by the adaptive filter due to various reasons (such as delay in near-end speech detection, adaptation during background noise or near-end noise etc.). Equation (24) provides an optimal echo path change indicator for proper control of an adaptive filter.
During STATE 1, the misadjustment value is expected to be near to zero as the estimated impulse response reaches a steady state. This results in the ζHS(n) value also being near zero. Hence the NSI Flag and EPCI flag remain set at 0. The ζHS(n) value increases slightly during STATE 2 because the misadjustment factor has some value away from zero, but the discrimination parameter doesn't peak due to partial correlation between echo and near-end adding to both the numerator and the denominator. The NSI Flag is set to 1 during STATE 2. The EPCI Flag remains at 0. During STATE 3, the estimated impulse response may deviate greatly from the actual impulse response of the new echo path. This misadjustment (i.e. the difference between the estimated and actual impulse responses) may have high positive or negative values, or may fluctuate between high positive and negative values. The result is a high value of the ζHS(n) parameter. The EPCI flag is set to 1 in STATE 3. This flag controls the resetting of the corresponding adaptive filter parameters and allows for quick re-convergence and stable operation of the echo cancellation system.
In order to arrive at the echo path change detection algorithm, it is assumed that the near-end signal and the background noise are un-correlated to the echo estimate. In real-time scenarios partial correlation can exist. This modifies reŷ to:

reŷ=E[(y−ŷ)({circumflex over (y)})T]+E[sŷT]+E[vŷT]  (25)

From (17), this can be re-written as:

reŷ=(hT−ĥT)Rxxĥ+E[sŷT]+E[vŷT]  (26)

Similarly rdŷ transforms to:

rdŷ=E[yŷT]+E[sŷT]+E[vŷT]  (27)

From (21), (27) can be re-written as:

rdŷ=hTRxxĥT+E[sŷT]+E[vŷT]  (28)

Substituting estimated correlations reŷ and rdŷ from (26) and (28), ζHS(n) can be given as:




  
    
      
        
          
            ϛ
            HS
          
          ⁡
          
            (
            n
            )
          
        
        =
        
          
          
            
              
                Δ
                ⁢
                
                  
                
                ⁢
                
                  hR
                  xx
                
                ⁢
                
                  h
                  ^
                
              
              +
              
                E
                ⁡
                
                  [
                  
                    s
                    ⁢
                    
                      
                        y
                        ^
                      
                      T
                    
                  
                  ]
                
              
              +
              
                E
                ⁡
                
                  [
                  
                    v
                    ⁢
                    
                      
                        y
                        ^
                      
                      T
                    
                  
                  ]
                
              
            
            
              
                Δ
                ⁢
                
                  
                
                ⁢
                
                  hR
                  xx
                
                ⁢
                
                  h
                  ^
                
              
              +
              
                
                  h
                  T
                
                ⁢
                
                  R
                  xx
                
                ⁢
                
                  h
                  ^
                
              
              +
              
                E
                ⁡
                
                  [
                  
                    s
                    ⁢
                    
                      
                        y
                        ^
                      
                      T
                    
                  
                  ]
                
              
              +
              
                E
                ⁡
                
                  [
                  
                    v
                    ⁢
                    
                      
                        y
                        ^
                      
                      T
                    
                  
                  ]
                
              
            
          
          
        
      
    
    
      
        (
        29
        )
      
    
  




As both the denominator and the numerator contain E[sŷT]+E[vŷT], discriminator peaking is controlled during the presence of near-end speech or ambient background noise. Hence, a marginal value of the state discriminator indicates a near-end presence (i.e. STATE 2).
The flow chart given in FIG. 2 depicts how the adaptive filter's operating mode may be determined based on the value of the discrimination parameter. The adaptive filter first estimates the echo using the far-end signal x. The error signal is then generated by subtracting the estimated echo from the microphone signal (as illustrated by subtractor 112 in FIG. 1). The operation state discriminator (shown at 108 in FIG. 1) then estimates the operation state of the filter from the correlations of the echo estimate with the microphone signal and the error signal. These correlations are combined to form the discrimination parameter ζHS(n), as described above.
Before determining the operating mode of the filter, the operation state discriminator checks whether the filter is in a transient state or a steady state. It does this by checking the adaptation count for the filter and whether the filter has converged. The adaptation count is a measure of how many times the filter has already undergone an adaptation procedure since it was last initialized. The filter is determined to be in a transient state if the adaptation count is below a threshold and the filter has not converged. Otherwise, the filter is determined to be in a steady state.
In the example shown in FIG. 2, the operation state discriminator controls the operating mode of the filter differently depending on whether the filter is judged to be in a steady state or a transient state. If the filter is judged to be in a transient state, the discrimination parameter is compared with just one threshold (TH3 in the figure) by the transient-state state discriminator. The microphone signal is judged to be in STATE 2 if the discrimination parameter is above the threshold and to be in STATE 1 otherwise. STATE 3 is not assigned in the transient state (in this example) because it is difficult to judge echo path change before the filter coefficients have converged.
In FIG. 2, if the filter is judged to be in a steady state, the discrimination parameter is compared with two different thresholds by the steady-state state discriminator. If the discrimination parameter is below a first threshold, the operating mode of the filter is set to STATE 1. If it is between the first threshold and a second threshold, the operating mode of the filter is set to STATE 2. Finally, if the parameter is above the second threshold the operating mode of the filter is set to STATE 3.
The next step shown in FIG. 2 is to determine whether the microphone signal was judged to be in STATE 1 or not. If it is, the filter is controlled to operate in its first mode of continuous adaptation so the adaptation count is incremented by one and the filter coefficients are updated. If the operating mode is neither STATE 1 nor STATE 3 (i.e. STATE 2), then the filter is controlled to operate in its second mode. Filter adaptation is frozen and no adaptation occurs. If the operating mode is STATE 3, the filter is controlled to operate in its third mode. The filter reinitializes the critical convergence parameters. Its variable step size is set to its maximum value. The adaptation count is set to zero and the convergence parameter is also set to zero (indicating that the filter is now in a transient state). This helps the filter to re-converge quickly. Finally, filter convergence is checked before the process repeats from the beginning.
When the adaptive filter is trying to model the echo path, the discrimination parameter will have a marginal value even during single-talk, i.e. STATE 1. Until filter convergence or certain number of adaptations have been completed, the echo path detector discriminates only between STATE 1 and STATE 2. Thresholds for adaptation count may be arrived at experimentally. Convergence detection may be achieved using an appropriate algorithm. This avoids repetitive resetting of the critical convergence parameters, which may happen during echo path change as the discrimination parameter can have a high peak for some time.
Once the filter reaches convergence, the state discriminator selects between STATE1, STATE2 and STATE3. After convergence is reached, the discrimination parameter is close to zero when the microphone signal is in STATE1. When near-end speech is present, the discrimination parameter does not reach its peak but it does have a value above zero. To discriminate STATE2 from other states, the discrimination parameter has to be between thresholds TH1 and TH2 and the NSI flag is set to one accordingly. The discrimination parameter tends to peak during periods of echo path change. Once the discrimination parameter exceeds a threshold TH2, the state discriminator determines an echo path change has occurred and the EPCI flag is set to one.
Suitable values for the thresholds have been determined from experiments. As an example, the values may be chosen as: TH1=0.1 and TH2=50 for both time and frequency domain processing. The discrimination parameter has been found to usually be below 5 during near-end speech but to exceed 50 during echo path change. Suitable values for TH0 and TH3 might be 4000 and 0.3 respectively.
FIG. 3 shows how the discrimination parameter varies when the microphone signal has different states. The test signal is a Composite Source Signal (CSS) signal sampled at 8 KHz. The test signal has a double-talk region from samples 35000 to 52000. An echo path change is introduced at sample 137632. The area zoomed and shown by the dotted line gives the behavior of the parameter during near-end speech, i.e. STATE2. It can be seen that the discrimination parameter is away from zero. Similarly the area in the plot given by the dashed line is the region of echo path change (i.e. STATE3) where the parameter value shoots up. During steady state operation of the filter and STATE 1 of the microphone signal the discrimination parameter is close to zero, as indicated by the solid line.
Some specific implementation details of the proposed technique for time or frequency domain based implementation of the adaptive filter are given below. This is for the purpose of example only and it should be understood that the scope of the invention is not limited to any of the specific implementations described below.
Dot Product Based Implementation
a) Discrimination Parameter Estimation Using Sample-by-Sample Processing
Three memory buffers e_buf, d_buf and ŷ_buf are used to store the past values of the error signal, microphone signal and the estimated echo respectively. To update the memory buffers and the correlation values, a counter indx1 is used. Initially all buffer locations and counters are set to zero. The counter indx1 is incremented for processing every sample. When the counter value reaches K, it is reset again to zero.
The correlation values are estimated using separate static variables. Every sample's correlation is estimated by adding a correlation of the current sample and removing a corresponding correlation of the oldest sample stored in the buffers.

reŷ(n)=reŷ(n−1)−e_buf(indx1)ŷ_buf(indx1)+e(n){circumflex over (y)}(n)  (30)

rdŷ(n)=rdŷ(n−1)−d_buf(indx1)ŷ_buf(indx1)+d(n){circumflex over (y)}(n)  (31)

The oldest sample is also removed or replaced by the current sample in the respective buffer.

e_buf(indx1)=e(n)  (32)

ŷ_buf(indx1)={circumflex over (y)}(n)  (33)

d_buf(indx1)=d(n)  (34)

After updating the buffers, the counter is incremented by one circularly within K:

indx1=indx1+1

if(indx1>K)

indx1=0  (35)

The value of K is suitably between 200 and 300 for stable operation.
Finally, the discrimination parameter is calculated from the correlations estimated as below.




  
    
      
        
          
            
              ς
              HS
              num
            
            ⁡
            
              (
              n
              )
            
          
          =
          
            
            
              
                r
                
                  e
                  ⁢
                  
                    y
                    ^
                  
                
              
              ⁡
              
                (
                n
                )
              
            
            
          
        
        ⁢
        
          

        
        ⁢
        
          
            
              ς
              HS
              den
            
            ⁡
            
              (
              n
              )
            
          
          =
          
            
            
              
                
                  r
                  
                    e
                    ⁢
                    
                      y
                      ^
                    
                  
                
                ⁡
                
                  (
                  n
                  )
                
              
              +
              
                
                  r
                  
                    d
                    ⁢
                    
                      y
                      ^
                    
                  
                
                ⁡
                
                  (
                  n
                  )
                
              
            
            
          
        
        ⁢
        
          

        
        ⁢
        
          
            
              ς
              HS
            
            ⁡
            
              (
              n
              )
            
          
          =
          
            
              
                ϛ
                HS
                num
              
              ⁡
              
                (
                n
                )
              
            
            
              
                ϛ
                HS
                den
              
              ⁡
              
                (
                n
                )
              
            
          
        
      
    
    
      
        (
        36
        )
      
    
  




Table 1 summarizes the memory required and the operations involved in the implementation of sample based processing.







TABLE 1







Memory required and basic operations involved when K = 300 for sample


based processing















Others


Sampling
Memory

Add/Sub/
(Comparison/


rate
(Bytes)
Division
Mult
assignment)














8000
300 * 3 * 2 =
1
4 + 2 + 5
2 + 8



1800


16000
2 * 300 * 3 * 2 =



3600


32000
4 * 300 * 3 * 2 =



7200









For processors where division operations take more cycles than others, the state discrimination decision equations can be formulated to avoid division as follows:

If ζHSnum(n)<TH1*ζHSden(n)State=STATE1

Else if TH1*ζHSden(n)<ζHSnum(n)<TH2*ζHSden(n)

State=STATE2

else

State=STATE3  (37)

Irrespective of the sampling rate, the number of basic operations per sample processing remains the same.
b) Discrimination Parameter Estimation for Block Processing
For a block-processing based adaptive filter, two memory buffers ye_buf and yd_buf are used to store the correlations reŷ and rdŷ estimated every frame. To update these memory buffers another counter indx2 is used, which is similar to the counter indx1 in sample based processing.
The summation of cross-correlations of block of corresponding samples estimated for every frame and their summation for past M−1 frames is used for estimating the final correlations reŷ(l) and rdŷ(l) respectively.

reŷ(l)=reŷ(l−1)−ye_buf(indx2)+Σi=1Lŷ(i)e(i)  (38)

rdŷ(l)=rdŷ(l−1)−yd_buf(indx2)+Σi=1Lŷ(i)d(i)  (39)

The oldest frame's cross-correlation is also removed or replaced with the corresponding current estimate in the appropriate memory buffer.

ye_buf(indx2)=Σi=1Lŷ(i)e(i)  (40)

yd_buf(indx2)=Σi=1Lŷ(i)d(i)  (41)

After updating the buffers, the counter is incremented by one for every frame circularly within M:

indx2=indx2+1

if(indx1>M)

indx2=0  (42)

ye_buf and yd_buf are vectors of length M. The value of M is suitably between 200/L and 300/L for stable operation. From these correlation estimates, the discrimination parameter ζHS(l) for the present frame is calculated similar to the equation (36).




  
    
      
        
          
            
              ϛ
              HS
              num
            
            ⁡
            
              (
              l
              )
            
          
          =
          
            
            
              
                r
                
                  e
                  ⁢
                  
                    y
                    ^
                  
                
              
              ⁡
              
                (
                l
                )
              
            
            
          
        
        ⁢
        
          

        
        ⁢
        
          
            
              ϛ
              HS
              den
            
            ⁡
            
              (
              l
              )
            
          
          =
          
            
            
              
                
                  r
                  
                    e
                    ⁢
                    
                      y
                      ^
                    
                  
                
                ⁡
                
                  (
                  l
                  )
                
              
              +
              
                
                  r
                  
                    d
                    ⁢
                    
                      y
                      ^
                    
                  
                
                ⁡
                
                  (
                  l
                  )
                
              
            
            
          
        
        ⁢
        
          

        
        ⁢
        
          
            
              ϛ
              HS
            
            ⁡
            
              (
              l
              )
            
          
          =
          
            
              
                ϛ
                HS
                num
              
              ⁡
              
                (
                l
                )
              
            
            
              
                ϛ
                HS
                den
              
              ⁡
              
                (
                l
                )
              
            
          
        
      
    
    
      
        (
        43
        )
      
    
  




Table 2 summarizes the memory required and the operations involved in the implementation of block processing based AEEF.







TABLE 2







Memory required and basic operations involved when


K = 300 for frame based processing















Others


Sampling
Memory

Add/Sub
(Comparison/


rate
(Bytes)
Division
/Mult
assignment)





 8000 16000 32000




  
    
      
        
          
            300
            
              L
              
                8
                ⁢
                
                  
                
                ⁢
                KHz
              
            
          
          *
          2
          *
          4
        
      
    
    
      
        
          (
          
            32
            ⁢
            
              
            
            ⁢
            bit
            ⁢
            
              
            
            ⁢
            buffers
          
          )
        
      
    
  
   




1
2L + 3 + 2L
2 + 9









The value of L is varied according to the sampling rate. Hence, the number of basic operations required for a frame of processing also varies with respect to the sampling rate. The memory required is irrespective of the sampling rate, however, as the buffer size M is a ratio and is given by 300/L8KHz, where, L8KHz is the frame size used for processing an 8 kHz signal. To avoid division operations, state discrimination can be achieved in a similar way to that given by equation (37).
Low-Resource, Moving Average Based Implementation
In order to minimize the memory resource required, instead of using the dot product of the buffers containing past data, correlation estimates reŷ and rdŷ can be obtained by a moving average technique. A weight of A is given to the present estimate and (1−λ) to the previous estimate. The moving average value has to be updated every sample and hence the implementation is same for either the sample based or block based processing. It is given by:

reŷ(n)=reŷ(n−1)+λ({circumflex over (y)}(n)*e(n)−reŷ(n−1))  (44)

rdŷ(n)=rdŷ(n−1)+λ({circumflex over (y)}(n)*d(n)−rdŷ(n−1))  (45)

From these correlation estimates the discrimination parameter ζHS is calculated in accordance with equation (36).
Table 3 summarizes the memory required and the operations involved in the low resource implementation of discrimination parameter.







TABLE 3







Memory required and basic operations involved in low resource


implementation for each sample processed















Others



Memory

Add/Sub/
(Comparison/


Sampling rate
(Bytes)
Division
Mult
assignment)














8000
2 * 4
1
3 + 2 + 2
2 + 3


16000
(32 bit buffers)


32000









Although this implementation requires much less memory than the dot product implementation, the discrimination parameter value is highly dependent on the value of λ, which may sometimes result in the wrong inferences being drawn. The dot product based implementation is highly stable, even though it has slightly higher detection delay.
Practical Results
The discrimination parameter described herein has been found to perform better in practice than existing methods for detecting echo path change.
An example of an existing method is the echo path change detector described in “A Novel Normalised Cross-Correlation Based Echo-Path Change Detector” by Mohammad Asif Iqbal and Steven L. Grant. This paper suggests the following parameter as being sensitive to echo path change but not to near-end speech:




  
    
      
        
          ϛ
          asif
        
        =
        
          
          
            
              
                
                  (
                  
                    h
                    -
                    
                      h
                      ^
                    
                  
                  )
                
                T
              
              ⁢
              
                R
                xx
              
              ⁢
              
                h
                ^
              
            
            
              
                
                  h
                  ^
                
                T
              
              ⁢
              
                R
                xx
              
              ⁢
              h
            
          
          
        
      
    
    
      
        (
        46
        )
      
    
  




Although the paper claims that this parameter is normalized, this appears not to be the case. During echo path change or any other period of inaccurate echo estimation, a sign difference between the estimated and the actual impulse response (the (h−ĥ)T term in the numerator) can become high. Rxxĥ is likely to be a summation of much lower values. This results in the numerator dominating the denominator, and hence a parameter that is not normalised.
The discrimination parameter described herein was tested using speech and CSS test signals. The CSS test signal had near-end speech added from samples 35000 to 52000. An echo path change was incorporated from sample 137632. The speech test signal had near-end speech added from samples 30000 to 50000 and an echo path change incorporated at 73504. Ensemble averages of the test results were analyzed.
FIG. 4 shows the variation of the discrimination parameter ζHS for a continuous CSS signal convolved with an ITU-T G.340 impulse response. Echo path change was introduced with the G.167 response.
FIG. 5 illustrates the state discrimination of the CSS signal. It shows that from samples 35000 to 52000 the microphone signal was judged to be in STATE2; from sample 137632, it moved to STATE3. The remainder of the time the microphone signal was judged to be in STATE1.
FIG. 6 depicts the echo path detection delay comparison between the proposed method and equation (46) for a dot product implementation. It can be observed that the proposed technique takes about 120 samples to detect the echo path change whereas equation (46) takes about 235 samples.
FIG. 7 compares the performance of the method described herein with equation (46) for the CSS signal, where correlations are estimated using the moving average technique. The proposed technique takes just 80 samples for echo path detection, whereas equation (46) takes about 230 samples.
FIG. 8 and FIG. 9 give the echo path detection comparison between the proposed technique and the method described in equation (46) for a dot product based correlation estimate and for a moving average based correlation estimate respectively for a speech signal. It is observed that the proposed technique performs far better with detection delay occurring within 50 samples compared with 200 to 250 samples for equation (46).
Existing techniques are not quick enough in practice at indicating echo path change, which can result in an audible echo during re-convergence of the adaptive filter. The technique described herein, in contrast, provides very quick detection of echo path change or high mis-adjustment in the filter. The technique can also discriminate between double-talk and single-talk, which enables the adaptive filter to be properly controlled for stable echo cancellation.
The proposed technique is very robust and does not cause spurious detection, even during high near-end speech whereas the inventors have observed spurious echo path change decisions with other techniques during continuous near-end speech.
The discrimination parameter has a high dynamic range, which helps in selection of right threshold for clear discrimination of all possible states of operation of an echo cancellation system. Thus, the proposed technique gives robust and stable operation of the echo cancellation system using state based control. It can work with any adaptive echo cancellation system and can assist or even replace existing control modules.
The applicant hereby discloses in isolation each individual feature described herein and any combination of two or more such features, to the extent that such features or combinations are capable of being carried out based on the present specification as a whole in the light of the common general knowledge of a person skilled in the art, irrespective of whether such features or combinations of features solve any problems disclosed herein, and without limitation to the scope of the claims. The applicant indicates that aspects of the present invention may consist of any such individual feature or combination of features. In view of the foregoing description it will be evident to a person skilled in the art that various modifications may be made within the scope of the invention.

## Claims

1. An echo path monitoring system for controlling an adaptive filter configured to estimate an echo of a far-end signal comprised in a microphone signal, the system comprising:
a comparison generator configured to compare the microphone signal with the estimated echo to obtain a first comparison result and compare an error signal, which represents a difference between the microphone signal and the estimated echo, with the estimated echo to obtain a second comparison result; and
a controller configured to combine the results of the first and second comparisons to form a parameter indicative of a state of the microphone signal and, in dependence on said parameter, control an operating mode of the adaptive filter, wherein the parameter is indicative of the presence of an echo path change in the microphone signal, and the controller is configured to form the parameter by dividing the result of the second comparison by the sum of the results of the first and second comparisons.

2. An echo path monitoring system as claimed in claim 1, the parameter further being indicative of the presence of near-end speech in the microphone signal.

3. An echo path monitoring system as claimed in claim 2, the controller being configured to, if the parameter indicates that neither near-end speech nor echo path change is present, control the adaptive filter to operate in a first mode.

4. An echo path monitoring system as claimed in claim 3, the controller being configured to control the adaptive filter to operate in the first mode by continuously adapting its estimation of the echo of the far-end signal.

5. An echo path monitoring system as claimed in claim 2, the controller being configured to, if the parameter indicates that near-end speech is present but echo path change is not present, control the adaptive filter to operate in a second mode.

6. An echo path monitoring system as claimed in claim 5, the controller being configured to control the adaptive filter to operate in the second mode by suspending adaptation of its estimation of the echo of the far-end signal.

7. An echo path monitoring system as claimed in claim 2, the controller being configured to, if the parameter indicates that echo path change is present, control the adaptive filter to act in a third mode.

8. An echo path monitoring system as claimed in claim 7, the controller configured to, when the adaptive filter is operating in the third mode, control a step size of an adaptation performed by the adaptive filter.

9. An echo path monitoring system as claimed in claim 8, the controller being configured to control the adaptive filter to operate in the third mode by re-initialising its adaptation such that the adaptation step size is set to its maximum value and other convergence-related parameters are reset.

10. An echo path monitoring system as claimed in claim 1, the controller being configured to assign a state to the microphone signal in dependence an operating state of the adaptive filter.

11. An echo path monitoring system as claimed in claim 10, the controller being configured to assign the microphone signal state in dependence on whether the adaptive filter is in a transient state or a steady state.

12. An echo path monitoring system as claimed in claim 11, the controller being configured to:
when the adaptive filter is in the steady state, assess whether the microphone signal incorporates echo path change; and
when the adaptive filter is in the transient state, not assess whether the microphone signal incorporates echo path change.

13. An echo path monitoring system as claimed in claim 11, the controller being configured to, when the adaptive filter is in the steady state, determine that the parameter indicates that neither near-end speech nor echo path change is present if the parameter is below a first predetermined threshold.

14. An echo path monitoring system as claimed in claim 11, the controller being configured to, when the adaptive filter is in the steady state, determine that the parameter indicates that double-talk is present but echo path change is not present if it is between the first predetermined threshold and a second predetermined threshold.

15. An echo path monitoring system as claimed in claim 11, the controller being configured to, when the adaptive filter is in the steady state, determine that the parameter indicates echo path change is present if it is above a second predetermined threshold.

16. An echo path monitoring system as claimed in claim 11, the controller being configured to, when the adaptive filter is in the transient state, compare the parameter with a third predetermined threshold and control the adaptive filter to operate in a first mode if the parameter is below the third threshold and in a second mode if the parameter is above the third threshold.

17. An echo path monitoring system as claimed in claim 1, the comparison generator being configured to generate the first comparison by estimating a cross-correlation of the microphone signal and the estimated echo and to generate the second comparison by estimating a cross-correlation between the error signal and the estimated echo.

18. A method for controlling an adaptive filter that is configured to estimate an echo of a far-end signal comprised in a microphone signal, the method comprising:
comparing the microphone signal with the estimated echo to obtain a first comparison result;
comparing an error signal, which represents a difference between the microphone signal and the estimated echo, with the estimated echo to obtain a second comparison result; combining the results of the first and second comparisons to form a parameter indicative of a state of the microphone signal, wherein the parameter is indicative of the presence of an echo path change in the microphone signal, the parameter being formed by dividing the result of the second comparison by the sum of the results of the first and second comparisons; and
in dependence on said parameter, controlling an operating mode of the adaptive filter the controller being configured to form the parameter by dividing the second comparison by the sum of the first and second comparisons.

19. A machine readable storage medium having encoded thereon non-transitory machine-readable code implementing an echo path monitoring system according to claim 1.

20. An echo path monitoring system for controlling an adaptive filter configured to estimate an echo of a far-end signal contained in a microphone signal, the system comprising:
a comparison generator configured to compare the microphone signal with the estimated echo to obtain a first comparison result and compare an error signal, which represents a difference between the microphone signal and the estimated echo, with the estimated echo to obtain a second comparison result; and
a controller configured to combine the results of the first and second comparisons to form a parameter indicative of a state of the microphone signal by at least dividing the result of the second comparison by the sum of the results of the first and second comparisons, and in dependence on said parameter, control an operating mode of the adaptive filter.