I want to take a 2D fourier transform of some data, but when I try this I get unexpected results. When I use ImagePeriodogram
I get something that looks like I would expect. First I create some data. In this case a circle with radius 10.
n = 200;
data = Table[
UnitStep[10^2 - (x - n/2)^2 - (y - n/2)^2], {x, 1, n}, {y, 1, n}];
img = Image@data
This gives me the following picture:
When I apply ImagePeriodogram
I get something that looks like other examples I found online (like this one)
ImagePeriodogram@img
Now I try to do this using Fourier
; notice the corners.
spectrum = Abs[Fourier@data]^2;
Image@spectrum
The specs of ImagePeriodogram
state that it is just the absolute magnitude squared of the fourier transform, so this would lead me to the conclusion that my understanding of Fourier[]
in Mathematica is wrong. I want to use Fourier
in my code so I want to understand why these images differ. ImagePeriodogram
is also scaled logarithmically but the pictures are still different nonetheless.