02.10.2019 Views

UploadFile_6417

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

598 Chapter 11 APPLICATIONS IN ADAPTIVE FILTERING<br />

to be in the range<br />

1<br />

0 < △ <<br />

(11.9)<br />

10NP x<br />

where N is the length of the adaptive FIR filter and P x is the power in<br />

the input signal, which can be approximated by<br />

P x ≈ 1<br />

1+M<br />

M∑<br />

n=0<br />

x 2 (n) = r xx (0)<br />

M +1<br />

(11.10)<br />

The mathematical justification of equations (11.9) and (11.10) and<br />

the proof that the LMS algorithm leads to the solution for the optimum<br />

filter coefficients is given in more advanced treatments of adaptive filters.<br />

The interested reader may refer to the books by Haykin [8] and Proakis<br />

and Manolakis [23].<br />

11.1.1 MATLAB IMPLEMENTATION<br />

The LMS algorithm (11.8) can easily be implemented in MATLAB.<br />

Given the input sequence {x(n)}, the desired sequence {d(n)}, step size<br />

△, and the desired length of the adaptive FIR filter N, we can use<br />

(11.1), (11.2), and (11.8) to determine the adaptive filter coefficients<br />

{h(n), 0 ≤ n ≤ N − 1} recursively. This is shown in the following function,<br />

called lms.<br />

function [h,y] = lms(x,d,delta,N)<br />

% LMS Algorithm for Coefficient Adjustment<br />

% ----------------------------------------<br />

% [h,y] = lms(x,d,delta,N)<br />

% h = estimated FIR filter<br />

% y = output array y(n)<br />

% x = input array x(n)<br />

% d = desired array d(n), length must be same as x<br />

% delta = step size<br />

% N = length of the FIR filter<br />

%<br />

M = length(x); y = zeros(1,M);<br />

h = zeros(1,N);<br />

for n = N:M<br />

x1 = x(n:-1:n-N+1);<br />

y = h * x1’;<br />

e = d(n) - y;<br />

h = h + delta*e*x1;<br />

end<br />

In addition, the lms function provides the output {y(n)} of the adaptive<br />

filter.<br />

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).<br />

Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!