ECE-S352 Itroductio to Digital Sigal Processig Lecture 3A Direct Solutio of Differece Equatios Discrete Time Systems Described by Differece Equatios Uit impulse (sample) respose h() of a DT system allows us to use the covolutio summatio to fid the respose of the same system to ay iput x() y() = h(k)x(-k) k = - Easy to do for FIR (fiite impulse respose) systems; however IIR (ifiite impulse respose) systems are a little more challegig. So, what is a Differece Equatio? Solutio is to use differece equatios. Recursive Differece Equatio Examples: Cosider the cumulative average of a sigal i the iterval 0<=k<= y() = 1/(+1) x(k) Implemetatio of the above equatio requires storage for all the iputs x(), i fact if we wated to add more iputs (say goes to +5) we eed additioal storage uits. Also ote that each time we add more terms we must perform the summatio all over. However we ca write the summatio equatio as: -1 (+1)y() = x(k) + x() ECE-S352 DSP 1 of 13
ad ote: thus: -1 y(-1) = 1/ x(k) by defiitio y() = /(+1)y(-1) + 1/(+1) x() Here the cumulative average is easily foud by the recursive differece equatio. Cosider computig y( o ): all we eed is to have the iput x( o ) ad the iitial coditio y( o -1): y( o ) = o /( o +1)y( o -1) + 1/( o +1) x( o ) The followig is a realizatio of the recursive differece equatio for the cumulative sum. x() 1/(+1) y() Recursive ad No-recursive DT Systems Desirable/ecessary to express output of system ot oly i terms of the preset ad past values of the iput (as i covolutio summatio) but also i terms of the available past output values. A causal ad realizable recursive system ca be expressed as: y() = F[y(-1), y(-2), y(-n), x(), x(-1), x(-m)] ECE-S352 DSP 2 of 13
The above is called a recursive equatio ad provides the recipe for computig the system output as a fuctio F[.] of previous values of the output ad preset ad past iputs. This should be compared to a fuctio that oly depeds o the preset ad past iputs (such as a FIR covolutio summatio). y() = F[x(), x(-1), x(-m)] The above equatio is called o-recursive. Causal, realizable o-recursive system Causal, realizable recursive system (presece of feedback loop) ECE-S352 DSP 3 of 13
LTI Systems with Costat Coefficiet Differece Equatios Cosider: y() = ay(-1) + x() where a is a costat, y(-1) is I.C. y(0) = ay(-1) + x(0) y(1) = ay(0) + x(1) = a 2 y(-1) + ax(0) + x(1) y(2) = ay(1) + x(2) = a 3 y(-1) + a 2 x(0) + ax(1) + x(2) y() = ay(-1) + x() = a +1 y(-1) + a x(0) + a -1 x(-1) + ax(-1) + x() = a +1 y(-1) + a k x(-k) >=0 respose due to IC + respose due to iput Respose due to iput: y zs () = a k x(-k) >=0 forced respose zero-state respose (i.e. iitial coditios = 0) covolutio of iput x() with impulse respose h() = a u() Respose due to IC: y zi () = a +1 y(-1) >=0 due to memory of system atural respose (i.e. iitial coditios 0) zero-iput respose (x() = 0) homogeeous respose Total respose of the system: y() = y zi () + y zs () = y Total () = y T () ECE-S352 DSP 4 of 13
Geeral form of a recursive system described by costat coefficiet differece equatio: N M y() = - a k y(-k) + b k x(-k) k = 1 (ote mius sig) sometimes writte without explicitly solvig for y() as: N M a k y(-k) + b k x(-k) = 0 where a 0 1 (to get y()) Here there are delayed terms for both the iput ad output variable. N is the order of the differece equatio or the order of the system Hit Geerally M < N otherwise pick M if M>N. The recursive system described by a costat coefficiet differece equatio is liear ad time ivariat. Solutio of Liear Costat Coefficiet Differece Equatios: y() = y h () + y p () = homogeeous solutio + particular solutio homogeeous solutio also called complemetary solutio Homogeeous solutio: Assume that iput x() = 0, this gives us the atural respose N a k y(-k) = 0 Assume a solutio of the form: y h () = λ ECE-S352 DSP 5 of 13
Substitutio ito the homogeeous equatio yields: N a k λ - λ -N (λ N + a 1 λ N-1 + a 2 λ N-2 + a -1 λ 1 + a N ) = 0 where: λ N + a 1 λ N-1 + a 2 λ N-2 + a -1 λ 1 + a N = 0 is called the characteristic equatio (CE), if ot set to zero the the characteristic polyomial(cp) Roots of CE may be real or complex, ad some may be of multiple order. A th order system has roots, this may be repeated roots. The geeral solutio for distict roots is: y h () = C 1 λ 1 + C 2 λ 2 + C 3 λ 3 + C N λ N where the coefficiets are foud from the iitial coditios. Be careful i evaluatio homogeeous vs. complete. For repeated roots say λ 1 of multiplicity m we have: y h () = C 10 λ 1 C 11 λ 1 + C 12 2 λ 1 + + C 1(m-1) (m-1) λ 1 + + C 2 λ 2 + C 3 λ 3 + C N λ N coefficiets C rx : x stads for the power of multiplyig the repeated root or eigevalue λ r. ECE-S352 DSP 6 of 13
Example: Give: y() + a 1 y(-1) = x() Fid the homogeeous solutio. 1. y h () = λ assumed solutio with x() = 0 2. y h () + a 1 y h (-1) = 0 3. λ + a 1 λ -1 = 0 4. λ -1 (λ + a 1 ) = 0 5. root: λ = -a 1 later we will also call this a eigevalue 6. y h () = C(-a 1 ) 7. assumig the IC is the y(-1) symbol a. y(0) = - a 1 y(-1) b. y h () = C(-a 1 ) evaluated at =0 c. y h (0) = C d. hece C = - a 1 y(-1) 8. y h () = C(-a 1 ) = - a 1 y(-1)(-a 1 ) >=0 Note that DT solutios like to combie powers of for more succict otatio: 9. y h () = C(-a 1 ) = - a 1 y(-1)(-a 1 ) = y(-1)(-a 1 ) +1 >=0 As a check, evaluate y h (0) ad see it equals the IC y h (0) = y(-1)(-a 1 ) 1 which matches y(0) = - a 1 y(-1) ECE-S352 DSP 7 of 13
Secod order Differece Equatio Fid the homogeeous (or zero iput respose) solutio of : y() 3y(-1) 4y(-2) = 0 1. y h () = λ assumed solutio with x() = 0 2. substitute to get characteristic equatio: λ 3 λ -1-4λ -2 = 0 3. factor out λ -2 yieldig: λ -2 ( λ 2 3 λ 1 4) = 0 ( λ 2 3 λ 1 4) = ( λ +1) (λ - 4) = 0 4. fid roots of CE (or CP) λ 1 = -1, λ 2 = 4 5. solutio: y h () = C 1 (λ 1 ) + C 2 (λ 2 ) = C 1 (-1) + C 2 (4) 6. determie {C 1 C 2 } from the IC's y(-1) ad y(-2) a. y() = 3y(-1) + 4y(-2) evaluate at =0 ad = 1 b. y(0) = 3y(-1) + 4y(-2) c. y(1) = 3y(0) + 4y(-1) = 3[3y(-1) + 4y(-2)]+4y(-1) = 13y(-1) + 12y(-2) 7. y h () = C 1 (-1) + C 2 (4) evaluated at =0 ad =1 y h (0) = C 1 + C 2 y h (1) = -C 1 + 4C 2 8. ow equatig y h (0) = y(0) ad y h (1) =y(1) gives us two equatios i two ukows: y h (0) = y(0) => C 1 + C 2 = 3y(-1) + 4y(-2) = S1 y h (1) =y(1) => -C 1 + 4C 2 = 13y(-1) + 12y(-2) = S2 solve via matrix techiques: 1 1 C1 S1 = 1 4 C2 S2 ECE-S352 DSP 8 of 13
C C 1 2 = 1 1 1 4 1 S1 S2 C C 1 2 = 4 1 1 1 S1 5 S2 C1 = 1/5(4S1 S2) C2 = 1/5(S1+S2) C1 = 1/5[12y(-1) + 16y(-2) [13y(-1) + 12y(-2)]] C1 = 1/5[-y(-1) + 4y(-2)] C2 = 1/5[3y(-1) + 4y(-2) +13y(-1) + 12y(-2)] C2 = 16/5[y(-1) + y(-2)] 9. solutio: y h () = C 1 (λ 1 ) + C 2 (λ 2 ) = C 1 (-1) + C 2 (4) >=0 y h () = 1/5[-y(-1) + 4y(-2)] (-1) + 16/5[y(-1) + y(-2)](4) 10. It is good practice to check the solutio (homogeeous, particular ad complete) by testig the IC's y h (0) = 3y(-1) + 4y(-2) y h (1) = 13y(-1) + 12y(-2) y h () = 1/5[-y(-1) + 4y(-2)] (-1) + 16/5[y(-1) + y(-2)](4) Did it work????? Also test by recursio: y() = 3y(-1) + 4y(-2) ECE-S352 DSP 9 of 13
Aother way to get CE or CP (referece VaLadigham 1991) Defie E as the shift operator. The: E[y()] = y(+1) E 2 [y()] = y(+2) E m [y()] = y(+m) Recall our otatio for the homogeeous equatio: N a k y(-k) = 0 0 = a 0 y()+ a 1 y(-1) + a 2 y(-2)+ a N-1 y(-(n-1)) + a N y(-n) But this is i terms of y(-m) ot y(+m) so we must chage the idices. Shift everythig by N (i.e. add N to each argumet of y) so that there are o egative sigs i the argumets. This does ot chage the relatioship of the equatio. 0 = a 0 y(+n)+ a 1 y(+n-1) + a 2 y(+n-2)+ a N-1 y(+1) + a N y() Now applyig the E operator 0 = [a 0 E N + a 1 E N-1 + a 2 E N-2 + a N-1 ye + a N ]y() Compare the polyomial i E to the polyomial i λ formed by assumig a solutio λ -N (λ N + a 1 λ N-1 + a 2 λ N-2 + a N-1 λ 1 + a N ) = 0 The resultig polyomial i E is the characteristic polyomial whose roots are the eigevalues used for the solutio. Example: Give: y() 3y(-1) 4y(-2) = 0 Rewrite as: y(+2) 3y(+1) 4y() = 0 E: (E 2 3E- 4)y() = 0 = (E +1)(E - 4) Same as before: λ -2 ( λ 2 3 λ 1 4) = ( λ 2 3 λ 1 4) = ( λ +1) (λ - 4) = 0 ECE-S352 DSP 10 of 13
Particular Solutio: The particular solutio y p () is ay solutio satisfyig The form for y p () depeds o x(). N M a k y p (-k) + b k x(-k) where a 0 1 Iput Sigal x() Particular solutio y p () A -- costat K AM umber to power KM A M -- power of K 0 M + K 1 (M-1) + K m A M A (K 0 M + K 1 (M-1) + K m ) Acosω 0 or K 1 cosω 0 +K 2 siω 0 Asiω 0 The coefficiet of the particular solutio will be evaluated as a fuctio of the iput coefficiet. You may have see this called the method of udetermied coefficiets. Example: Fid the particular solutio of the differece equatio: y() = 5/6 y(-1) 1/6y(-2) + x() where x() = 2 >=0 ad zero elsewhere thus x() = 2 u() 1. y p () = K 2 u() the u() keeps values for >=0 2. Substitutig ito DE yields: y p () = 5/6 y p (-1) 1/6y p (-2) + x() K 2 u() = 5/6K2-1 u(-1) 1/6K2-2 u(-2) + 2 u() 3. To fid K all that is eeded is to pick a value of where oe of the terms vaish; so ay >=2 is a valid choice. Usig = 2 K 2 2 u(2) = 5/6K2 2-1 u(2-1) 1/6K2 2-2 u(2-2) + 2 2 u(2) 4K = 5/6K2 1/6K + 4 K = 8/5 4. y p () = (8/5) 2 u() or y p () = 8/5 2 >=0 ECE-S352 DSP 11 of 13
Total Solutio: y() = y h () + y p () Allowed by the property of liearity. It is very importat to evaluate the costats, C i correspodig to the homogeeous solutio after we form the complete solutio. The particular solutio is foud first (with its coefficiets), the the homogeeous solutio with its C i terms is added to fid the complete or total solutio. Fially the C i terms are evaluated usig the iitial coditios. Example Give: y() + a1y(-1) = x() fid y() whe x() is a uit step sequece ad y(-1) is the iitial coditio (symbolic) 1. y h (x) = C(-a1) from our previous example 2. y p () = 1/(1+a1)u() from text pg 104 3. hece y() = C(-a1) + 1/(1+a1) >=0 4. compute C to satisfy IC: y(-1) with iput preset y() + a1y(-1) = x() evaluate at =0 y(0) + a1y(-1) = 1 y(0) = C + 1/(1+a1) from solutio 1 - a1y(-1) = C + 1/(1+a1) equatig C = 1- a1y(-1) - 1/(1+a1) C = a1/(1+a1) - a1y(-1) 5. y() = C(-a1) + 1/(1+a1) >=0 y() = [a/(1+a1) - a1y(-1)](-a1) + 1/(1+a1) y() = - a1y(-1)(-a1) + [1 - (-a1) +1 ]/(1+a1) y() is the complete solutio icludes the zero iput respose ad the zero state respose. What happes if y(-1) = 0? zero-state respose oly ECE-S352 DSP 12 of 13
A Detailed Example: Fid y(k) give: y(k+2) 3y(k+1) + y(k) = 3 k y(0) = 2 ad y(1) = 2 We ca check this by usig the recursive equatio to compute the first few terms. ECE-S352 DSP 13 of 13