Build any wave by adding sine components
Fourier's theorem states that any periodic function can be decomposed into a sum of sine and cosine waves of different frequencies and amplitudes. The fundamental frequency sets the pitch; harmonics add complexity. Square waves require infinitely many odd harmonics; more harmonics = sharper corners. This decomposition is foundational to signal processing, acoustics, and quantum mechanics.
Plus 148+ other Pro labs covering AP Physics, Biology, Chemistry, Earth Science, and Math — with unlimited simulation time, advanced parameters, and detailed analytics.
Already have an account?
Sign in →Hold down a single key on a piano and what reaches your ear is not a pure sine wave — it is a rich, slightly buzzy tone with character. That character comes from harmonics: integer multiples of a fundamental frequency, stacked on top of one another with specific amplitudes. Joseph Fourier proved in the early 1800s that any periodic vibration, no matter how spiky or jagged, can be built up by adding pure sine waves of the right frequencies and sizes. This lab lets you do exactly that. Pick a target shape — square, triangle, or sawtooth — then add harmonics one at a time and watch the composite waveform creep toward the target. The spectrum panel shows you the recipe: which harmonics matter, and how much of each.
MisconceptionFourier series is a math trick people invented to approximate ugly functions — it is not real physics.
CorrectEvery periodic vibration in nature literally is a sum of sines. A vibrating guitar string really is oscillating in the fundamental plus all its harmonics simultaneously, and you can detect each component with a microphone and an FFT. The math reflects the physics, not the other way around.
MisconceptionIf you add enough harmonics, you eventually get a perfect square wave with infinitely sharp corners.
CorrectWith any finite number of harmonics there is always a small overshoot near each corner — the Gibbs phenomenon. Adding more terms shrinks the wiggle in width but the overshoot height stays around 9 percent. A perfect square only emerges in the infinite-harmonic limit.
MisconceptionEven and odd harmonics are interchangeable — you can build any shape from any harmonics.
CorrectSymmetry decides the recipe. A square wave's symmetry forces all even-numbered harmonics to be zero, so it uses only the 1st, 3rd, 5th, and so on. A triangle wave is also odd-only. A sawtooth, which lacks that symmetry, uses every harmonic.
MisconceptionTwo musical instruments playing the same pitch produce identical waveforms.
CorrectSame pitch means same fundamental frequency, but the harmonic mix — the timbre — is different. A violin and a flute on the same A4 have different Fourier coefficients, and that is exactly why they sound like different instruments.
A square wave has a special symmetry: its second half is the negation of its first half. Even-numbered harmonics do not share that symmetry, so when you integrate to find their Fourier coefficients you get exactly zero. Odd-numbered sines (1, 3, 5, …) match the square's symmetry, so they survive with amplitudes proportional to 1/n. You can verify this in the spectrum panel — every even bar stays empty.
Gibbs phenomenon is the persistent ~9% overshoot you see near each corner of a square or sawtooth wave. Adding more harmonics narrows the wiggle in horizontal extent but the peak height does not shrink — it converges to a fixed value tied to the integral of sin(x)/x. So the overshoot is real, mathematical, and unavoidable with any finite sum, even though the energy in the overshoot region goes to zero in the limit.
Both instruments produce the same fundamental frequency, so your brain hears the same pitch. But each instrument excites a different mix of harmonics — different a_n values — so their composite waveforms have different shapes. The flute is dominated by the fundamental with weak upper harmonics (close to a sine), while the violin has rich, comparable amplitudes well above the fundamental. That harmonic recipe is timbre.
GO-5.A covers superposition of waves: students must show that two or more waves passing through the same region add point-by-point in displacement. Fourier synthesis is superposition taken to its logical end — instead of just two interfering waves, you superpose dozens of carefully chosen sines to construct any periodic shape. The lab makes that abstract claim concrete and visual.
It shows up almost everywhere periodic things appear: audio compression in MP3 files, JPEG image compression (a 2D cousin called the discrete cosine transform), MRI image reconstruction, quantum mechanical wavefunctions, and digital filters in your phone. The reason: any periodic signal has a Fourier representation, and many operations (filtering, denoising, compression) are far easier in the frequency domain than the time domain.
Triangle waves have Fourier coefficients that fall off as 1/n² — much faster than square waves, which fall off as 1/n. That means almost all the 'energy' of a triangle is in the fundamental, with the upper harmonics making only small refinements. A square wave, by contrast, needs many harmonics to look square because each one still contributes a meaningful amount.