Advertisement
makispaiktis

PSES - DFT3

Oct 23rd, 2020 (edited)
2,325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.39 KB | None | 0 0
  1. f1 = 50;
  2. f2 = 55;
  3. Fs = 150;
  4. % Δεν υπαρχει πρωτογενες aliasing
  5. N = 50;
  6. dt = 1 / Fs;
  7. n = [0:1:N-1];
  8. t = dt*n;
  9. x = cos(2*pi*f1*t) + cos(2*pi*f2*t);
  10. X =  fft(x);
  11. stem(n, abs(X));
  12. hold on;
  13.  
  14. N = 75;
  15. % Στενευει ο κεντρικος λοβος της sinc
  16. dt = 1 / Fs;
  17. n = [0:1:N-1];
  18. t = dt*n;
  19. x = cos(2*pi*f1*t) + cos(2*pi*f2*t);
  20. X =  fft(x);
  21. stem(n, abs(X));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement