Summary: In this laboratory, students implement a real-time adaptive FIR filter, investigate the convergence of the least mean squares (LMS) algorithm, and apply the adaptive filter to the problems of system identification and echo cancellation.
First, use MATLAB to simulate the system identification
block diagram in Figure 1. For the simulation, let
randn.
For the "unknown" system, use
a fourth-order, low-pass elliptical IIR filter. Thus, the
reference signal can be generated
with the following MATLAB commands:
>> x = randn(1000,1);%random input signal
>> [B,A] = ellip(4,0.25,10,0.25);%IIR filter
>> d = filter(B,A,x);%reference signal
>> figure;freqz(B,A)%view frequency response
for
or while commands).
Plot the squared-error versus sample
number as the filter adapts over time. Also,
use freqz to plot the
frequency response of the adaptive filter coefficients, W,
at the end of the simulation. Finally, use figure;stem(W)
and figure;stem(dimpulse(B,A,32)) to view and
compare the adaptive FIR impulse response and the IIR impulse reponse.
How well does the adaptive FIR filter at convergence approximate the fourth-order IIR system? How long does the adaptive FIR filter take to converge?
![]() |
Second, write pseduo code for an assembly program to implement an adaptive FIR filter. Your code can be modified from the FIR filtering laboratory exercise. The foundation for your modification is the LMS filter coefficient update equation
SUB, MPY, MAC, BCC.One application of adaptive filters is adaptive modeling or system identification. Figure 2 depicts the system modeling problem. The output of an unknown system to a known input is used as the reference input to an adaptive filter. The known input signal is fed through the adaptive filter in an effort to duplicate the unknown system output. Upon convergence, the adaptive filter parameters represent an estimate of the unknown system.
Test your adaptive filter program by applying it to the identification of a known system. Use a filter box as your "unknown" system. Use a random noise generator as your "known" input signal. Run your adaptive filter program using only 10 filter taps and stop the program after the filter has converged. Enter the estimated filter coefficients into MATLAB and plot the magnitude response to verify that the adaptive filter has approximated the system.
![]() |
Adaptive filters are used in modern telephony to perform echo suppression. A small amount of speech from talker A, transmitted to talker B, is unavoidably "echoed" back to talker A with talker B's speech.
With this application in mind, a stereo
speech recording has been made. On one channel, talker A is
speaking. On the other channel, speech from talker B is
present, along with a delayed "echo" of talker A's speech.
Use your adaptive filter to suppress the "echo" from the
speech of talker B. Can you estimate the delay of the "echo"?
Does the step size,
Report the estimated filter coefficients. Describe the echo in specific terms (seconds delay, frequency response, etc.). Qualitatively report on the effects observed by changing the step size or the number of filter taps.