Sourav_CSE

SS Lab Class No 09

Nov 20th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. %{
  2. SS Lab Class no 09
  3. Date: 20.11.2019
  4. Place: CL3
  5. Time: 10.30 AM -12.30 AM
  6. Minhaj Rahat Sir
  7. %}
  8. clc;
  9. clear all;
  10. close all;
  11. syms t;
  12. x = heaviside(t+6)-heaviside(t-6);
  13. T =12;
  14. w = 2*pi/T;
  15. k = -100:100;
  16. an =(1/T)*int(x*exp(-j*k*w*t),t,-6,6);
  17. xn = sum(an.*exp(j*k*w*t));
  18. figure
  19. ezplot(xn,[0,10]);
  20. %% Experiment 02
  21. clc;
  22. clear all;
  23. close all;
  24. syms t w
  25. a = 0.5;
  26. f = exp(-a*t) * heaviside(t);
  27. an = fourier(f,w);
  28. ww = -2*a:.1:2*a;
  29. a = subs(an,w,ww);
  30. subplot(2,1,1)
  31. plot(ww,abs(a))
  32. xlabel('Frequency');
  33. ylabel('Amplitude');
  34. subplot(2,1,2)
  35. plot(ww,angle(a))
  36. xlabel('Frequency');
  37. ylabel('phase(radian)');
  38. %% Fourier Representaion of Square Wave
  39. syms t w
  40. f = heaviside(t+6)-heaviside(t-6);
  41. To = 6;
  42. an = fourier(f,w);
  43. ww = -3*pi/To:.001:3*pi/To;
  44. a = subs(an,w,ww);
  45. subplot(2,1,1)
  46. plot(ww,abs(a))
  47. xlabel('Frequency');
  48. ylabel('Amplitude');
  49. subplot(2,1,2)
  50. plot(ww,angle(a))
  51. xlabel('Frequency');
  52. ylabel('phase(radian)');
  53. %% Linearity of Fourier Transform
  54. syms t
  55. a1 =3; a2 =2; x1 = exp(-3*t); x2 = exp(-t);
  56. x = a1*x1 +a2*x2;
  57. left = fourier(x,w);
  58. right = fourier(a1*x1,w) + fourier(a2*x2,w);
  59.  
  60. ww = -10:.01:10;
  61. left = subs(left,w,ww);
  62. right = subs(right,w,ww);
  63. plot(ww,abs(left),'r',ww,abs(right),'*')
Add Comment
Please, Sign In to add comment