1 / 59

ELEN E4810: Digital Signal Processing Topic 2: Time domain

ELEN E4810: Digital Signal Processing Topic 2: Time domain. Discrete-time systems Convolution Linear Constant-Coefficient Difference Equations (LCCDEs) Correlation. DT System. x [ n ]. y [ n ]. 1/ M. x [ n ]. z -1. 1/ M. y [ n ]. x [ n -1]. +. z -1. 1/ M. x [ n -2].

Download Presentation

ELEN E4810: Digital Signal Processing Topic 2: Time domain

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ELEN E4810: Digital Signal ProcessingTopic 2: Time domain • Discrete-time systems • Convolution • Linear Constant-Coefficient Difference Equations (LCCDEs) • Correlation Dan Ellis

  2. DT System x[n] y[n] 1/M x[n] z-1 1/M y[n] x[n-1] + z-1 1/M x[n-2] 1. Discrete-time systems • A system converts input to output: • E.g. Moving Average (MA): y[n] = f (x[n]) (M = 3) Dan Ellis

  3. x[n] A n -1 1 2 3 4 5 6 7 8 9 x[n-1] x[n-2] n n -1 -1 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 1/M y[n] x[n] z-1 1/M y[n] x[n-1] n -1 1 2 3 4 5 6 7 8 9 + z-1 1/M x[n-2] Moving Average (MA) Dan Ellis

  4. MA Smoother • MA smooths out rapid variations (e.g. “12 month moving average”) • e.g. x[n] = s[n] + d[n] signal noise 5-pt moving average Dan Ellis

  5. x[n] y[n] + z-1 y[n-1] Accumulator • Output accumulates all past inputs: Dan Ellis

  6. x[n] A n -1 1 2 3 4 5 6 7 8 9 y[n-1] x[n] y[n] + n -1 1 2 3 4 5 6 7 8 9 z-1 y[n] y[n-1] n -1 1 2 3 4 5 6 7 8 9 Accumulator Dan Ellis

  7. DT system x[n] y[n] Classes of DT systems • Linear systems obey superposition: • if input x1[n] outputy1[n], x2y2... • given a linear combination of inputs: • then outputfor alla, b, x1, x2i.e. same linear combination of outputs Dan Ellis

  8. Linearity: Example 1 • Accumulator: Linear Dan Ellis

  9. Linearity Example 2: • “Energy operator”: Nonlinear Dan Ellis

  10. Linearity Example 3: • ‘Offset’ accumulator: but Nonlinear .. unless C = 0 Dan Ellis

  11. Property: Shift (time) invariance • Time-shift of inputcauses same shift in output • i.e. if x1[n]y1[n]then • i.e. process doesn’t depend on absolute value of n Dan Ellis

  12. Shift-invariance counterexample L • Upsampler: Not shift invariant Dan Ellis

  13. Another counterexample • Hence • If then • Not shift invariant - parameters depend on n scaling by time index ≠ Dan Ellis

  14. Linear Shift Invariant (LSI) • Systems which are both linear and shift invariant are easily manipulated mathematically • This is still a wide and useful class of systems • If discrete index corresponds to time, called Linear Time Invariant (LTI) Dan Ellis

  15. Causality • If output depends only on past and current inputs (not future), system is called causal • Formally, if x1[n]y1[n] & x2[n]y2[n] Causal Dan Ellis

  16. Causality example • Moving average:y[n] depends on x[n-k], k ≥ 0 causal • ‘Centered’ moving average.. looks forward in time  noncausal • Can sometimes make a non-causal system causal by delaying its output Dan Ellis

  17. DT system x[n] y[n] d[n] 1 n -3 -2 -1 1 2 3 4 5 6 7 Impulse response (IR) • Impulse(unit sample sequence) • Given a system:if x[n] = d[n] then y[n] = h[n] • LSI system completely specified by h[n] ∆ “impulse response” Dan Ellis

  18. a1 x[n] z-1 a2 y[n] + z-1 a3 x[n] 1 n -3 -2 -1 1 2 3 4 5 6 7 a2 a1 y[n] a3 n -3 -2 -1 1 2 3 4 5 6 7 Impulse response example • Simple system: x[n] = d[n] impulse y[n] = h[n]impulse response Dan Ellis

  19. LSI h[n] d[n] LSI h[n-n0] d[n-n0] 2. Convolution • Impulse response: • Shift invariance: • + Linearity: • Can express any sequence with ds:x[n] = x[0]d[n] + x[1]d[n-1] + x[2]d[n-2].. a·d[n-k] + b·d[n-l] a·h[n-k] + b·h[n-l] LSI Dan Ellis

  20. * * * Convolution sum • Hence, since • For LSI, written as • Summation is symmetric in xandhi.e. l = n – k Convolution sum Dan Ellis

  21. x[n] h[n] = h[n] x[n] * * (x[n] h[n]) y[n] = x[n] (h[n] y[n]) * * * * h[n] (x[n] + y[n]) = h[n] x[n] + h[n] y[n] * * * Convolution properties • LSI System output y[n] = input x[n]convolved with impulse responseh[n]h[n] completely describes system • Commutative: • Associative: • Distributive: Dan Ellis

  22. h[n] x[n] y[n] = x[n] h[n] * n n -3 -2 -1 -3 -2 -1 1 2 3 5 6 7 1 2 3 4 5 6 7 Interpreting convolution • Passing a signal through a (LSI) system is equivalent to convolving it with the system’s impulse response h[n] = {3 2 1} x[n]={0 3 1 2 -1} Dan Ellis

  23. h[0-k] 11 k -3 -2 -1 1 2 3 4 5 6 7 9 9 y[n] h[1-k] h[2-k] 2 0 -1 n -3 -2 -1 1 2 3 5 7 k -3 -2 -1 -3 -2 -1 1 2 3 4 5 6 7 1 2 3 4 5 6 7 k -3 -2 -1 1 2 3 5 6 7 Convolution interpretation 1 x[k] • Time-reverse h, shift by n, take inner product against fixed x k Dan Ellis

  24. x[n-1] n -3 -2 -1 1 2 3 4 6 7 11 9 9 y[n] 2 0 -1 n -3 -2 -1 1 2 3 5 7 n k -3 -2 -1 -3 -2 -1 1 2 3 5 6 7 1 2 3 4 5 6 7 Convolution interpretation 2 x[n] • Shifted x’sweighted bypoints in h • Conversely, weighted, delayedversions of h ... h[k] x[n-2] n -3 -2 -1 1 2 3 4 5 7 Dan Ellis

  25. Matrix interpretation • Diagonals in X matrix are equal Dan Ellis

  26. Convolution notes • Total nonzero length of convolving N and M point sequences isN+M-1 • Adding the indices of the terms within the summation gives n: i.e. summation indices move in opposite senses Dan Ellis

  27. Convolution in MATLAB • The M-file convimplements the convolution sum of two finite-length sequences • If then conv(a,b) yields M Dan Ellis

  28. * * Connected systems • Cascade connection: Impulse response h[n] of the cascade of two systems with impulse responses h1[n] and h2[n] is • By commutativity, Dan Ellis

  29. x [ n ] [ n ] x [ n ] d = * * * z [ n ] h [ n ] y [ n ] h [ n ] h [ n ] x [ n ] = = 2 2 1 * Inverse systems • d[n] is identity for convolutioni.e. • Consider • h2[n] is the inverse system ofh1[n] * x[n] y[n] z[n] x [ n ] = if Dan Ellis

  30. Inverse systems • Use inverse system to recover input x[n] from output y[n] (e.g. to undo effects of transmission channel) • Only sometimes possible - e.g. cannot ‘invert’ h1[n] = 0 • In general, attempt to solve * Dan Ellis

  31. Inverse system example • Accumulator: Impulse response h1[n] = m[n] • ‘Backwards difference’.. has desired property: • Thus, ‘backwards difference’ is inverse system of accumulator. Dan Ellis

  32. Parallel connection • Impulse response of two parallel systems added together is: Dan Ellis

  33. 3. Linear Constant-Coefficient Difference Equation (LCCDE) • General spec. of DT, LSI, finite-dim sys: • Rearrange for y[n] in causal form: • WLOG, always have d0 = 1 • defined by {dk}, {pk} • order = max(N,M) Dan Ellis

  34. Solving LCCDEs • “Total solution” Complementary Solutionsatisfies Particular Solutionfor given forcing functionx[n] Dan Ellis

  35. Complementary Solution • General form of unforced oscillationi.e. system’s ‘natural modes’ • Assume yc has form Characteristic polynomial of system - depends only on {dk} Dan Ellis

  36. Complementary Solution • factors into rootsli , i.e. • Each/any li satisfies eqn. • Thus, complementary solution:Any linear combination will work ais are free to match initial conditions Dan Ellis

  37. Complementary Solution • Repeated roots in chr. poly: • Complex lis  sinusoidal Dan Ellis

  38. Particular Solution • Recall: Total solution • Particular solution reflects input • ‘Modes’ usually decay away for large n leaving just yp[n] • Assume ‘form’ of x[n], scaled by b:e.g. x[n]constant yp[n] = bx[n] = l0n yp[n] = b · l0n (l0 li) or= b nL+1 l0n (l0 li) Dan Ellis

  39. x[n] y[n] + LCCDE example • Need input: x[n] = 8m[n] • Need initial conditions:y[-1] = 1, y[-2] = -1 Dan Ellis

  40. LCCDE example • Complementary solution: • a1, a2 are unknown at this point rootsl1 = -3, l2 = 2 Dan Ellis

  41. LCCDE example • Particular solution: • Inputx[n]is constant = 8m[n] assume yp[n] = b, substitute in: (‘large’ n) Dan Ellis

  42. LCCDE example • Total solution • Solve for unknown ais by substitutinginitial conditionsinto DE at n = 0, 1, ... • n = 0 from ICs Dan Ellis

  43. LCCDE example • n = 1 • solve: a1 = -1.8, a2 = 4.8 • Hence, system output: • Don’t find ais by solving with ICs atn = -1,-2 (ICs may not reflect natural modes) Dan Ellis

  44. LCCDE solving summary • Difference Equation (DE): Ay[n] + By[n-1] + ... = Cx[n] + Dx[n-1] + ...Initial Conditions (ICs):y[-1] = ... • DE RHS = 0 with y[n]=ln roots {li}gives complementary soln • Particular soln: yp[n] ~ x[n]solve for bl0n“at large n” • ais by substituting DE at n = 0, 1, ...ICs fory[-1], y[-2]; yt=yc+ypfory[0], y[1] Dan Ellis

  45. LCCDEs: zero input/zero state • Alternative approach to solving LCCDEs is to solve two subproblems: • yzi[n], response with zero input (just ICs) • yzs[n], response with zero state (just x[n]) • Because of linearity,y[n] = yzi[n]+yzs[n] • Both subproblems are ‘real’ • But, have to solve for ais twice(then sum them) Dan Ellis

  46. LCCDE h[n] d[n] Impulse response of LCCDEs • Impulse response: i.e. solve with x[n] = d[n] y[n] = h[n](zero ICs) • With x[n] = d[n], ‘form’ of yp[n] = 0just solveyc[n]forn = 0,1...to findais Dan Ellis

  47. LCCDE IR example • e.g.(from before); x[n] = d[n];y[n] = 0 for n<0 • n = 0: • n = 1: • thus 1 n ≥ 0 Infinite length Dan Ellis

  48. x[n] y[n] + y[n] ... z-1 2 n -1 1 2 3 4 System property: Stability • Certain systems can be unstable e.g.Output grows without limit in some conditions Dan Ellis

  49. Stability • Several definitions for stability; we useBounded-input, bounded-output (BIBO) stable • For every bounded input output is also subject to a finite bound, Dan Ellis

  50. Stability example • MA filter:  BIBO Stable Dan Ellis

More Related