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.

The Frequency Domain Representation<br />

of LTI Systems 79<br />

1<br />

Input sequence<br />

0.5<br />

x(n)<br />

0<br />

−0.5<br />

−1<br />

0 10 20 30 40 50 60 70 80 90 100<br />

n<br />

Output sequence<br />

5<br />

3.42<br />

4.092<br />

y(n)<br />

0<br />

−5<br />

0 10 20 30 40 50 60 70 80 90 100<br />

n<br />

FIGURE 3.8 Plots in Example 3.15<br />

respectively. Now the array H(e jω k<br />

)in(3.23) can be computed using a ./<br />

operation. This procedure can be implemented in a MATLAB function to<br />

determine the frequency response function, given {b m } and {a l } arrays.<br />

We will explore this in Example 3.16 and in Problem P3.16.<br />

□ EXAMPLE 3.16 A 3rd-order lowpass filter is described by the difference equation<br />

y(n) =0.0181x(n)+0.0543x(n − 1)+0.0543x(n − 2)+0.0181x(n − 3)<br />

+1.76y(n − 1) − 1.1829y(n − 2)+0.2781y(n − 3)<br />

Plot the magnitude and the phase response of this filter, and verify that it is a<br />

lowpass filter.<br />

Solution<br />

We will implement this procedure in MATLAB and then plot the filter<br />

responses.<br />

>> b = [0.0181, 0.0543, 0.0543, 0.0181]; % filter coefficient array b<br />

>> a = [1.0000, -1.7600, 1.1829, -0.2781]; % filter coefficient array a<br />

>> m = 0:length(b)-1; l = 0:length(a)-1; % index arrays m and l<br />

>> K = 500; k = 0:1:K; % index array k for frequencies<br />

>> w = pi*k/K; % [0, pi] axis divided into 501 points.<br />

>> num = b * exp(-j*m’*w); % Numerator calculations<br />

>> den = a * exp(-j*l’*w); % Denominator calculations<br />

>> H = num ./ den; % Frequency response<br />

>> magH = abs(H); angH = angle(H); % mag and phase responses<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!