Adaptive Filter Implementation
First, use MATLAB to simulate the system identification block diagram in Figure 1. For the simulation, let x[n] be a Gaussian random noise input, which can be generated in MATLAB using the command
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
W[n+1]=W[n]+μe[n]X[n](1)
where W[n] is the vector of 32 FIR filter coefficients at time n, e[n]=d[n]−y[n] is the error between the reference and output, μ is the step size, and X[n] is the length 32 vector of current and past input samples. (Note the upper-case X is used to denote the state vector that stores the current and past 31 input samples.) Observe that the update is implemented by multiply and accumulate operations applied to the buffer of filter coefficients. Consider the following five suggestions for implementing the processing shown in Figure 1.- The filter coefficients should be initialized to zero at the start of program execution.
- The left input channel is the input x[n] to the adaptive filter.
- The right input channel is the reference input signal d[n].
- The left channel output is the adaptive filter output y[n].
- The right channel output is the error signal e[n].
SUB, MPY, MAC, BCC
.Lab Exercise: Adaptive Filtering for System Identification
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.
System ID
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.
Lab Exercise: Adaptive Interference Cancellation
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.
Echo Cancellation
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, μ, or number of filter taps, N, have any effect on your results?
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.
0 comments:
Post a Comment