ToolPythonIntermediate Gerchberg-Saxton algorithm in NumPy: a phase-only hologram for 25 spots return np.fft.fftshift(np.fft.fft2(np.fft.ifftshift(E), norm="ortho"))return np.fft.fftshift(np.fft.ifft2(np.fft.ifftshift(F), norm="ortho"))
ToolPythonBeginner MRI k-space reconstruction with numpy.fft: shifts, fold-over, ringing print("sorted: ", np.fft.fftshift(np.fft.fftfreq(8)))return np.fft.fftshift(np.fft.ifft2(np.fft.ifftshift(k)))print("fftshift: ", np.fft.fftshift(np.arange(5)), " ifftshift:", np.fft.ifftshift(np.arange(5)))ky = np.fft.fftshift(np.fft.fftfreq(N, d=dx)) # sorted line positions / (1/mm)