SHARE
TWEET

SS Lab Class No 6

Sourav_CSE Oct 23rd, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %{
  2. SS_lab_06
  3. Rahat Sir
  4. Date: 23-10-2019
  5. %}
  6. % Convolution_4
  7. % x(t) = (t-1) (u(t-1)-u(t-3)
  8. tx = 1:.01:3;
  9. x = tx - 1;
  10. % h(t) = u(t+1) - 2u(t-2)
  11. th1 = -1:.01:2;
  12. th2 = 2:.01:10;
  13.  
  14. th = [th1 th2];
  15.  
  16. h = [ones(size(th1)) -1.*ones(size(th2))];
  17. % convolution integral
  18. y = conv(x,h);
  19.  
  20. %% Convolution_5
  21. % interconnection of system
  22. % Cascade system
  23.  
  24. %first System
  25. th1 = 0:.01:3;
  26. th2 = 0:.01:3;
  27. th22 = 3:.01:6;
  28.  
  29. h1 = th1 .* exp(-3*th1);
  30.  
  31. tx = 0:.01:3;
  32.  
  33. x = ones(size(tx));
  34. w = conv(x,h1).* .01; % 0 to 6
  35. tw = linspace(min(tx)+min(th1),max(tx)+max(th1), length(w));
  36. h2 =[th2.*cos(pi * th2) zeros(size(th22))];
  37.  
  38. y = conv(w,h2).*.01;
  39. ty = linspace(min(th2)+min(tw),max(th2)+max(tw), length(y));
  40. figure
  41. plot(ty,y);
  42.  
  43. % Second System
  44. h2 = th2.* cos(pi * th2);
  45. w2 = conv(h1,h2).* .01;
  46. tw = linspace(min(th2)+min(th1),max(th2)+max(th1), length(w2));
  47. x2 = [x zeros(size(th22))];
  48. tx2 = [tx th22];    
  49. y2 = conv(x2,w2).*.01;
  50. ty2 = linspace(min(tx2)+min(tw),max(tx2)+max(tw),length(y2));
  51. figure
  52. plot(ty2,y2);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top