Experiments for Chapter 8

Download Chapter 8 experimental software programs

Back to Top


Adaptive Filter Implementation

 

There are 2 experiments in this chapter:

1.     Experiment 8A - System Identification Using Adaptive Filter

2.     Experiment 8B - Self-tuned Leaky LMS Adaptive System

 

We will conduct two experiments for Chapter 8 applying the adaptive algorithms. The first experiment uses LMS algorithm for an application of system identification. The unknown system can be any types of plants. Here we use an FIR filter (the lowpass filter from Chapter 5) as the unknown system. We will show you how the adaptive filter adjusts its weights to match the unknown system. The second experiment is an application of adaptive linear predictor. It can be used to separate the narrow band signal from wide band signal. It can also be used to remove a narrow band signal from the wide band signal as a notch filer. The linker command file exp8.cmd for both experiments is given in Table E8-1.

Table 8-1 Linker command file for experiments in this chapter.

 

 


 

Experiment 8A - System Identification Using Adaptive Filter

System identification is an application using adaptive filters. Figure E8-1 shows the block diagram of the system identification system using LMS algorithm.

Figure E8-1 Block diagram of an LMS adaptive system identification

Our experiment uses an lowpass filter as the unknown system. This lowpass filter is identical to the one used in Chapter 5. It is defined by the filter coefficients LP_coef.dat and implemented in C55x assembly language, fir_filt.asm.

The LMS adaptive filter adaptive.asm is implemented in the C55x assembly language. It consists of two blocks, a block FIR filter and the LMS adaptation algorithm, see Table E8-2.

Table E8-2 List of adaptive.asm

 

Table E8-3 sows the exciting signal source used for the experiment is a random number generator random.c. The input signal is fed into the unknown system and the adaptive filter at the same time. The output of the unknown system is used as the desired signal for the adaptive filter.

Table E8-3 Random number generator

 

After the adaptive system reaches its steady-state, the adaptive filter coefficients w[] can be used to approximate the impulse response of the unknown system. The experiment is controlled by the C function exp8a.c, listed in Table E8-4.

Table E8-4 List of exp8.c

 

The initialization of the coefficients array and filter delayline is done using the C function init.c, as shown in Figure E8-5.

Table E8-5 List of init.c

 

 

For Experiment 8A, complete these steps:

1.     This experiment uses the following files: exp8.cmd, expt8a.c, init.c, random.c, adaptive.asm, fir_flt.asm, LP_coef.dat, and randdata.dat, where the assembly routine fir_flt.asm and its coefficients LP_coef.dat are identical of those used for the experiment in Chapter 5.

2.     Create the project epx8a, to include exp8.cmd, expt8a.c, init.c, random.c, adaptive.asm, and fir_flt.asm. Build, debug, and run the experiment using the CCS.

3.     Configure the CCS, and set animation option for viewing the coefficients of the adaptive filter w[], the unknown the system LP_coef[] in both time domain and frequency domain.

4.     Verify the adaptation process by viewing how the adaptive coefficients are adjusted. Record the steady-state value of w[], and plot the frequency responses of the adaptive filter and the unknown system. Save the adaptive filter coefficients, and compare them with the unknown system coefficients given in the file LP_coef.dat.

5.     Adjust adaptation step size, and repeat the system identification process. Observe how does the system performance change.

6.     Increase the number of the adaptive filter coefficients to N0=64, and observe system performance.

7.     Reduce the number of the adaptive filter coefficients to N0=32, and observe system performance.

The experiment result is plotted in Figure E8-2.

Figure E8-2 System identification experiment results

 

Back to Top


 

Experiment 8B - Self-tuned Leaky LMS Adaptive System

Figure E8-3 shows the block diagram of an adaptive linear predictor using the leaky LMS algorithm. As shown in Figure E8-3, the input to the system contains a wide band signal s(n)and a narrow band signal v(n). The system has two outputs, the wide band output e(n) and the narrow band output y(n).

 

Figure E8-3 Block diagram of an adaptive linear predictor

The signal source is generated by the function signal.c, listed in Table E8-6.

Table E8-6 List of function singal.c

 

The experiment is managed by function exp8b.c, see Table E8-7. Because of using the white noise, the delay is chosen to be 1. The same initialization function init.c is used to initialize the adaptive filter.

Table E8-7 List of exp8b.c

 

The experiment result is plotted and shown in Figure E8-4. The input is a wide band (white noise) and a periodic signal (sinewave). The adaptive filter separates the narrow band signal from the wide band signal.

Figure E8-4. Adaptive linear predictor experiment result

The adaptive linear predictor alp.asm is listed in Table E8-8. We choose the leaky factor to be 0.998 and the step size 2u=96/32768.

 

Table E8-8 Adaptive linear predictor.

For Experiment 8B, go through the following steps:

1.     Create the project epx8b to include exp8.cmd, expt8b.c, init.c, alp.asm, and singal.c. These files can be found from the experiment software package.

2.     Build, debug, and run the experiment using the CCS.

3.     Configure the CCS, and set animation option for viewing the output of the adaptive filter y[], the output of the system e[], the input of the signal, in[], and the adaptive filter coefficients w[] at a block by block basis.

4.     Verify the adaptive linear predictor, and compare the result with Figure E8-4.

5.     Verify the adaptation process by viewing how the adaptive coefficients are adjusted. Record the steady-state value of w[], and plot the frequency response of the adaptive filter.

6.     Change the order of the adaptive filter, and observe system performance.

7.     Adjust adaptation step size, and observe system performance.

8.     Change the leaky factor, and observe system performance.

9.     Can you obtain a similar result without using leaky LMS (by setting leaky factor to 0x7fff)? Find the steady-state adaptive filter coefficients w[] by running the adaptive system for a period of time, and compare the frequency response with the one obtained in step 5.

10.  Select the best step size and leaky factor that will minimize order of the adaptive filter.

Back to Top


copyright © 2001 by Sen M. Kuo and Bob H. Lee
website last updated Feb 11, 2001