Use of Labview for Adaptive Filtering Applications

Page 1

Use of Labview for Adaptive Filtering Applications Steve Rogers, 25 January 2006 Institute for Scientific Research, Inc.

Introduction Adaptive filtering is used in many applications, including system identification and noise cancellation. Generally, the coefficients of an FIR (all zero) filter are modified according to the function of an error signal. In the case of system identification the behavior of an unknown system is modeled by accessing its input and output. An adaptive FIR filter can be used to adapt to the output of the unknown system based on the same input. When the deviation of the adapted FIR filter reduces to an acceptable value the adapted filter successfully models the unknown system. Figure 1 below illustrates the system identification approach using an adaptive filter.

Figure 1

1

System Identification Schematic


The error term, e[n], which is the difference between the unknown system output d[n] and the adaptive FIR filter y[n] output, is used to update the coefficients of the adaptive filter. One of the most common approaches is the least mean square (LMS) algorithm123. The update equation is: hn [ k ] = hn −1 [ n ] + δe[ n] x[n − k ] The h’s denote the unit sample response of FIR filter coefficients, and δ is the adaptation coefficient. The adaptation coefficient causes the output y[n] to approach the desired value d[n] at an appropriate convergence rate. A small δ causes a slow adaptation; however, a large δ may lead to skipping over the solution.

Results A 7th order IIR bandpass filter with a bandpass from 20 kHz to 50 kHz is used to act as the unknown system. An adaptive FIR filter is designed to adapt to the response of this system.

Figure 2 Labview block diagram of System Identification experiment

Figure 2 above is the block diagram of the experiment.

2


Figure 3 Front page results of the experiments

Figure 3 above shows the results of three experiments in which the input frequency in kHz was varied from 17 to 19 to 21. The lower passband of the bandpass IIR filter was set at 20 kHz; consequently the lower frequencies were attenuated as shown in the desired input value of Figure 3. In all cases the error (green) converged in a reasonable time frame. The size of the FIR filter is 32 lags and all are initialized at zero. The LMS algorithm in labview is shown in Figure 4 below.

Figure 4 LMS adaptive FIR filter algorithm

Noise Cancellation The design of a noise cancellation system is achieved similar to the system identification described above123. A system for adaptive noise cancellation has two inputs, a noise3


corrupted signal and a noise source. Figure 5 illustrates such a system. A desired signal is corrupted by noise v1[n] which originates from a noise source signal v0[n]. Keep in mind that the noise signal corrupting s[n] is different from the reference noise signal due to environmental effects. Another example is the dual acoustic sensor approach to measurement of a leak. The acoustic sensors are directional, so theoretically, only one will pick up the leak signal. But, both will pick up ambient background noise. The background noise will be picked up differently by each acoustic sensor; consequently, the background noise can’t be simply subtracted out. The adaptive filter will then be used to estimate the signal v1[n].

Figure 5 Noise Cancellation Schematic

The weights of the filter are adjusted in the same manner stated previously. The error term of this system is given by23: e[ n] = s[ n ] + v1 [ n] − y[ n ]

The error e[n] approaches the signal s[n] as the filter output adapts to the noise component of the input v1[n].

Simulation Figure 6 below shows the experimental setup. The input sinewave to be estimated is at top. The high frequency noise corruption sinewaves are at 5000, 10000, 15000, and

4


20000 Hz. They are summed and passed through a time-varying Channel model shown below in Figure 7. The channel model forces the signals from the two acoustic sensors to be different even though the background noise is the same.

Figure 6 Noise Cancellation Experiment Setup

Figure 7 Channel Model

Results The cutoff frequency of the channel model was driven at three triangle wave ranges – low, medium, and high. The input ‘true’ signal was maintained at 2000 Hz. In all cases the adapted signal (red) converges to the ‘true’ signal (white). The fourth case was when the ‘true’ signal was 0 amplitude. Note that in Figure 11, the convergence is a little slower, but still satisfactory. Further studies on improved adaptive filter algorithms will be done in the future. 5


Figure 8 Noise Cancellation low bandwidth channel

Figure 9 Noise Cancellation medium bandwidth channel

6


Figure 10 Noise Cancellation high bandwidth channel

Figure 11 Noise Cancellation high bandwidth channel with 0 sinewave ‘true’ signal

References 1. Kehtarnavaz, N. & Kim, N., Digital Signal Processing System-Level Design Using Labview, 2005, Elsevier, ISBN 0-7506-7914-X. 2. Haykin, S., Adaptive Filter Theory, 3rd Ed., 1996, Prentice Hall, ISBN 0-13322760-X. 7


3. Manolakis, D., etal, Statistical and Adaptive Signal Processing, 2000, McGrawHill, ISBN 0-07-11660-2.

8


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.