ELIMINATING DIVISION IN NLMS ALGORITHM

Abstract: A method of using a digital signal processor to calculate the conventional normalized least mean square (NLMS) adaptation algorithm without using a division operation. The method involves estimation, multiplication and comparison steps with appropriate adjustment in the estimation to reach the solution. The advantage of the method is that the more complex instruction cycles required for the division operation are avoided.

Description: ELIMINATING DIVISION IN NLMS ALGORITHM Field of the Invention This invention relates to digital signal processors (DSPs) and to an iterative method to eliminate the division operation in the NLMS algorithm implemented on a DSP chip. Background of the Invention There are many applications in which a digital signal processor is required to perform a calculation involving a division operation. One such application is the NLMS algorithm. NLMS (normalized least mean square) represents an adaptation algorithm widely used m the telecommunications industry and in signal processing in general. For example, the algorithm is used in acoustic subsystems for telephone terminals operable in handsfree mode. In this implementation the algorithm is used to perform echo cancellation. It can also be used to do noise cancellation, equalization, system identification and so on. These applications require continual sampling of signals and to make use of the sampled data to determine appropriate changes required by the system's digital signal processoi to optimize the system performance. In order to carry out the implementation of the NLMS algorithm, the step size used in each sampling interval must be calculated by the digital signal processor. In the NLMS adaptation algorithm the step size, denoted by μ(ιή at time n is given by the equation: μ(n) = — (Equation 1) <Λ 2 (n)> where β is a scaling constant and < \ 2 (ιή > is a weighted time average of a certain number of past samples of x 2 (/c) , where k = n , rt-1, n — 2 , , i.e., an estimate of the energy in input samples x(n) up to time n . As apparent from Equation 1, a division step is required in order to calculate μ(n) in every sampling interval. Most digital signal processors take many more processing steps to perform a division operation than a multiplication. This means that more processing time is required. For example, it takes 37 instruction cycles for a Motorola DSP56100 to perform a routine division operation. The same DSP can perform a multiplication operation using only one instruction cycle. The NLMS algorithm s given as one example of an operation involving an equation needing division operations. It will be obvious that the benefits derived from eliminating division from the processing cycles extend to other calculations where the quotient changes gradually over Summary of Invention It is an object of the present invention to provide in a digital signal processor a method of processing an equation needing a division without performing an actual division operation. It is a further object of the invention to provide in a digital signal processor a method of calculating an NLMS adaptation algorithm to eliminate the real division operation. It is a further object of the invention to implement the algorithm using multiplica ion and comparison steps . Therefore m accordance with a first aspect of the present invention there is provided in a digital signal processor a divisioniess method of obtaining a quotient from an equation having a numerator and denominator comprising the steps of: giving the quotient an estimated value; multiplying the estimated quotient and the denominator; comparing the product with the numerator; and adjusting the estimated quotient so that the product of the estimated quotient and the denominator substantιal]y equals the numerator. In accordance with a preferred embodiment of the invention the equation is an NLMS adaptation algorithm. In accordance with a further aspect of the invention there is provided in an acoustic system of a telephone terminal having a digital signal processor, a divisioniess method of calculating an NLMS adaptation N algorithm having the form. Q = —- D where Q = quotient, N - numerator , and D - denominator ≠ & comprising the steps of: (a) choosing Q' , an estimated value of Q , (b) multiplying Q' and D to get a product Q' D , (c) comparing Q' D and N , and (d) adjusting Q' as required so that Q' D is substantially equal to N . Brief Description of the Drawings The invention will now be described in greater detail with reference to the attached drawings wherein: FIGURE 1 is a flow diagram of a divisioniess calculation when the denominator as shown in Equation 1 is available; and FIGURE 2 is a flow diagram of a divisioniess calculation when the denominator as shown in Equation 1 is not available. Detailed Description of the Invention In general terms the invention relates to the processing, by a digital signal processor, of an equation such as : N N Q - (Equation 2) D where : Q = quotient N = numerator, and D - denominator ≠ 0 The process involves a multiplication and comparison technique. Thus, the first step is to provide a first estimate of the quotient which will be known as Q' . Then Q' can be multiplied with D and the product compared with N . If N is greater than Q' - D and D is positive, then Q' must be increased to new estimate of the quotient. Conversely, if N is less than Q - D and D is positive, then Q' must be decreased to a new estimate of the quotient. If D is negative, then the adjustments made to Q' must be in the opposite directions from those described above . This process can be expressed m mathematical form as follows. The estimate for the quotient at time // is denoted by Q'(n) . The comparison result Δ(/ι) = N - Q ιι) - D (Equation 3) is used to derive the estimate for the quotient at time / * + l by Q'(n + l) - Q'(n) + sgn(D) - G " A(n) (Equation 4) where sgn(D) is the sign of D and is defined as (Equation 5) and G is a positive constant The process is continued in every sampling interval. Thus, as long as N and D vary relatively slowly over time, the actual value of the estimated quotient will become such that the product of the estimated quotient and the denominator is substantially equal to the numerator. This means the estimated quotient has become a good estimate for the true quotient. This version of the processing steps can now be applied to the NLMS adaptation algorithm since here both numerator and denominator vary slowly over time. Also, because the denominator is always positive in the application with the NLMS adaptation algorithm, there is no need to incorporate its sign as requested by (Equation 4). Being a first-order closed loop feedback system, the invention estimates the quotient in Equation 1 iteratively. According to Equation 1, a certain μ'(n) , at sampling interval n , is a good approximation to μ(ιή if: μ'{n) < x 2 (n) > ~ β (Equation 6) Furthermore, one can use a multiplication and comparison, as in Equation 3, to tell how μ'{n) deviates from the target μ(n) and then to modify μ'{n) accordingly. The invention can be implemented m two different situations, i.e., where the denominator, < x 2 (n) > , is readily available and where it is not. When < x 2 (n) > , the average of certain number of past samples of x 2 (k) , (k = n, «-l, n - 2,...) , has already been calculated for some other purposes, this < x 2 (n) > can be made use of directly. The flow diagram in FIGURE 1 shows how the concept of the present invention is implemented in this case. The corresponding analytical form is given below: Δ(/ι) = β -μ'{ιι - \) < x 2 (n) > (Equation 7) μ'(/ι) = μ'(/ι-l) + G-Δ(//) (Equation 8) In the above: μ'(w-l) is the previous estimate of the step size, i.e., the one used by the NLMS algorithm in the last sampling interval, indexed by n - 1 ; μ'{n) is the current estimate of the step size, which is to be used by the NLMS algorithm in the current sampling interval, i.e., sampling interval n ; and G is a positive factor that controls the rate of change of μ'(n) . By looking at Equation 6, one can tell that Δ(/ι) given in Equation 7 is a scaled version of the negative deviation of μ'(rt-l) from the target. In Equation 8, this negative deviation is scaled and used to modify μ'(/ * -l) to form a new estimate μ'(tι) , which is closer to the target. When < x 2 (n) > is not needed for any other purposes in the rest of the DSP system so that it is not readily available, it is possible to calculate it and then use the method set out above to derive μ'('i) . There is, however, a more efficient way of deriving μ'(n) ; < x (n) > does not have to be explicitly calculated at all . This implementation scheme is shown in FIGURE 2, and the corresponding analytical form is given in Equation 9 and Equation 10. Δ(«) = β -μ'{n - \) x 2 (n) (Equation 9) μ'(«) = μ'(«-l)+G-Δ(/ * ) (Equation 10) It can be seen that this implementation scheme differs from that previously described m that < λ 2 (n) > has been replaced by λ '2 (/ι), i.e., a single sample rather than an averaged version of it is used. Since as a single sample, x 2 (n) fluctuates much more than < .\ ' (n) > does over time, G here has to be much smaller than in FIGURE 1 and m Equation 8 in order to reduce the fluctuation of μ'(n) over time. By implementing the invention this way, it is possible to derive < x 2 (n) > implicitly. The fact that G is much smaller does not reduce the implementation's response time. All that has been done is to move the response time from the calculation of <Γ(/ * )> to Equation 10. The method according to this invention has been implemented in acoustic echo cancellers on a Motorola DSP56156 digital signal processor platform. In this application the implementation scheme described above, for the case where < x 2 (n) > is available, was used. G was chosen as 4. As previously indicated, it takes 37 instruction cycles to perform a "Signed 16 Bit Result Divide", a division routine that is suitable for solving Equation 1 (see Motorola, DSP56100 Digital Signal Processor Family Manual, DSP56100FM/AD, 1993, p. B-32). The assembly code listed in TABLE 1 shows that only 10 instruction cycles are needed to solve the equation using the process according to the invention. TABLE 1 ; Update step size mu, converging to βl < x 2 (n) > I -cycles move x:G_AVx,y0 yO < - - G < x 2 (n) > move x:mu, xO xO < - μ'(n - l) move #G*beta,a al < -- G β macr -y0,x0,a al < - - G A{n) add x0,a al <- - μ n) = μ'(n - l) + G A(n) 1 move a , : u Save μ'(n) 2 TOTAL 10 It will be apparent to one skilled in the art that there can be even more savings if < \ 2 (n) > is not needed anywhere else in the system so that the second implementation scheme is used. This is because then there is no need for calculating while with the conventional NLMS algorithm this quantity has to be calculated anyway since Equation 1 needs it. In summary, the present invention represents a process that eliminates the real-time critical division operation involved in the widely used NLMS adaptation algorithm. The real-time saving is about 73% compared with division operations, if the first implementation scheme is used, and even more if the second scheme is used. Although a particular embodiment has been described and illustrated it will be apparent to one skilled in the art that variations and alternatives to the described process are possible. It is to be understood that such variations and alternatives will not depart from the scope of the invention as defined by the appended claims.

Claims: I CLAIM : 1. In a digital signal processor, a divisioniess method of obtaining a quotient from an equation having a numerator and a denominator, where the quotient changes gradually over time, comprising the steps of: (a) giving the quotient an estimated value; (b) multiplying the estimated quotient and the denominator; (c) comparing the product with the numerator; and (d) adjusting the estimated quotient so that the product of the estimated quotient and the denominator substantially equals the numerator. 2. The method as defined in claim 1, wherein the equation is an NLMS adaptation algorithm. 3. In an acoustic system of a telephone terminal having a digital signal processor, a divisioniess method used in the normalized least mean square adaptation N algorithm to find: Q - — D where Q = quotient N - numerator, and D - denominator ≠ 0 comprising the steps of: (a) choosing an estimated value of Q , (b) multiplying estimated Q and D , (c) comparing the product of (b) and N , and (d) adjusting the estimated value as required so that the product of (b) is substantially equal to N .

Inventors: DING HEPING, DING, HEPING
Applicants: NORTHERN TELECOM LTD, NORTHERN TELECOM LIMITED
Application year: 1997
Main classification: G06F17
IPC codes: G06F17