Frequency analysis, aliasing, and filtering in the spatial and frequency domains
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.
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).
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.
Load an image, convert to grayscale, and compute its 2D FFT. Displays the log-magnitude spectrum (centered) and phase spectrum.
Observe how the FFT magnitude spectrum changes in real-time as a white rectangle is zoomed, rotated, or translated.
Apply ideal low-pass and high-pass filters in the frequency domain. The cutoff radius controls which frequencies are kept or removed.
Made with ❤️ by Mark Žnidar