← Back to Index

03 – Fourier Transform

Frequency analysis, aliasing, and filtering in the spatial and frequency domains

1 Checkerboard Aliasing

A checkerboard pattern with varying frequency is downsampled by factors of 2–128 and upscaled back to 512×512 using nearest-neighbor interpolation. Notice how aliasing artifacts appear as the sampling rate drops below the Nyquist frequency.

2 1D Discrete Fourier Transform

A discrete sin(x) signal with 16 samples, its DFT amplitude spectrum, the signal visualized as a pixel row, and the DFT matrix (real and imaginary parts).

3 2D Fourier Basis Functions

Each cell shows cos(2π(ux + vy)/N) for u = 0,1,2 (rows) and v = 0…7 (columns). These are the real-valued basis functions that compose any 2D signal.

4 FFT on Images

Load an image, convert to grayscale, and compute its 2D FFT. Displays the log-magnitude spectrum (centered) and phase spectrum.

Original (Grayscale)
Log Magnitude (centered)
Phase

5 FFT Animations

Observe how the FFT magnitude spectrum changes in real-time as a white rectangle is zoomed, rotated, or translated.

Zoom – Spatial
Zoom – FFT Magnitude
Rotation – Spatial
Rotation – FFT Magnitude
Translation – Spatial
Translation – FFT Magnitude

6 Frequency Domain Filtering

Apply ideal low-pass and high-pass filters in the frequency domain. The cutoff radius controls which frequencies are kept or removed.

Original
FFT Magnitude
Filter Mask
Filtered FFT Magnitude
Filtered Image

Made with ❤️ by Mark Žnidar