ECE 38-6 ECE 38 Discrete-Time Signals and Systems Z. Aliyazicioglu Electrical and Computer Engineering Department Cal Poly Pomona ECE 38-6 1 Intoduction Two basic methods for analyzing the response of LTI: The direct solution of the input-output equation for the linear system [ ] yn ( ) = F yn ( 1), yn ( 2),..., yn ( N), xn ( ), xn ( 1),..., xn ( M) In general form of the input-output relationship is (called a difference equation), which is given N yn ( ) = ayn ( k) + bxn ( k) M k k k= 1 k= where a k and b k are constant parameters ECE 38-6 2
The second methods is to resolve the input signal into sum of elementary signals. Then determine the response of each input elementary signals. We can use linearity property to find total response Let s have arbitrary discrete-time signal. We can represent in the following form x( n) = x( k) δ ( n k) k= Example: A finite-duration sequence xn ( ) = {2,4,,3} Using the previous equation, x( n) can be written as x( n) = 2 δ ( n+ 1) + 4 δ( n) + 3 δ( n 2) ECE 38-6 3 The convolution Sum The response of the system to is yn ( ) = xn ( ) = xk ( ) ( n k) = xk ( ) ( n k) k= k= τ[ ] τ δ τ [ δ ] The response of the LTI system to the unit sample sequence is denoted as h(n), and it is called the impulse response of a linear time invariant system =τ [ δ n] hn ( ) ( ) So the output sequence is found as yn ( ) = xkhn ( ) ( k) k= This is called convolution sum. The response at n=n is yn ( ) = xkhn ( ) ( k) k= ECE 38-6 4
The convolution Sum The process of computing the convolution between and h(k) involves the following steps. 1. Folding. Fold h(k) about k= to obtain h(-k) 2. Shifting. Shift h(-k) by n to the right (left) if n is positive (negative), to obtain h(n -k). 3. Multiplication. Multiply x(k) by h(n -k) to obtain the product sequence 4. Summation. Sum all the values of the product sequence to obtain the value of the output at time n=n. 5. Step 2 through 4 must be repeated, for all possible time shifts. < n < ECE 38-6 5 Example: The impulse response of a linear time invariant system is hn ( ) = {1,2,1, 1} The input signal is x( n ) = {1,2,3,1} y x k h k Solution: The output at n= is () = ( ) ( ) and the product sequence k= v ( k) = x( k) h( k) y() = v ( k) = 2 + 2 = 4 k= ECE 38-6 6
Solution (cont) Similarly,The output at n=1 is and the product sequence y(1) = x( k) h(1 k) k= v ( k) = x( k) h(1 k) 1 y(1) = v ( k) = 1 + 4 + 3 = 8 k= 1 ECE 38-6 7 Solution (cont) The output at n=-1 is and the product sequence y( 1) = x( k) h( 1 k) k= v ( k) x( k) h( 1 k) 1 = y( 1) = v ( k) = 1 k= 1 ECE 38-6 8
Solution (cont) Let s find at n=2, and n=3 y(2) = v ( k) = 1+ 2 + 6 + 1= 8 2 k= y(3) = v ( k) = 2+ 3+ 2= 3 3 k= Let s find at n=4, and n=5 y(4) = v ( k) = 3+ 1= 2 4 k= y(5) = v ( k) = 1 = 1 5 k= yn ( ) =, n 6 The entire system response to is yn ( ) = {...,,,1,4,8,8,3, 2, 1,,,...} ECE 38-6 9 MatLab Save the following m file as conv_m.m function [y,ny] = conv_m(x,nx,h,nh) % [y,ny] : convolution result % [x,nx] : input signal, enter it as x=[2,4,3,5,4]; nx=[-2:2]; % [h,nh] : second signal, enter it as h=[3,2,4,2,2,2]; nx=[-1:4]; % to run this program % Enter x,nx, h,nh and run the program as % >> x=[2,4,3,5,4]; nx=[-2:2]; h=[3,2,4,2,2,2]; nh=[-1:4]; % >> [y,ny]=conv_m(x,nx,h,nh) nylower = nx(1)+nh(1); nyhigher = nx(length(x))+nh(length(h)); ny = [nylower:nyhigher]; y = conv(x,h); stem(ny,y); title ('y[n]'); xlabel('n') % To run this program % Enter x,nx, h,nh values and run the program as % Example: >> x=[2,4,3,5,4]; >> nx=[-2:2]; >> h=[3,2,4,2,2,2]; >> nh=[-1:4]; >> [y,ny]=conv_m(x,nx,h,nh) ECE 38-6 1
Properties of Convolution We show the convolution operation with asterisk Commutative Law which means yn ( ) = xn ( )* hn ( ) = xkhn ( ) ( k) k= x( n)* h( n) = h( n)* x( n) k= x( khn ) ( k) = hkxn ( ) ( k) k= h(n) h(n) ECE 38-6 11 Associative Law [ x( n)* h( n) ]* h ( n) = x( n)* [ h( n)* h ( n) ] 1 2 1 2 1 2 hn ( ) = h( n)* h( n) and yn ( ) = xn ( )* hn ( ) h 1 (n) h 2 (n) h 1 (n)* h 2 (n) Distributed Law [ ] x( n)* h( n) + h ( n) = x( n)* h( n) + x( n)* h ( n) 1 2 1 2 h 1 (n) h 2 (n) h(n)= h 1 (n)+ h 2 (n) hn ( ) h( n) h( n) = 1 + 2 and yn ( ) = xn ( )* hn ( ) ECE 38-6 12
Properties of Convolution Example Find of the following system: xn ( ) = {...,2,3,2,1,,...} h ( n ) = (2 n+ 1)[ u ( n+ 1) u ( n 3)] 1 2 [ ] h ( n ) = 2( n+ 1) u ( n+ 2) u ( n 2) h 1 (n) y 1 (n) + y (n) y 2 (n) h 2 (n) MatLab >> x=[2,3,2,1]; nx=[-1:2]; h=[-2,-1,3,7,5]; nh=[-2:2]; >> [y,ny]=conv_m(x,nx,h,nh) ECE 38-6 13 Causal LTI Systems Causal LTI Systems Causal system is the output is depends only on present and past input signal The output for LTI systems is given by yn ( ) = xn ( )* hn ( ) = xkhn ( ) ( k) k= For causal system hn ( ) = for n< ) the output becomes yn ( ) = hkxn ( ) ( k) k= n = x( khn ) ( k) k= If the input is a causal sequence ( x( n) = for n< ) too, convolution becomes n yn ( ) = xkhn ( ) ( k) = hkxn ( ) ( k) k= k= n ECE 38-6 14
Causal LTI Systems System with Finite-Duration and Infinite-Duration Impulse Response Finite-Duration Impulse Response (FIR) system has an impulse response that is zero outside of some finite time interval. The convolution is hn ( ) =, n< and n M M 1 yn ( ) = hkxn ( ) ( k) k= FIR system has a finite memory of length-m samples ECE 38-6 15 Causal LTI Systems Infinite-Duration Impulse Response (IIR) of LTI has an infiniteduration impulse response that is not finite time interval. The convolution is yn ( ) = hkxn ( ) ( k) k= where causality has been assumed. ECE 38-6 16