MarouaneTheViper

Untitled

Apr 24th, 2019
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. x1 = [1,2,4]
  2. x2 = [0,1,-2,3,-4]
  3. x3 = [1,2,3,4]
  4. x4 = [1,2,3,4]
  5.  
  6. h1 = [1,1,1,1,1]
  7. h2 = [0.5,1,2,1,0.5]
  8. h3 = [4,3,2,1]
  9. h4 = [1,2,3,4]
  10.  
  11. c1 = conv(x1, h1)
  12. c2 = conv(x2, h2)
  13. c3 = conv(x3, h3)
  14. c4 = conv(x4, h4)
  15.  
  16. subplot(2,2,1)
  17. stem(c1,'filled')
  18. ylim([0 10])
  19. title('Linear Convolution of x1 and h1')
  20.  
  21. subplot(2,2,2)
  22. stem(c2,'filled')
  23. ylim([-10 5])
  24. title('Linear Convolution of x2 and h2')
  25.  
  26. subplot(2,2,3)
  27. stem(c3,'filled')
  28. ylim([0 35])
  29. title('Linear Convolution of x3 and h3')
  30.  
  31. subplot(2,2,4)
  32. stem(c4,'filled')
  33. ylim([0 30])
  34. title('Linear Convolution of x4 and h4')
Advertisement
Add Comment
Please, Sign In to add comment