Advertisement
miknik97

benrzamin sektownicki

Mar 27th, 2019
2,991
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scilab 0.67 KB | None | 0 0
  1. /*
  2. clear
  3. clc
  4. xdel(winsid());
  5. x=linspace(0,20*%pi,50);
  6. y=cos(2*%pi*x/16);
  7. subplot(2,1,1)
  8. plot(x,y)
  9. xtitle('Funkcja cosinus')
  10. X=fft(y,-1);
  11. subplot(2,1,2)
  12. plot2d3(x,real(X))
  13. plot(x,real(X), 'ro');
  14. xtitle('FFT funkcji cosinus')
  15. */
  16. /*
  17. clear
  18. clc
  19. xdel(winsid());
  20. n=0:10;
  21. a=n+1;
  22. x=a.*sin(2*%pi*n/10);
  23. X=fft(x);
  24. plot(a,x)
  25. figure
  26. plot2d3(n,real(X))
  27. plot(n,real(X),'ro')
  28. a = gca () ;
  29. a.x_location ="origin";
  30. a.y_location ="left";
  31. */
  32. clear
  33. clc
  34. xdel(winsid());
  35.  
  36. n=0:15;
  37. a=0.3;
  38. w=5:0.5:12.5;
  39. x=a.*sin(w.*%pi.*n/16);
  40. X=fft(x);
  41. plot(n,x)
  42. figure
  43. plot2d3(n,real(X))
  44. plot(n,real(X),'ro')
  45.  
  46. a = gca () ;
  47. a.x_location ="origin";
  48. a.y_location ="left";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement