arpit01

find convolution of two signals

Nov 28th, 2018
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. clc
  2. close all
  3. x=[4 6 7 9];
  4. h=[5 2 3 11 15];
  5. m=length(x);
  6. n=length(h);
  7. X=[x,zeros(1,n)];
  8. H=[h,zeros(1,m)];
  9. for i=1:n+m-1
  10. Y(i)=0;
  11. for j=1:m
  12. if(i-j+1>0)
  13. Y(i)=(Y(i)+x(j))*H(i-j+1);
  14. else
  15. end
  16. end
  17. end
  18. stem(Y);
Add Comment
Please, Sign In to add comment