Advertisement
makispaiktis

PSES - DFT - Aliasing

Oct 23rd, 2020 (edited)
369
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.28 KB | None | 0 0
  1. f0 = 10;
  2. Fs = 100;   % 5 times better than Nyquist
  3.  
  4. N1 = 50;
  5. n = [0:1:N1-1];
  6. Dt = 1/Fs;
  7. t = n*Dt;
  8. x = exp(i*2*pi*f0*t);
  9. X = fft(x);
  10. stem(n, abs(X));
  11. figure(1);
  12. hold on
  13.  
  14. N2 = 55;
  15. n = [0:1:N2-1];
  16. Dt = 1/Fs;
  17. t = n*Dt;
  18. x = exp(i*2*pi*f0*t);
  19. X = fft(x);
  20. stem(n, abs(X));
  21.  
  22.  
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement