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.

48 Chapter 2 DISCRETE-TIME SIGNALS AND SYSTEMS<br />

where z k ,k =1,...,N are N roots (also called natural frequencies) ofthe<br />

characteristic equation<br />

N∑<br />

a k z k =0<br />

0<br />

This characteristic equation is important in determining the stability of<br />

systems. If the roots z k satisfy the condition<br />

|z k | < 1, k=1,...,N (2.23)<br />

then a causal system described by (2.22) is stable. The particular part<br />

of the solution, y P (n), is determined from the right-hand side of (2.21).<br />

In Chapter 4 we will discuss the analytical approach of solving difference<br />

equations using the z-transform.<br />

2.4.1 MATLAB IMPLEMENTATION<br />

A function called filter is available to solve difference equations numerically,<br />

given the input and the difference equation coefficients. In its<br />

simplest form this function is invoked by<br />

y = filter(b,a,x)<br />

where<br />

b = [b0, b1, ..., bM]; a = [a0, a1, ..., aN];<br />

are the coefficient arrays from the equation given in (2.21), and x is the<br />

input sequence array. The output y has the same length as input x. One<br />

must ensure that the coefficient a0 not be zero.<br />

To compute and plot impulse response, MATLAB provides the function<br />

impz. When invoked by<br />

h = impz(b,a,n);<br />

it computes samples of the impulse response of the filter at the sample<br />

indices given in n with numerator coefficients in b and denominator coefficients<br />

in a. When no output arguments are given, the impz function<br />

plots the response in the current figure window using the stem function.<br />

We will illustrate the use of these functions in the following example.<br />

□ EXAMPLE 2.11 Given the following difference equation<br />

y(n) − y(n − 1)+0.9y(n − 2) = x(n);<br />

∀n<br />

a. Calculate and plot the impulse response h(n) atn = −20,...,100.<br />

b. Calculate and plot the unit step response s(n) atn = −20,...,100.<br />

c. Is the system specified by h(n) stable?<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!