Advertisement
Matt23

zad1

Oct 24th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. t = 0 : 2 * pi / 32 : 2 * pi;
  2. y = sin(t)
  3.  
  4. subplot(3, 2, 1)
  5. stem(y);
  6. xlabel('Numer probki');
  7. ylabel('Amplituda');
  8. title('Re(y)');
  9. axis([1 32 -1 1])
  10.  
  11. subplot(3, 2, 2)
  12. stem(imag(y))
  13. xlabel('Numer probki');
  14. ylabel('Amplituda');
  15. title('Im(y)');
  16. axis([0 33 -1 0])
  17.  
  18. subplot(3, 2, 3)
  19. fourier = 2 * fft(y) / length(y);
  20. stem(real(fourier))
  21. xlabel('Numer pasma częstotliwościowego');
  22. ylabel('Amplituda');
  23. title('Re(fft(y))');
  24. axis([0 34 -0.05 0.1])
  25.  
  26. subplot(3, 2, 4)
  27. stem(imag(fourier))
  28. xlabel('Numer pasma częstotliwościowego');
  29. ylabel('Amplituda');
  30. title('Im(fft(y))');
  31. axis([0 34 -1 1])
  32.  
  33. subplot(3, 2, 5)
  34. stem(abs(fourier))
  35. xlabel('Numer pasma częstotliwościowego');
  36. ylabel('Magnituda');
  37. title('Moduł(fft(y))');
  38. axis([0 34 0 1])
  39.  
  40. subplot(3, 2, 6)
  41. stem(angle(fourier))
  42. xlabel('Numer pasma częstotliwościowego');
  43. ylabel('Faza [pi x rad]');
  44. title('Phase(fft(y))');
  45. axis([0 34 -4 4])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement