Two halves of the spectrum
The 2D Fourier transform describes an image as a sum of sinusoids. Each coefficient is a complex number, which can be written by its length and angle:
The magnitude says how strong the sinusoid of frequency is, the phase where its crests lie. Both are needed to get the image back. The experiment here keeps one of them and replaces the other: the result has exactly the frequency content of A, but the wave positions of B.
Phase carries the structure
The result looks like the image that donated the phase. An edge is a place where many sinusoids of different frequencies have their crests at the same spot, so that they add up to a step. The phase decides where the waves line up, and therefore where the edges, lines and corners are. The magnitude only decides how strongly each frequency takes part.
The shift theorem makes this concrete: moving an image by multiplies its spectrum by . The magnitude does not change at all; the position of everything in the image is stored in the phase.
Magnitude spectra look alike
Natural images have similar magnitude spectra: strong at low frequencies and falling off roughly like , with some extra energy perpendicular to dominant edge directions. Replacing by its average over rings of equal frequency, which removes all directional information, still leaves a clearly recognizable image. Setting instead makes all frequencies equally strong; this whitening boosts the fine detail, so only the edges remain, but they are all in the right place.
The other way round, the magnitude alone says little. With random phases, the waves no longer line up anywhere and the image turns into texture-like noise with the same frequency content. With zero phase, every wave has a crest at the origin: all energy piles up there, and the image becomes symmetric about the origin.
Try this
- Compare the two swapped images with A and B: each looks like its phase donor. The values panel confirms it with the correlation coefficients.
- Choose the test chart as image B: the lines and patches appear in the swapped image, with the tone of the landscape overlaid as noise.
- Look at the radially averaged magnitude: the landscape is still easy to recognize, even though its spectrum now has no preferred direction.
- Compare the whitened image with image A: only the edges are left, like an edge detector.
- Press “New random phase” a few times: every version has the same magnitude as A, and none of them looks like it.
- Open two of your own photos as A and B: faces and buildings follow the phase just as clearly.