02.10.2019 Views

UploadFile_6417

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

248 Chapter 6 IMPLEMENTATION OF DISCRETE-TIME FILTERS<br />

J = 1; a = 1; A = zeros(N,N);<br />

for m=1:1:N<br />

a = [a,0]+conv([0,K(m)],J);<br />

A(m,1:m) = -a(2:m+1); J = fliplr(a);<br />

end<br />

b(N+1) = C(N+1);<br />

for m = N:-1:1<br />

A(m,1:m) = A(m,1:m)*C(m+1);<br />

b(m) = C(m) - sum(diag(A(m:N,1:N-m+1)));<br />

end<br />

The lattice-ladder filter is implemented using (6.23) and (6.25).<br />

This is done in the following MATLAB function ladrfilt. Itshould<br />

be noted that, due to the recursive nature of this implementation along<br />

with the feedback loops, this MATLAB function is neither an elegant<br />

nor an efficient method of implementation. It is not possible to exploit<br />

MATLAB’s inherent parallel processing capabilities in implementing this<br />

lattice-ladder structure.<br />

function [y] = ladrfilt(K,C,x)<br />

% LATTICE/LADDER form realization of IIR filters<br />

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

% [y] = ladrfilt(K,C,x)<br />

% y = output sequence<br />

% K = LATTICE (reflection) coefficient array<br />

% C = LADDER coefficient array<br />

% x = input sequence<br />

%<br />

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

N = length(C); f = zeros(N,Nx); g = zeros(N,Nx+1);<br />

f(N,:) = x;<br />

for n = 2:1:Nx+1<br />

for m = N:-1:2<br />

f(m-1,n-1) = f(m,n-1) - K(m-1)*g(m-1,n-1);<br />

g(m,n) = K(m-1)*f(m-1,n-1) + g(m-1,n-1);<br />

end<br />

g(1,n) = f(1,n-1);<br />

end<br />

y = C*g(:,2:Nx+1);<br />

□ EXAMPLE 6.10 Convert the following pole-zero IIR filter into a lattice-ladder structure.<br />

H(z) =<br />

1+2z−1 +2z −2 + z −3<br />

1+ 13<br />

24 z−1 + 5 8 z−2 + 1 3 z−3<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!