Fourier Transform Lab

Fourier Transform: Decompose Complex Waves into Frequency Maps

Fourier Transform isn't about "memorizing formulas" - it's about scanning signals with rotating frequency probes: whichever frequency allows signal contributions to accumulate consistently in the same direction will leave a peak in the spectrum. This page uses p5.js to demonstrate wave synthesis, formula visualization, rotating vectors, and spectrum reconstruction in sync.

Observe Time Domain

First see the raw waveform fluctuating over time, understanding that "complexity" usually comes from superposition of multiple simple waves.

Observe Formula

Click each part of the formula to see its corresponding signal, rotating probe, integration trajectory, and output result in the visualization.

Observe Frequency Domain

Visualize frequency amplitudes as a spectrum, then filter out some frequencies to see how the reconstructed waveform changes.

Framework Choice

This page uses local p5.js, ideal for continuous animations and educational graphics experiments, avoiding external CDN dependencies.

Standard Introduction

Fourier Transform is a type of linear integral transform that converts functions or signals from time-domain representation to frequency-domain representation. For continuous signals, it's commonly written as F(ω)=∫f(t)e-iωtdt; where f(t) is the original signal, e-iωt is the complex exponential basis function, and the integral represents projecting the original signal onto an orthogonal basis at a specific frequency.

Intuitively, Fourier Transform answers: in a complex signal, what's the amplitude of each frequency, what's their phase, and where is energy concentrated? It transforms "shape changing over time" into "a list of components arranged by frequency," making it a fundamental tool in signal processing, communications, image compression, acoustics, quantum mechanics, and partial differential equation analysis.

Plain Language Explanation

Imagine hearing a chord - your ear perceives the mixed sound, but music software can tell you it contains bass, midrange, and treble frequencies. Fourier Transform does something similar: it takes a seemingly complex curve and breaks it down, telling you "how much of 1x frequency, 2x frequency, 3x frequency" is present.

More vividly, Fourier Transform is like a row of "tuning forks" or "frequency detectors." When a detector's frequency matches a hidden frequency in the signal, contributions accumulate; if frequencies don't match, positive and negative contributions cancel each other out, leaving almost no peak.

6 Key Intuitions to Understand First

All subsequent interactions revolve around these concepts: time domain shows waveform appearance, frequency domain shows component list, and the formula precisely connects the two.

Time Domain

Horizontal axis is time or position, vertical axis is signal amplitude. Waveforms we see with our eyes are usually in the time domain.

Frequency

Frequency represents how many oscillations occur per unit time. Higher frequencies mean faster waveform changes and finer details.

Amplitude

Larger amplitude at a frequency means that frequency is stronger in the original signal, resulting in a taller spectrum bar.

Phase

Phase describes where the waveform starts. Two waves with the same frequency but different phases will have different peak and trough positions.

Complex Exponential

e-iωt can be visualized as a rotating vector. It wraps the signal around the origin, making it easier to detect frequency matches.

Orthogonal Projection

Matching frequencies accumulate in the same direction; mismatched frequencies cancel out by wrapping around. This is why peaks appear.

Experiment 1: Make the Formula Come Alive

Click different parts of the formula, then adjust frequency and integration progress. You'll see the formula isn't just symbols - it's four synchronized actions.

Formula Visualization

What Does F(k)=∫f(t)e-i2πktdt Actually Calculate?

Here we use the simplified form over one period: F(k)=∫01f(t)e-i2πktdt. k is the analysis frequency you choose. p5.js will advance signal points through time while multiplying by the rotating probe, finally showing the complex result accumulated through integration.

= ·

0.000 Real Part: Match with Cosine
0.000 Imaginary Part: Match with Sine
0.000 Magnitude: Strength of this frequency
Phase: Starting point of this frequency component

Experiment 2: Build Your Own Complex Waveform

Adjust amplitude and phase of each harmonic to see how simple sine waves combine into complex curves. Taller spectrum bars indicate stronger frequencies.

Wave Synthesis

From "Simple Waves" to "Complex Curve"

The first step in Fourier thinking is recognizing that complex waveforms can be built from simple waves. Each row below is a sine wave component: amplitude determines its strength, phase determines where it starts.

Synthesized Wave Strongest Harmonic Spectrum Bars

Experiment 3: Filter in Frequency Domain, Return to Time Domain

Fourier Transform is useful because we can process signals in the frequency domain: keeping low frequencies smooths curves, while keeping high frequencies emphasizes edges and details.

Spectrum & Reconstruction

Spectrum is Not Conclusion, But Editable Signal Map

Below, the current waveform is first decomposed into spectrum bars, then frequencies are filtered according to rules, and finally the remaining frequencies are re-synthesized back to the time domain. You can directly see how "removing certain frequencies" changes the original waveform.

4/8 Number of Frequencies Kept
0.000 Reconstruction Error: Smaller = Closer to Original
Lowpass Current Frequency Domain Filter

Why This Theory Matters

Once signals can be decomposed into frequencies, they can be analyzed, compressed, filtered, transmitted, and reconstructed - this is the engineering value of Fourier Transform.

Audio Processing

Noise reduction, equalizers, pitch detection, and MP3-like compression all rely on distinguishing strong and weak frequencies.

Image Processing

Images can be treated as 2D signals. Low frequencies correspond to large light/dark regions; high frequencies correspond to edges, textures, and noise.

Communications & Radar

Wireless signals are modulated, multiplexed, and filtered in the frequency domain; radar echoes also use spectra to determine speed and distance.

Scientific Computing

Heat conduction, wave equations, quantum states, and periodic structures often become easier to analyze in the frequency domain.

Common Misconceptions

  • Fourier analysis isn't limited to periodic signals; non-periodic signals can also have their frequency composition described by Fourier Transform.
  • A tall spectrum bar doesn't mean "louder sound" - it only indicates that particular frequency component is stronger.
  • Phase isn't optional. Without phase, many signals with identical frequency amplitudes would reconstruct into different shapes.
  • Complex numbers in the formula aren't for show - they combine sine and cosine directions into a single rotating expression.

Key Takeaways

The core of Fourier Transform is "matching frequencies." When the rotating probe frequency matches a component in the signal, the integral produces a clear vector; when frequencies don't match, contributions cancel out.

If you remember one image: wrap the signal around a circle. Frequencies that cause the wrapped trajectory to noticeably favor one direction are the actual frequencies present in the signal.