From 1D signals to 2D images
The 1D Fast Fourier Transform decomposes a signal into frequency components using the Cooley-Tukey divide-and-conquer trick, cutting the naive O(N²) Discrete Fourier Transform cost down to O(N log N). An image is really just a 2D grid of samples, and because the 2D DFT is separable, you don't need a fundamentally different algorithm to transform it: run a 1D radix-2 FFT along every row, then run another 1D FFT down every resulting column (or the other way around). The result is the image's full 2D frequency spectrum, computed at O(N log N) cost per row and column rather than paying the O(N²) price of a direct 2D transform.
Reading the magnitude spectrum
Once transformed (and typically shifted so the zero-frequency term sits at the centre), the spectrum's magnitude |X[u,v]| shows where an image's energy lives across spatial frequency. The centre represents low spatial frequencies — smooth, slowly varying brightness, the broad shapes and gradients in a photo. Points farther from the centre represent high spatial frequencies: sharp edges, fine texture, noise. A photograph of natural scenery typically has almost all its energy concentrated near the centre, because most of an image's content varies gently — which is exactly why high-frequency coefficients can often be discarded aggressively during compression with little visible loss.
Filtering by editing the spectrum
Frequency-domain filtering is just multiplying the spectrum by a mask, then taking the inverse FFT to get back a filtered image. A low-pass filter keeps only a disc around the centre and zeroes everything outside it, which blurs the image by discarding the fine detail carried at high frequency. A high-pass filter does the reverse — zero the centre, keep the edges — which sharpens edges and suppresses smooth shading. Periodic noise, like the repeating stripes from a scanned halftone print or a camera sensor artefact, shows up as a small number of concentrated bright spots at a specific location away from the centre, because a repeating pattern in the spatial domain corresponds to a sharp, isolated peak in the frequency domain. A targeted notch filter zeroes out just those spots, removing the stripes while leaving the rest of the image's frequency content — and its detail — completely untouched.
2D FFT (separable): Step 1: FFT each row → O(N log N) per row Step 2: FFT each column → O(N log N) per column Total for N×N image: → O(N² log N) Filter → multiply spectrum by mask → inverse FFT → filtered image
Frequently asked questions
How do you compute a 2D FFT of an image?
A 2D FFT is separable: run a 1D radix-2 FFT along every row of the image, then run another 1D FFT down every resulting column (or vice versa). This gives the full 2D frequency spectrum at O(N log N) cost per row and column rather than the O(N²) cost of a direct 2D transform.
What do the bright spots in an image's FFT magnitude spectrum mean?
The centre of the spectrum represents low spatial frequencies — smooth, slowly varying brightness across the image — while points farther from the centre represent high spatial frequencies, corresponding to sharp edges and fine detail. A strong line or dot pattern away from the centre usually indicates periodic structure, such as repeating stripes, in the original image.
Why does removing a specific frequency component get rid of periodic stripes in a photo?
Periodic stripes in an image show up as a small number of concentrated bright spots at a specific location in the frequency spectrum, corresponding to that stripe's spatial frequency and orientation. A notch filter zeroes out just those spots before the inverse FFT reconstructs the image, removing the stripes while leaving the rest of the image's frequency content untouched.
Try it live
Everything above runs in your browser — open 2D Image FFT, pick a source pattern, and watch a real radix-2 FFT run on rows then columns as you switch between low-pass, high-pass and notch filtering.
▶ Open 2D Image FFT simulation