INC 212 Signals and systems Lecture#3: Convolution integral Assoc. Prof. Benjamas Panomruttanarug benjamas.pan@kmutt.ac.th
The The Con Convolution olution In Integral al Input Output LTI system x ( t ) y ( t ) H y(t) = x t h t x h t d where h ( t ) = H { ( t )} Impulse response of LTI system H = the output from the system given that the input is the delta function 2 BP INC212
Exam Ex ample ple 2.6 2.6 Reflect‐and‐shift Convolution Evaluation 1 3 2 Given and , evaluate the convolution x t u t u t h t u t u t integral y ( t ) = x ( t ) h ( t ). 3 BP INC212
0, 1 t 1, 1 3 t t y t 5 , 3 5 t t 0, 5 t (a) The input x ( ) depicted above the reflected and time ‐ shifted impulse response. (b) The product signal w t ( ) for 1 t < 3. (c) The product signal w t ( ) for 3 t < 5. (d) The system output y ( t ). 4 BP INC212
Matlab: conv 1 3 2 x t u t u t h t u t u t • t = 1:ts:5; • clear;clc; close all; • y = ts*conv(h,x); • ts = 0.01; • for i = 1:401 • t = 1:ts:3; • t(i) = 1+ts*(i ‐ 1); • x = square(t); • if t(i) < 3 • figure; plot(t,x); • ya(i) = t(i) ‐ 1; • • m = length(x); else • ya(i) = 5 ‐ t(i); • t = 0:ts:2; • end • h = square(t); • end • hold on; plot(t,h,'r ‐‐ '); • figure; plot(t,y,'b',t,ya,'r ‐‐ '); • n = length(h);
Ex Exam ample ple 2.14 2.14 RC Cir Circuit: uit: St Step ep Respo sponse se 1 t ( ) ( ) The impulse response of the RC circuit h t e RC u t RC Find the step response of the circuit. 6 BP INC212
Solving by convolution 1 t ( ) ( ) . s t e RC u d RC 0, 0 t ( ) s t 1 t ( ) 0 RC e u d t RC 0, 0 t ( ) s t 1 t 0 RC e d t 0 RC 0, 0 t t 1 , 0 RC e t 7 BP INC212
1 t Matlab: conv x ( t ) = u ( t ) ( ) ( ) RC h t e u t RC • clear;clc; close all; • ts = 0.01; • t = 0:ts:50; • x = square(t,100); • figure;plot(t,x); • • h = exp( ‐ t); • y = ts*conv(x,h); • ya = 1 ‐ exp( ‐ t); • figure; plot(t,y(1:5001),'b',t,ya,'r ‐‐ ');
Ex Exam ample ple 2.7 2.7 RC Cir Circuit uit Output Output Assume that the circuit’s time constant is RC = 1 sec. • Find the impulse response of the circuit. • Use convolution to determine the capacitor voltage, y ( t ), resulting from an input voltage x ( t ) = u ( t ) u ( t 2). 9 BP INC212
( ( ) ) 1. Fix and flip h x Shrinking Growing ( ) ( ) ( 2 ) x u u t>2 0<t<2 ( ) ( ) * ( ) ( ) ( ) * ( ) y t x t h t ( ) ( ) ( 2 ) y t x t h t x u u ( ) ( ) ( ) ( ) u h x t d h x t d ( ) ( ) h e t t 1 1 e d e d 2 0 t t t e e 2 0 t 2 1 t 1 t e e e
( ( ) ) x h 2. Fix and flip (Harder!!!) Shrinking Growing t>2 0<t<2 ( ) ( ) ( 2 ) x u u ( ) ( ) * ( ) ( ) ( ) * ( ) y t x t h t y t x t h t u ( ) ( ) h e ( ) ( ) ( ) ( ) x h t d x h t d u ( ) ( ) h e 2 t 1 t 1 t e d e d 0 0 2 t t t e e e 0 0 2 1 t 1 t e e e
0, 0 t 1 , 0 2 t y t e t 2 1 , 2 t e e t (a) The input x ( ) superimposed over the reflected and time ‐ shifted impulse response h ( t – ), depicted as a function of . (b) The product signal w t ( ) for 0 t < 2. (c) The product signal w t ( ) for t 2. (d) The system output y ( t ). 12 BP INC212
1 t Matlab: conv x ( t ) = u ( t ) u ( t 2) ( ) ( ) RC h t e u t RC • clear;clc; close all; • for i = 1:5001 • • ts = 0.01; t(i) = (i ‐ 1)*ts; • • t = 0:ts:2; if t(i) < 2 • • x = square(t,100); ya(i) = 1 ‐ exp( ‐ t(i)); • else • t = 0:ts:50; • ya(i) = (exp(2) ‐ 1)*exp( ‐ t(i)); • h = exp( ‐ t); • end • y = ts*conv(x,h); • end • figure; plot(t,y(1:5001),'b',t,ya,'r ‐‐ ');
Recommend
More recommend