Advertisement
Haath

Mlab 3

May 4th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. X = [-2:2];
  2. fftshift(X);
  3. ifftshift(X);
  4. Y = fftshift(fftshift(X));
  5. Z = ifftshift(fftshift(X));
  6. isequal(X, Y)
  7. isequal(X, Z)
  8.  
  9. ==================================
  10.  
  11. close all; clear all;
  12. xb = [1 2 3 4 5 6 5 4 3 2 1]
  13. figure;
  14. subplot(2, 1, 1);
  15. plot([-5 : 5], xb);
  16. ylabel('xb');
  17.  
  18. x = ifftshift(xb);
  19. X = fft(x);
  20. Xb = fftshift(X);
  21.  
  22. subplot(2, 1, 2);
  23. plot([-5 : 5], Xb);
  24. xlabel('Xb');
  25.  
  26. ==================================
  27.  
  28. close all; clear all;
  29. xb = [1 2 3 4 5 6 5 4 3 2 1]
  30. figure;
  31. subplot(2, 1, 1);
  32. plot([-5 : 5], xb);
  33. ylabel('xb');
  34.  
  35. x = ifftshift(xb);
  36. X = ifft(x);
  37. Xb = fftshift(X);
  38.  
  39. subplot(2, 1, 2);
  40. plot([-5 : 5], Xb);
  41. xlabel('Xb');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement