You are on page 1of 4
1.5 DIFFERENCE EQUATIONS ‘The convolution sum expresses the output of a linear shift-invariant system in terms of a linear combination of the input values x(11). For example, a system that has a unit sample response f(t) = a" u(n) is described by the equation yim = Yratxin— Ky a9 Although this equation allows one to compute the output »(v1) for an arbitrary input x(n), from @ computational point of view this representation is not very efficient. In some cases it may be possible to more efficiently express the outputin terms of past values of the output in addition to the current and past values of the input. The previous system, far example, may he described more concisely as follows: y(n) = ayn = 1) + x(n) (10) Equation (/./0) isa special case of what is known asa linear constant coefficient difference equation, or LCCDE. ‘The general form of a LCCDE is yin) = oben = 4) = Prahyyin =k) wan where the coefficients a(k) and O(&) are constants that define the system, If the difference equation has one or more terms a(k) that are nonzero, the difference equation is said to be recursive. On the other hand, if all of the coefficients a(k) are equal to zero, the difference equation is setd to be nonrecursive. Thus, Eq. (J 10) is ‘an example of a first-order recursive difference equation, whereas Eq. (/.9) is an infinite-order nonrecursive 0 may be found. When these initial conditions are zero, the system is said to be in initial rest. For an LSI system that is described by a difference equation, the unit sample response, h(n), is found by solving the difference equation for x(n) = 5(n) assuming initial rest. For a nonrecursive system, a(k) = 0, the difference equation becomes « yin) = YP o)x(n — &) (2) and the outputs simply a weighted sum ofthe current and pastinput values, As a result, the unit sample response is simply f(a) = Y° bH)B(n — &) Thus, h(7) is finite in length and the system is referred to as a finite-lengrh impulse response (FIR) system. However, if a(k) 4 0, the unit sample response is, in general, infinite in length and the system is referred to as, an infinite-length impulse response (IIR) system. For example, if y(n) Sayin = 1) + xn) the unit sample response is A(n) = a"u(n). ‘There are several different methods that one may use to solve LCCDEs for general input x(7), The first is to simply set up a table of input and output values and evaluate the difference equation for each value of 2. This approach would be appropricte if only a few output values needed to be determined. Another approach is to use z-transforms. This approach will be discussed in Chap, 4. The third is the classical approach of finding the homogeneous and particular solutions, which we now describe, Given an LCCDE, the general solution isa sum of two parts, yn) = yur) + yp(n) where ys(n) is known as the homogeneous solution and yp(n) is the particular solution. The homogeneous solution is the response of the system to the initial conditions, assuming that the input x(n) = 0. The particular solution is the response of the system to the input x(n), assuming zero initial conditions. ‘The homogeneous solution is found by solving the homogeneous difference equation p y(n) + Yalk)y(n — k) = 0 (2B) ft ‘The solution to Eg, (1.13) may be found by assuming a solution of the form yan) 1g this solution into Eq. (/.13) we obtain the polynomial equation ae Yaceet4 ai or 2" (2? + a(l)z?! + a(2)2?? +++. +alp — 1)z +a(p)} =0 ‘The polynomial in braces is called the characteristic polynomial. Because it is of degree p, it will have p roots, which may be either real or complex. If the coefficients a(k) are real-valued, these roots will occur in complex- conjugate pairs (i-e., for each complex root z; there will be another that is equal to z*). If the p roots 2; are distinct, 2; # z+ for k # i, the general solution to the homogeneous difference equation is 2 nn) = > Anze (LI) ft where the constants Ay are chosen to satisfy the initial conditions. For repeated roots, the solution must be ry m with the remaining p — m roots distinct, the homogeneous + Am Yoh y Aut (ds) sant For the particular solution, it is necessary to find the sequence y(n) that satisfies the difference equation for the given x(n). In general, this requires some creativity and insight. However, for many of the typical inputs that we are interested in, the solution will have the same form as the input. Table }-2 lists the particular solution for ‘some commonly encountered inputs. For example, if x(t) = a”u(in), the particular solution will be of the form nln) = (Ay + Aan + yoln) = Ca"u(n) provided a is not a root of the characteristic equation. The constant C is found by substituting the solution into the difference equation. Note that for x(n) = C8(n) the particular solution is zero. Because x(n) = O for n > 0, the unit sample only affects the initial condition of y(n) Table 1-2 The Particular Solution to an LCCDE. for Several Different Inputs Termin x(n) | Particular Solution c C cn Cnt: Ca" Cia" Cosma) | C,cos(nwp) + C2sininay) Csinina) Cyc0s(nwy) + C2 sin(na) Ca cosines) | Cia" cos{nary) + Cza sin(nan) C¥(n) Nene EXAMPLE 1.5.1 Let us find the solution tothe difference equation dn) = 0.25yin ~ 2) = x(n) (6) for x(n) = u(n) assuming initial conditions of y(—1) = 1 and y(—2) = 0. ‘We begin by finding the particular solution. From Table 1-2 we see that for x(n) = u(n) ypln) =Cy Substtting this solution into the diference equation we find c,-025¢, =1 In order for this to hold, we must have t 4 O = T0253 To find the homogeneous solution, we set y,(n) = 2", which gives the characteristic polynomial ?-025=0 « +056 -05) 0 ‘Therefore, the homogeneous solution has the form yal) = Ay(0.5)" + 42-05)" ‘Thus, the total solution is yin) = $+ AOS)" + A057 n=O wun ‘The constants A, and Az must now be found so that the total solution satisfies the given initial conditions, y(—1) = J and (2) = 0, Because the solution given in Eq. (/.17) only applies for n > 0, we must derive an equivalent set of initial ‘conditions for »(0) and y(1). Evaluating Eq, (J./6) at n = Oandn = 1, we have 0) ~ 0.25y(~2) = x(0) y(t) = 0.25 y(—1) =x) Substituting these derived initial conditions into Bq, (J.17) we have 90) = yd) 1 Solving for A, and A2 we find A ‘Thus, the solution is vin) = $- (0.5)! + (05) n 20 Although we have focused thus far on linear difference equations with constant coefficients, not all systems and not all difference equations of interest are linear, and not all have constant coefficients. A system that ‘computes a running average of a signal x(n) over the interval (0, n], for example, is defined by 1 yin)= 5 Ye) nb 0 ‘This sysiem may be represented by a difference equation that has time-varying coefficients: yin =—" yin 4am) n 0 n+l Although more complicated and difficult to solve, nonlinear difference equations or difference equations with time-varying coefficients are important and arise frequently in many applications.

You might also like