ADSP-Lecture 2 LTI System, Convolution, Difference Equations Classification of Discrete-time Systems Memoryless Systems: If the output of the system at an instant ๐ only depends on the input sample at that time (and not on past or future samples) then the system is called memoryless or static, e.g. ๐ฆ(๐) = ๐๐ฅ(๐) + ๐๐ฅ2(๐) Otherwise, the system is said to be dynamic or to have memory, e.g. ๐ฆ(๐) = ๐ฅ(๐) − 4๐ฅ(๐ − 2) Causal vs. Non-causal Systems In a causal system, the output at any time n only depends on the present and past inputs. An example of a causal system: ๐ฆ(๐) = ๐น[๐ฅ(๐), ๐ฅ(๐ − 1), ๐ฅ(๐ − 2), … ] y[n] = x[n] − x[n−1] (Forward Difference) All other systems are non-causal. A subset of non-causal system where the system output, at any time n only depends on future inputs is called anti-causal. ๐ฆ(๐) = ๐น[๐ฅ(๐ + 1), ๐ฅ(๐ + 2), … ] y[n] = x[n+1] − x[n] (Backward Difference) Stable vs. Unstable Systems Unstable systems exhibit erratic and extreme behavior. BIBO stable systems are those producing a bounded output for every bounded input: x ( n) ๏ฃ M x ๏ผ ๏ฅ ๏ y ( n) ๏ฃ M y ๏ผ ๏ฅ Example: Stable or unstable? y (n) = y 2 (n − 1) + x(n) x( n) = C๏ค ( n) Bounded signal Solution: y (0) = C , y (1) = C 2 , y (2) = C 4 ,..., y (n) = C 2 n 1๏ผ C ๏ฃ ๏ฅ unstable Linear vs. Non-linear Systems Superposition principle: ๐[๐๐ฅ1(๐) + ๐๐ฅ2(๐)] = ๐๐[๐ฅ1(๐)] + ๐๐[๐ฅ2 (๐)] A relaxed linear system with zero input produces a zero output. Additivity property Scaling property Linear vs. Non-linear Systems Example: y ( n) = x ( n 2 ) Solution: y1 (n) = x1 (n 2 ) Linear or non-linear? y2 (n) = x2 (n 2 ) y3 (n) = T (a1 x1 (n) + a2 x2 (n)) = a1x1 (n 2 ) + a2 x2 (n 2 ) a1 y1 (n) + a2 y2 (n) = a1 x1 (n 2 ) + a2 x2 (n 2 ) Example: Linear! y (n) = e x ( n ) Useful Hint: In a linear system, zero input results in a zero output! x( n) = 0 ๏ y ( n) = 1 Non-linear! System Examples (continue) Nonlinear System. Eg. w[n] = log10(|x[n]|) is not linear. Time-invariant System: If y[n] = T{x[n]}, then y[n−n0] = T{x[n −n0]} The accumulator is a time-invariant system. The compressor system (not time-invariant) y[n] = x[Mn], −๏ฅ < n < ๏ฅ. Time-invariant vs. Time-variant Systems If input-output characteristics of a system do not change with time then it is called time-invariant or shift-invariant. This means that for every input ๐ฅ(๐) and every shift ๐ T T x( n) โฏ โฏ→ y ( n) ๏ x ( n − k ) โฏ โฏ→ y (n − k ) Time-invariant vs. Time-variant Systems Time-invariant example: differentiator T x( n) โฏ โฏ→ y ( n) = x( n) − x( n − 1) T x( n − 1) โฏ โฏ→ y (n − 1) = x( n − 1) − x(n − 2) T x ( n) โฏ โฏ→ y (n) = x(n).Cos (๏ท0 .n) Time-variant example: modulator x(n -1) ¾T¾ ® x(n -1).Cos(w0 .n) ¹ y(n -1) y(n -1) = x(n -1).Cos(w0.(n -1)) Example: Accumulator System Is the system memory-less? Is the system causal? Is the system Linear? Is the system Time-invariant? Is the system stable? y๏n๏ = n ๏ฅ x๏k ๏ k = −๏ฅ Linear Time-Invariant (LTI) Systems LTI systems have two important characteristics: Time invariance: A system ๐ is called time-invariant or shift-invariant if input-output characteristics of the system do not change with time T T x ( n) โฏ โฏ→ y ( n) ๏ x ( n − k ) โฏ โฏ→ y (n − k ) Linearity: A system ๐ is called linear iff ๐[๐๐ฅ1(๐) + ๐๐ฅ2(๐)] = ๐๐[๐ฅ1(๐)] + ๐๐[๐ฅ2 (๐)] Why do we care about LTI systems? Availability of a large collection of mathematical techniques Many practical systems are either LTI or can be approximated by LTI systems. Linear and Time Invariant Example Linear Time Invariant Systems A system that is both linear and time invariant is called a linear time invariant (LTI) system. By setting the input x[n] as ๏ค[n], the impulse function, the output h[n] of an LTI system is called the impulse response of this system. Time invariant: when the input is ๏ค[n-k], the output is h[n-k]. Remember that the x[n] can be represented as a linear combination of delayed impulses ๏ฅ x๏n๏ = ๏ฅ x๏k ๏๏ค ๏n − k ๏ k = −๏ฅ Impulse Response Impulse Response of LTI Systems โ(๐): the response of the LTI system to the input unit sample ๏ค(๐), i.e. โ(๐) = ๐{๐ฅ(๐)} ๏ฅ y(n) = T[x(n)] =๏ฅ x(k )h(n − k ) = x(n) * h(n) k = −๏ฅ An LTI system is completely characterized by a single impulse response โ(๐). Response of the system to the input Convolution unit sample sequence at n=k sum Impulse Response Example The impulse response of the system y[n] = ๏ก1x[n] + ๏ก 2 x[n − 1] + ๏ก3 x[n − 2] + ๏ก 4 x[n − 3] is obtained by setting ๐ฅ[๐] = ๐ฟ[๐] resulting in h[n] = ๏ก1๏ค [n] + ๏ก 2๏ค [n − 1] + ๏ก3๏ค [n − 2] + ๏ก 4๏ค [n − 3] The impulse response is thus a finite-length sequence of length 4 given by {h[n]} = {๏ก1, ๏ก 2 , ๏ก3 , ๏ก 4} ๏ญ Impulse Response Example Example - The impulse response of the discrete-time accumulator n y[n] = ๏ฅ x[๏ฌ] ๏ฌ = −๏ฅ is obtained by setting ๐ฅ[๐] = ๐ฟ[๐] resulting in h[n] = n ๏ฅ ๏ค [๏ฌ] = ๏ญ[n] ๏ฌ = −๏ฅ FIR and IIR systems Linear Time Invariant Systems (continue) • Hence ๏ฅ ๏ฅ ๏ฅ ๏ฌ ๏ผ ๏ฏ ๏ฏ x๏k ๏h๏n − k ๏ y๏n๏ = T ๏ญ ๏ฅ x๏k ๏๏ค ๏n − k ๏๏ฝ = ๏ฅ x๏k ๏T ๏ป๏ค ๏n − k ๏๏ฝ = ๏ฏ ๏ฏ k = −๏ฅ ๏ฎk = −๏ฅ ๏พ k = −๏ฅ ๏ฅ • Therefore, a LTI system is completely characterized by its impulse response h[n]. Stable and Causal LTI Systems An LTI system is (BIBO) stable if and only if Impulse response is absolute summable ๏ฅ ๏ฅ h๏k ๏ ๏ผ ๏ฅ k = −๏ฅ Let’s write the output of the system as y๏n๏ = If the input is bounded ๏ฅ ๏ฅ k = −๏ฅ k = −๏ฅ ๏ฅ h๏k ๏x๏n − k ๏ ๏ฃ ๏ฅ h๏k ๏ x๏n − k ๏ x[n] ๏ฃ Bx Then the output is bounded by y๏n๏ ๏ฃ Bx ๏ฅ ๏ฅ h๏k ๏ k = −๏ฅ The output is bounded if the absolute sum is finite An LTI system is causal if and only if h๏k ๏ = 0 for k ๏ผ 0 Causality & Stability- Example โ ๐ = ๐๐ ๐ข ๐ Convolution Summation y๏n๏ = ๏ฅ ๏ฅ x๏k ๏h๏n − k ๏ k = −๏ฅ Note that the above operation is convolution, and can be written in short by y[n] = x[n] ๏ช h[n]. The output of an LTI system is equivalent to the convolution of the input and the impulse response. In a LTI system, the input sample at n = k, represented as x[k]๏ค[n-k], is transformed by the system into an output sequence x[k]h[n-k] for −๏ฅ < n < ๏ฅ. Applications Visualizing Convolution There are four basic steps to the calculation: Tabular Mechanism ∞ Convolution in the time domain: ๐ฆ ๐ = เท ๐ฅ[๐] โ[๐ − ๐] ๐=−∞ y[n] = 2 –3 3 3 –6 0 1 0 0 Example: Tabular ๐ฅ ๐ = 1, 2, 3 โ ๐ = {1, 2, 3} Example: Convolution Summation ๐ฅ ๐ = 1, 2, 3 โ ๐ = {1, 2, 3} Example: The operation has a simple graphical interpretation: Calculating Successive Values • We can calculate each output point by shifting the unit pulse response one sample at a time: ๏ฅ y[n] = ๏ฅ x[k ] h[n − k ] k = −๏ฅ • y[n] = 0 for n < ??? y[-1] = y[0] = y[1] = … y[n] = 0 for n > ??? • Can we generalize this result? Graphical Convolution (Cont.) Observations: y[n] = 0 for n > 4 If we define the duration of h[n] as the difference in time from the first nonzero sample to the last nonzero sample, the duration of h[n], Lh, is 4 samples. Similarly, Lx = 3. The duration of y[n] is: Ly = Lx + Lh – 1. This is a good sanity check. Graphically x (๏ด ) t h (t ) h (t − ๏ด ) x (๏ด ) t Overlap Example DTC-FLIP & SLIDE method(Finite Length Signals) Computation of Discrete Convolution Convolution Useful Summation Convolution