DFT2-FFT2.docx .htm contains a comparison of the timing and results from the simplest and intermediate Fourier transforms. This folder contains a comparison of FFT2 and the theoretical transforms. The code is in twodfft.zip.
This folder is the implementation of
..\..\public_html\Fourier\2d-FourierTransform\2d-FourierTransform.docx .htm
The ide is TwoDFT.wpj
(1.1)
data x1,wx1,y1,wy1/3.7d0,1.3d0,-1.9d0,0.7d0/
data x2,wx2,y2,wy2/-2.7d0,0.45d0,1.7d0,0.37d0/
The narrowest peak is at y=1.7 with a width of 0.37 meaning that y needs to go up to about
1.7+3*0.37 = 3 at most. It also needs to have a Δy of 0.1 or less. The low y value is -1.9 – 3*.7 or -4 with a somewhat larger Δy Thus the y range of 10 should cover the interval. The x range is up to 3.7+3*1.3 = 7.6 and down to -2.7-3*.45 = -4.2, thus an x range of 15 should be about right with a Δx of about 0.4
C:\public\TwoDFT>twodft
n2px is power of 2 > max(nx,nfx)
enter XINT, nx, nfx, n2px
15,150,250,512 Actual spacing of 0.1 in x needed to get to constant in fx
enter YINT, ny, nfy, n2py
10,100,100,128
FFT transform
sec 0.1600000
The dd values are stored in the file h.xy with the x’s varying fastest and in a single block

Figure 1 Two Gaussians in the x,y plane
(1.2)

Figure 2 Real part of transform in x of the two Gaussians. The red lines (theory) overwrite the black (numerical) transforms.
C:\public\TwoDFT>twodft
n2px is power of 2 > max(nx,nfx)
enter XINT, nx, nfx, n2px
40,201,1001,1024
enter YINT, ny, nfy, n2py
10,31,31,512
simplest intermediate transform
sec 1.3800000
FFT transform
sec 0.4400000
The narrow Gaussian in the upper region is wide in the transform space. The area of each Gaussian determines Dd(0,y). The locations depend on phases.
(1.3)
The function in figure 2 is not as smooth as the function in figure 1.

Figure 3 Full transform Red (theoretical) on top of Black (numerical)
A transform with the peaks at the origin, would not oscillate. The oscillations tell where the peaks are in the xy domain.