University · Fourier analysis
Build a square-like wave from sine waves
Add odd harmonics and watch a finite Fourier sum approach a square wave, with visible overshoot near its jumps.
Predict what will happen, press Play, then pause and explain what changed. Every control also works without playback.
Watch the relationship
PausedHD animation studio
From experiment to screen.
Present a crisp Canvas scene, save a full-HD image, or capture your model as a silent video.
Understand what you are seeing
The idea behind the motion.
Complicated periodic shapes can be assembled from simple sinusoidal components. For a symmetric square wave, only odd harmonics appear. Increasing the number of terms sharpens transitions, but a finite sum is always smooth and cannot reproduce a jump exactly.
A relationship to keep
Sₙ(x, t) = (4a/π) Σⱼ₌₀ⁿ⁻¹ sin((2j+1)(fx−t))/(2j+1)
Read the symbols alongside the explanation. A diagram shows the relationship; the assumptions tell you when it applies.
- STEP 1
Begin with a fundamental
With one term, the curve is a single sine wave. The coefficient 4a/π is chosen for the Fourier representation of the target square wave.
- STEP 2
Add odd harmonics
Each new term has an odd multiple of the fundamental frequency and a smaller coefficient. All terms move with the same translating pattern because their phases scale with their harmonic number.
- STEP 3
Notice the limitation
The dashed amber target jumps between −a and +a. The teal finite sum overshoots near those jumps. Adding terms narrows that region but does not make the limiting overshoot height vanish: this is the Gibbs phenomenon.
Your turn to explain
Make a prediction. Test your reasoning.
With N = 3, which harmonic numbers appear?
Use the values specified in the question. Reset restores the initial values for this investigation.
Compare your explanation
1, 3, and 5, with coefficients 4a/π, 4a/(3π), and 4a/(5π). N counts terms, not the largest harmonic number.
Work through a full lesson
Connect the animation to a worked example and practice questions.