Fourier Transform Visualizer
Run the Fourier Transform Visualizer Fullscreen
Edit the Fourier Transform Visualizer with the p5.js editor
About This MicroSim
This MicroSim demonstrates the 2D Discrete Fourier Transform, showing how spatial patterns map to frequency representations and how frequency filtering affects images.
How to Use
-
Select an Image Pattern: Different patterns produce characteristic frequency spectra
-
Apply Frequency Filter:
- Low-pass: Keeps smooth areas, removes high frequencies (blurs)
- High-pass: Keeps edges, removes low frequencies (edge enhancement)
-
Band-pass: Keeps specific frequency range
-
Adjust Cutoff: Control the filter radius in frequency space
Panels Explained
| Panel | Shows |
|---|---|
| Original Image | Spatial domain input |
| Magnitude Spectrum | Frequency content (log-scaled for visibility) |
| Phase Spectrum | Spatial structure information (color-coded) |
| Filtered Image | Reconstruction after frequency filtering |
Learning Objectives
Students will be able to: - Understand the relationship between spatial patterns and frequency spectra - Recognize that periodic patterns create discrete frequency peaks - Apply frequency filtering for image processing - Explain why phase carries more structural information than magnitude
Key Insights
- Vertical stripes → Horizontal line in spectrum (perpendicular!)
- More stripes → Peaks farther from center (higher frequency)
- Edges → Broad frequency content (sharp transitions need many frequencies)
- Phase surprisingly carries most perceptual information
Lesson Plan
Introduction (5 minutes)
The Fourier transform decomposes an image into sine wave components. Every image is a sum of 2D sinusoids of different frequencies and orientations.
Pattern-Spectrum Mapping (10 minutes)
- Start with Vertical Stripes - observe the horizontal line in spectrum
- Switch to Horizontal Stripes - the line rotates 90 degrees
- Try Checkerboard - see the diagonal peaks
- Single Edge - notice the broad frequency spread
Frequency Filtering (10 minutes)
- Apply Low-pass filter - smooth areas preserved, edges blur
- Apply High-pass filter - only edges remain
- Adjust cutoff to see gradual effect
Discussion Questions
- Why does the spectrum have the pattern perpendicular to the image stripes?
- What does the DC component (center point) represent?
- Why would JPEG compression work in frequency domain?