Sum of Sinusoids
Building complex signals from simple ones
A single sinusoid is smooth and featureless. But add a few together and something remarkable happens: sharp corners appear.
You can build a square wave out of sine waves. A sawtooth wave. A triangle wave. Any shape at all. This is the central miracle of Fourier analysis: you can create any periodic signal by mixing pure tones at the right frequencies, amplitudes, and phases.
Let's watch it happen.
Building a Square Wave
A square wave jumps between +1 and −1. It's the opposite of smooth. Yet it can be built entirely from smooth sine waves. The recipe:
square(t) = 4⁄π [sin(t) + 1⁄3 sin(3t) + 1⁄5 sin(5t) + 1⁄7 sin(7t) + …]
Only odd harmonics (1, 3, 5, 7, …) and their amplitudes follow a simple pattern: 1/n for the n-th harmonic. Add them one at a time and watch the square wave emerge:
Every Shape Has a Recipe
The square wave isn't special. Every periodic signal has its own unique Fourier series. Here are three more classic waveforms:
The Frequency Spectrum
Instead of looking at the signal over time, we can look at its recipe: how much of each frequency is present. This is the frequency spectrum, and it's the other half of the DSP picture.
The Gibbs Overshoot
Look carefully at the square wave approximation near the jumps. Even with 25 harmonics, there's a noticeable overshoot where the approximation rings past the target value by about 9% before settling down.
This is the Gibbs phenomenon, and it never goes away no matter how many harmonics you add. The overshoot stays at about 9%, but gets narrower and narrower as you add more terms. It's a fundamental limitation of representing discontinuities with smooth sinusoids.
Gibbs overshoot shows up in real systems whenever you truncate a frequency spectrum, for example, when filtering a signal. Engineers have developed various window functions (like Hamming or Hann windows) that trade a wider transition for less ringing.
Beyond Periodic Signals
Everything so far has been periodic, meaning signals that repeat forever. But real signals (a spoken word, a radio burst, a sensor reading) are not periodic.
The Fourier transform generalizes the Fourier series to handle any signal, periodic or not. Instead of discrete harmonics (f, 2f, 3f, …), the Fourier transform produces a continuous spectrum, a function that tells you how much energy is at every possible frequency.
The math gets more involved, but the core idea is identical: any signal is a sum of sinusoids. The Fourier series adds up a countable list. The Fourier transform integrates over a continuum. Same principle, different bookkeeping.
Frequently Asked Questions
What is a Fourier series?
A Fourier series decomposes a periodic signal into a sum of sinusoids at integer multiples of the fundamental frequency. For example, a square wave equals sin(t) + ⅓sin(3t) + ⅕sin(5t) + ... Each term is called a harmonic. More harmonics means a closer approximation to the original signal.
What is the Gibbs phenomenon?
The Gibbs phenomenon is a ~9% overshoot that appears near sharp discontinuities in a Fourier series, no matter how many harmonics you include. Adding more terms makes the overshoot narrower but never eliminates it. This is a fundamental limitation of representing sharp edges with smooth sinusoids and has practical implications for signal reconstruction.
What is the difference between Fourier series and Fourier transform?
The Fourier series applies to periodic signals and produces a discrete set of harmonics (f, 2f, 3f, ...). The Fourier transform applies to any signal (periodic or not) and produces a continuous frequency spectrum. The series is a special case of the transform, and both decompose signals into sinusoidal components.
Quick Check
Test your understanding of the key concepts from this lesson.






