convolution sum overview review of time invariance review
play

Convolution Sum Overview Review of time invariance Review of - PowerPoint PPT Presentation

Convolution Sum Overview Review of time invariance Review of sampling property Discrete-time convolution sum Two methods of visualizing Some examples J. McNames Portland State University ECE 222 Convolution Sum Ver. 1.06 1


  1. Convolution Sum Overview • Review of time invariance • Review of sampling property • Discrete-time convolution sum • Two methods of visualizing • Some examples J. McNames Portland State University ECE 222 Convolution Sum Ver. 1.06 1

  2. Impulse Response h ( t ) h [ n ] x ( t ) y ( t ) x [ n ] y [ n ] • Recall that if x ( t ) = δ ( t ) or x [ n ] = δ [ n ] , the output of the system is called the impulse response • The impulse response is always denoted h ( t ) and h [ n ] • For any input x ( t ) , it is possible to use h ( t ) to solve for y ( t ) • For any input x [ n ] , it is possible to use h [ n ] to solve for y [ n ] • This method is called convolution • This is a important concept • Is used to implement digital filters • The derivation of the continuous-time convolution integral is tricky • We will discuss the discrete-time convolution sum first J. McNames Portland State University ECE 222 Convolution Sum Ver. 1.06 2

  3. Discrete-Time Time Invariance • Recall that time invariance means that if the input signal is shifted in time, the output will be shifted in time also • Consider three separate inputs x 1 [ n ] ≡ δ [ n ] x 1 [ n ] → y 1 [ n ] = h [ n ] x 2 [ n ] ≡ δ [ n − 2] x 2 [ n ] → y 2 [ n ] = h [ n − 2] x 3 [ n ] ≡ δ [ n − 5] x 3 [ n ] → y 3 [ n ] = h [ n − 5] • Let � a n n ≥ 0 h [ n ] = a n u [ n ] = n < 0 , where a = 0 . 6 0 J. McNames Portland State University ECE 222 Convolution Sum Ver. 1.06 3

  4. Example 1: Discrete-Time Time Invariance Input Output 1 1 x 1 [n] = δ [n] y 1 [n] = h[n] 0.5 0.5 0 0 −2 0 2 4 6 8 10 −2 0 2 4 6 8 10 1 1 x 2 [n] = δ [n−2] y 2 [n] = h[n−2] 0.5 0.5 0 0 −2 0 2 4 6 8 10 −2 0 2 4 6 8 10 1 1 y 3 [n] = h[n−5] x 3 [n] = δ [n−5] 0.5 0.5 0 0 −2 0 2 4 6 8 10 −2 0 2 4 6 8 10 Time (n) Time (n) J. McNames Portland State University ECE 222 Convolution Sum Ver. 1.06 4

  5. Example 1: MATLAB Code a = 0.6; n = -2:10; subplot(3,2,1); x1 = (n==0); % Unit impulse centered at n=0 h = stem(n,x1,’b’); set(h(1),’Marker’,’.’); title(’Input’); ylabel(’x_1[n] = \delta[n]’); box off; xlim([min(n) max(n)]); subplot(3,2,2); y1 = (a.^n).*(n>=0); % Unit impulse response h[n] h = stem(n,y1,’r’); set(h(1),’Marker’,’.’); title(’Output’); ylabel(’y_1[n] = h[n]’); box off; xlim([min(n) max(n)]); subplot(3,2,3); x2 = (n==2); % Unit impulse centered at n=2 h = stem(n,x2,’b’); set(h(1),’Marker’,’.’); ylabel(’x_2[n] = \delta[n-2]’); box off; xlim([min(n) max(n)]); subplot(3,2,4); y2 = (a.^(n-2)).*(n>=2); % Unit impulse response h[n] h = stem(n,y2,’r’); set(h(1),’Marker’,’.’); ylabel(’y_2[n] = h[n-2]’); box off; xlim([min(n) max(n)]); J. McNames Portland State University ECE 222 Convolution Sum Ver. 1.06 5

  6. Example 1: MATLAB Code Continued subplot(3,2,5); x3 = (n==5); % Unit impulse centered at 5 h = stem(n,x3,’b’); set(h(1),’Marker’,’.’); xlabel(’Time (n)’); ylabel(’x_3[n] = \delta[n-5]’); box off; xlim([min(n) max(n)]); subplot(3,2,6); y3 = (a.^(n-5)).*(n>=5); % Unit impulse response h[n] h = stem(n,y3,’r’); set(h(1),’Marker’,’.’); xlabel(’Time (n)’); ylabel(’y_3[n] = h[n-5]’); box off; xlim([min(n) max(n)]); J. McNames Portland State University ECE 222 Convolution Sum Ver. 1.06 6

  7. Discrete-Time Unit-Impulse Sampling Property Recall from our earlier discussion of signal fundamentals that any signal x [ n ] can be written as ∞ � x [ n ] = x [ k ] δ [ n − k ] k = −∞ ∞ � = a k x k [ n ] k = −∞ Side note: since δ [ n ] is an even signal, δ [ n ] = δ [ − n ] , we can also write this as ∞ � x [ n ] = x [ k ] δ [ k − n ] k = −∞ Though, this is not the conventional form. J. McNames Portland State University ECE 222 Convolution Sum Ver. 1.06 7

  8. Example 2: Unit-Impulse Sampling Property • Any bounded discrete-time signal can be written as a sum of discrete-time impulses • For example, consider the following signal ⎧ 1 n = 0 ⎪ ⎪ ⎪ − 1 n = 2 ⎨ x [ n ] = 2 n = 5 ⎪ ⎪ ⎪ 0 otherwise ⎩ • In terms of unit-impulses, this signal can also be expressed as x [ n ] = 1 · δ [ n ] − 1 · δ [ n − 2] + 2 · δ [ n − 5] J. McNames Portland State University ECE 222 Convolution Sum Ver. 1.06 8

  9. Example 3: Discrete-Time Unit Sampling Example Example of Unit Sampling 2 1 x 1 [n] 0 −1 −2 0 2 4 6 8 10 2 1 x 2 [n] 0 −1 −2 0 2 4 6 8 10 2 1 x 3 [n] 0 −1 −2 0 2 4 6 8 10 2 1 x[n] 0 −1 −2 0 2 4 6 8 10 Time (n) J. McNames Portland State University ECE 222 Convolution Sum Ver. 1.06 9

  10. Example 3: MATLAB Code n = -2:10; x1 = 1*(n==0); % Unit impulse centered at n=0 x2 = -1*(n==2); % Unit impulse centered at n=2 x3 = 2*(n==5); % Unit impulse centered at 0 x = x1 + x2 + x3; % The original signal X = [x1;x2;x3;x]; for cnt = 1:4, subplot(4,1,cnt); plot([min(n) max(n)],[0 0],’k:’); hold on; h = stem(n,X(cnt,:),’b’); set(h(1),’Marker’,’.’); hold off; box off; axis([min(n) max(n) min(x) max(x)]); if cnt==1, ylabel(’x_1[n]’); title(’Example of Unit Sampling’); elseif cnt==2, ylabel(’x_2[n]’); elseif cnt==3, ylabel(’x_3[n]’); elseif cnt==4, ylabel(’x[n]’); xlabel(’Time (n)’); end; end; J. McNames Portland State University ECE 222 Convolution Sum Ver. 1.06 10

  11. Discrete-Time Convolution Sum Derived x [ n ] = x 1 [ n ] + x 2 [ n ] + x 3 [ n ] = 1 · δ [ n ] − 1 · δ [ n − 2] + 2 · δ [ n − 5] by linearity, we know the output will be equal to the sum of the outputs due to the application of x 1 [ n ] , x 2 [ n ] , and x 3 [ n ] alone. x [ n ] → y [ n ] = y 1 [ n ] + y 2 [ n ] + y 3 [ n ] Since x 1 [ n ] ≡ δ [ n ] x 1 [ n ] → y 1 [ n ] = h [ n ] x 2 [ n ] ≡ − δ [ n − 2] x 2 [ n ] → y 2 [ n ] = − h [ n − 2] x 3 [ n ] ≡ 2 · δ [ n − 5] x 3 [ n ] → y 3 [ n ] = 2 · h [ n − 5] Therefore, y [ n ] = h [ n ] − h [ n − 2] + 2 · h [ n − 5] J. McNames Portland State University ECE 222 Convolution Sum Ver. 1.06 11

  12. Discrete-Time Convolution Sum • Any discrete-time input signal x [ n ] can be expressed as a sum of scaled unit impulses ∞ � x [ n ] = x [ k ] δ [ n − k ] k = −∞ • By linearity and time invariance , the output of the system is the scaled sum of outputs due to each unit impulse ∞ � x [ n ] → y [ n ] = h [ n ] ∗ x [ n ] = x [ k ] h [ n − k ] k = −∞ • This is called the discrete-time convolution sum • This applies to all LTI discrete-time systems! • If we know h [ n ] , then we can calculate y [ n ] for any input x [ n ] • Thus, h [ n ] completely characterizes LTI discrete-time systems J. McNames Portland State University ECE 222 Convolution Sum Ver. 1.06 12

  13. Example 4: Discrete-Time Convolution Sum Input Output 2 2 1 1 x 1 [n] y 1 [n] 0 0 −1 −1 −2 0 2 4 6 8 10 −2 0 2 4 6 8 10 2 2 1 1 x 2 [n] y 2 [n] 0 0 −1 −1 −2 0 2 4 6 8 10 −2 0 2 4 6 8 10 2 2 1 1 x 3 [n] y 3 [n] 0 0 −1 −1 −2 0 2 4 6 8 10 −2 0 2 4 6 8 10 2 2 1 1 x[n] y[n] 0 0 −1 −1 −2 0 2 4 6 8 10 −2 0 2 4 6 8 10 Time (n) Time (n) J. McNames Portland State University ECE 222 Convolution Sum Ver. 1.06 13

  14. Example 4: MATLAB Code a = 0.6; n = -2:10; x1 = 1*(n==0); % Unit impulse centered at n=0 x2 = -1*(n==2); % Unit impulse centered at n=2 x3 = 2*(n==5); % Unit impulse centered at 0 x = x1 + x2 + x3; % The original signal y1 = 1*a.^(n-0).*(n>=0); y2 = -1*a.^(n-2).*(n>=2); y3 = 2*a.^(n-5).*(n>=5); y = y1 + y2 + y3; % The original signal X = [x1;x2;x3;x]; Y = [y1;y2;y3;y]; for cnt = 1:4, subplot(4,2,2*cnt-1); plot([min(n) max(n)],[0 0],’k:’); hold on; h = stem(n,X(cnt,:),’b’); set(h(1),’Marker’,’.’); hold off; box off; axis([min(n) max(n) -1 2]); if cnt==1, ylabel(’x_1[n]’); title(’Input’); elseif cnt==2, ylabel(’x_2[n]’); elseif cnt==3, ylabel(’x_3[n]’); elseif cnt==4, ylabel(’x[n]’); xlabel(’Time (n)’); end; J. McNames Portland State University ECE 222 Convolution Sum Ver. 1.06 14

  15. Example 4: MATLAB Code Continued subplot(4,2,2*cnt); plot([min(n) max(n)],[0 0],’k:’); hold on; h = stem(n,Y(cnt,:),’r’); set(h(1),’Marker’,’.’); hold off; box off; axis([min(n) max(n) -1 2]); if cnt==1, ylabel(’y_1[n]’); title(’Output’); elseif cnt==2, ylabel(’y_2[n]’); elseif cnt==3, ylabel(’y_3[n]’); elseif cnt==4, ylabel(’y[n]’); xlabel(’Time (n)’); end; end; J. McNames Portland State University ECE 222 Convolution Sum Ver. 1.06 15

  16. Discrete-Time Convolution Derivation Summary x [ n ] h [ n ] y [ n ] Definition of h [ n ] δ [ n ] h [ n ] h [ n ] Time Invariance δ [ n − k ] h [ n ] h [ n − k ] Linearity x [ k ] δ [ n − k ] x [ k ] h [ n − k ] h [ n ] Linearity � + ∞ Σ + ∞ h [ n ] k = - ∞ x [ k ] h [ n − k ] k = - ∞ x [ k ] δ [ n − k ] Definition of δ [ n ] Σ + ∞ x [ n ] h [ n ] k = - ∞ x [ k ] h [ n − k ] J. McNames Portland State University ECE 222 Convolution Sum Ver. 1.06 16

Recommend


More recommend