<< Chapter < Page Chapter >> Page >
Fourth Section

Introduction to lms adaptive filter

Solving the lower frequency noise speaker-microphone topological problem requires implementation of adaptive filters. An adaptive filter has two major components: an FIR filter and an Adaptive Algorithm. The FIR filter’s transfer function is controlled by variable parameters, computed by the adaptive algorithm, that optimize output. The algorithm for this project is Least Mean Squares (LMS). The whole process can be described by the diagram below:

Picture of System Block Diagram
System Block diagram

The FIR filter is constructed with N coefficients, w, and delays to generate the desired output. With linear combinations of these delayed signals, the filter can produce excellent results.

FIR diagram
Structure of an FIR filter
LMS diagram
LMS Algorithm Diagram

Let’s first go through the system and get to know the basic idea. The system has two inputs and one output. The two inputs are the pure noise Y(n) and the input recorded in the environment (human voice V(n) plus noise S(n)). The output is our desired signal (human voice without noise or with little noise) Eestimate(n). It’s an estimated signal of pure human voice; it is also called the error signal in the LMS algorithm.

The system consists of a summer and an Adaptive Filter. The adaptive filter consists of a FIR filter (shown in the figure above) and an adaptive algorithm. The noise cancellation happens in the summer. We will see its details in the next paragraph. The feedback loop is the most important part of this system. It takes the output of the system Eestimate(n) (also the output of the summer) and feeds it to the adaptive algorithm. Then the adaptive algorithm updates the coefficients w(n) of the FIR filter. The output of the adaptive filter is the signal Yestimate(n). Feed this output to the summer. By doing so, we improve the approximation of noise Yestimate(n). In the summer we do the cancellation again and get a new output Eestimate(n). This completes one loop. After each iteration we compute the power of Eestimate(n), the number we want to minimize using the LMS algorithm. In short, the main function of the adaptive filter is to minimize the power of the error signal Eestimate(n) by adjusting the coefficients of the FIR filter via the LMS algorithm.

Now let’s zoom into the details of the system. It runs in following five steps:

  1. Set up a initial value for w m (0)
  2. Design the output of the FIR filter: Y estimate (n)=∑ M m=0 w m (n)Y(n-m), where M is the order of the FIR filter.
  3. Get E estimate (n), where E estimate (n)=x(n)-Y estimate (n). This step happens in the Addition component of the system.
  4. Use the LMS algorithm to update the coefficients w(n) of the FIR filter. w m (n+1)= w m (n)+2u Eestimate (n)*s(n-m), for m in [0,M]. The power we want to minimize is: E[E estimate (n) 2 ]=E[V(n) 2 ]+(E[S(n)-Y estimate (n)]) 2 Notice that we introduced a new variable u here. We will explain it later.
  5. Change n to n+1, and repeat the four steps above

Let’s call u in step 4 the “convergence factor”. We want 0<u<1/(k max ), where k max is the largest eigenvalue of the auto-correlation matrix R xx . The reason for this inequality will be explained in the next paragraph. Now the difficult part is finding the value of u. Note that the statistical information of x(n) is unknown in practical use of this system, since we do not have predictions about either the noise or the speaker’s voice signal. This means we do not know what R xx is. Therefore, under a certain environment, we need to try different values to get the best u. If u is very small, it takes the system a long time to converge. If u is very big, the system converges fast with the cost of quality of the noise cancellation. Thus, trying values of u is crucial to this project.

Now let’s see where 0<u<1/k max comes from. This whole system is actually a combination of Weiner’s Filter and an adaptive algorithm. We will skip the mathematical computation of Weiner’s Filter here, since it is not our main focus in the project. When this system’s iteration goes to infinity, the expectation of the vector w m (n) will converge to the Weiner’s Filter solution. However, it has a restriction that abs(1-2u*k max )<1 (absolute value of diagonal elements is less than 1), which gives us 0<u<1/k max directly.

Third experiment (result of testing the adaptive filter system)

Now let’s discuss the results of our testing. We passed a recording of a human voice into this system, together with constant-frequency sine wave noise. Suppose the frequency of this sine wave is W 0 (we are using a capital W here because we are using lowercase w to represent the coefficients of the FIR filter).

Since the pure noise signal is a constant-frequency sine wave with frequency W 0 , we know that Y(n)=exp(jW 0 n). Thus,

  1. w m (n+1)=w m (n)+2uE estimate (n)exp(-jW 0 (n-m)), , where m=0,1,2,…,M
  2. Since w m (n)=y m (n)exp(-jW 0 (n-m)), by plugging Equation 2 into Equation 1, we get:
  3. y m (n+1)exp(-jW 0 )=y m (n)+2uE estimate (n)
  4. Taking the z-transform of Equation 3, we get z*y m (z)exp(-jW 0 )=y m (z)+2uE(z), where E(z) is the Z-transform of E estimate (n)
  5. Then, y m (z)=E(z)*2uexp(jW 0 )/(z-exp(jW 0 ))
  6. Since S estimate (n)=∑ M m=0 w m (n)exp(jW 0 (n-m)),
  7. by plugging Equation 2 into Equation 6, we get S estimate (n)= ∑ M m=0 y m (n)
  8. Taking the z-transform of both sides of Equation 7 and using Equation 5, we get S(z)=E(z)*2u(M+1)exp(jW 0 )/(z-exp(jW 0 )), where S(z) is the z-transform S estimate (n).
  9. Since E estimate (n)=x(n)-S estimate (n),
  10. Taking the z-transform of Equation 9, we get E(z)=X(z)- E(z)*2u(M+1)exp(jW 0 )/(z-exp(jW 0 ))
  11. Therefore, the transfer function H(z)=E(z)/X(z)=[z-exp(jW 0 )]/[z-exp(jW 0 (1-2u(M+1)))]

From this transfer function (Equation 11), we get a zero at z=exp(jW 0 ); this means the system is canceling the sine wave with frequency W 0 from the system input x(n). This is the exact goal of this system. Also, notice that if we choose a very small “convergence factor” u, all the poles of this system would be inside the unit circle of the Z plane, which suggests that the system is BIBO stable.

After we input human voice and a constant-frequency sine wave through this system, the result is pretty good. We can hear the human voice clearly with the filter on.

Advantages of adaptive filter system with lms algorithm

In practice, we don’t know statistical information of the input such as the auto-correlation function R xx . Adaptive Filters and LMS algorithm do not need this information to accomplish noise cancellation. This is a big advantage over the Weiner Filter and Kalman Filter.

Furthermore, the LMS algorithm requires fewer mathematical complications than other algorithms (such as RLS), and is also easier to be implemented in practice.

FIR filters have linear phase, so the signal won’t be distorted, which is a big advantage over IIR filters. Moreover, FIR filters have only zeros, and are always BIBO stable. Stability is crucial for signal processing.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Elec 301 projects fall 2014. OpenStax CNX. Jan 09, 2015 Download for free at http://legacy.cnx.org/content/col11734/1.2
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Elec 301 projects fall 2014' conversation and receive update notifications?

Ask