021: Fourier’s Window
2026-10-18
Last time a wave went through a gap in a wall and made a pattern on the far wall. A single slit made a broad hump. Two slits made fringes. It looked as if each gap had its own pattern and each one needed working out.
They are all one rule. The pattern a long way behind a gap is the Fourier transform of the gap. A Fourier transform takes a picture and says how much of each ripple it is made of: a few broad ripples and a few fine ones, in every direction. A gap is a picture too, open where the wave gets through and shut where it does not. The wave leaves the gap in all directions and each direction sees a different ripple of the gap.
The picture has changed from last time. Then we looked down on the tank from above and the wall was a line with gaps in it. Now we look at the wall head-on, as a wave coming towards us would see it. The wall is a flat sheet and the gap is a shape cut out of it. The slits are tall bars and the pattern falls on a flat screen a long way behind, so it spreads in two directions and not one.
On the left below is the gap in the wall, white where it is open. On the right is the pattern on the screen, brightest in the middle. Paint on the gap with the mouse and the pattern follows.
Each point in the pattern stands for one ripple. Where it is says how many crests of the ripple fit across the gap and which way they run. How bright it is says how well the gap lines up with the ripple. Move the mouse over the pattern and the ripple for that point appears on the gap, red for the crests and blue for the troughs. It is not a wave arriving at the wall. It is a test pattern, the thing the gap is being compared with, and it pulses in place so that the crests and troughs swap. At a bright point the crests reach every open part of the gap together, so the open parts flash red and blue in step and the sum swings far. At a dark point some open parts are on crests while others are on troughs, they cancel and the sum stays near zero.
Try these:
- Two slits. The same fringes as last time, now with the rest of the pattern. The slits are tall and narrow, so the pattern is spread sideways and squeezed up and down. Move the mouse to a bright fringe and both slits flash red and blue together. Move it to the dark band between and one slit is red while the other is blue.
- Paint over half of one slit, or make a slit fatter. Whatever gets bigger in the gap gets smaller in the pattern. A wide gap makes a tight pattern and a narrow one a broad pattern.
- Circle. A round gap makes rings. It is how a telescope blurs a star.
- Grating. Five slits instead of two. The fringes get sharper.
- Clear, then draw anything you like.
Analysis
The brightness along the middle row of the pattern, for the One slit and Two slits gaps. The solid line is what the transform gives and the dashed line is last time’s formula for the pattern behind a slit: a hump from the width of the slit and, for two, fringes from the space between them. They are the same thing. The formula was the Fourier transform of a slit worked out by hand and here the computer has done it for every point at once. It stops matching as soon as you paint on the gap.
A sum of ripples
In 1822 Joseph Fourier published his book on how heat flows. In it was the claim that any pattern along a line can be built by adding sine waves of different sizes. A picture is a pattern along two lines at once, so it can be built from ripples: waves that run across it in some direction with some number of crests.
To find how much of one ripple a gap contains you multiply the gap by the ripple, cell by cell and add up. That sum is one point of the pattern:
F(k_x, k_y) = \sum_{x, y} h(x, y) \, e^{-2\pi i (k_x x + k_y y) / N}.
Here h is 1 where the gap is open and 0 where it is wall. The exponential is the ripple, with k_x crests across the gap sideways and k_y up and down and N is 512. The brightness of the point is |F|^2. It is the sum you watch when you point at the pattern. Where the ripple puts a crest on every open part of the gap the terms all add and the sum is large. Where it puts crests on some and troughs on others they cancel.
How the computer does it
The page works out that sum by hand for the one ripple you point at, a loop over the open cells of the gap. For the whole pattern it would need a sum for every ripple. The GPU does that for all 262,144 of them at once by a shortcut. We’ll find out how later. The readout under the canvas is how long it takes on this machine, measured when the page loaded.
The shader that draws the pattern squares each result to get a brightness and puts it on a log scale, four factors of ten from the brightest to the dimmest, since the middle is very much brighter than the edges. The transform puts the zero frequency in the corner of the array and the drawing shifts it by half to the middle.
Sources
- Fourier, J. (1822), Théorie analytique de la chaleur (Paris: Firmin Didot).
- Adams, C. S. and Hughes, I. G. (2018), Optics f2f: From Fourier to Fresnel (Oxford University Press), for the pattern behind a gap as a Fourier transform.