Guest User

Untitled

a guest
Sep 5th, 2020
57
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. N = 256
  2. sigma = 5
  3. %===================================================================================
  4. cs = (1 + exp(-sigma ** 2) - 2 * exp(-.75 * sigma ** 2)) ** (-.5);
  5. ks = exp(-.5 * sigma ** 2);
  6. %===================================================================================
  7. n = linspace(-8, 8, N);
  8. morl = exp(-.5 * n .^ 2) .* (exp(1j * sigma * n) - ks) * cs * pi .^ (-.25);
  9. %===================================================================================
  10. k = linspace(0, N - 1, N);
  11. morl_f = (exp(-.5 * (sigma - k) .^ 2) - ks * exp(-.5 * k .^ 2)) * cs * pi .^ (-.25);
  12. %===================================================================================
  13. morl_fft = fft(morl);
  14. %===================================================================================
  15. plot(real(morl)); hold on; plot(imag(morl)); hold off
  16. plot(morl_f)
  17. plot(real(morl_fft)); hold on; plot(imag(morl_fft)); hold off
  18. plot(abs(morl_fft))
RAW Paste Data