A10 · Lesson 1 · Building signals from sinusoids
A square wave is a stack of sine waves
A square wave looks like the opposite of a sine wave: flat tops, instant jumps. Yet you can build one entirely out of sine waves, if you add the right ones in the right amounts. This is Fourier's idea, and it's why engineers can analyze any repeating signal one frequency at a time: a filter, an amplifier or a cable treats each sine wave separately, and the output is the sum of what it does to each.
Play
- The top panel shows the sum of the first odd harmonics of a 200 Hz sine wave, each with amplitude . The bottom panel shows how much of each frequency is in the sum.
- Start at and add harmonics one at a time. What happens to the corners and the flat tops? Press Listen to hear the sound change.
- With all nine harmonics, look just next to each jump. Does the overshoot shrink as you add more?
Predict
A 1 kHz square wave goes through a filter that removes everything above 2.5 kHz. What comes out?
A plain 1 kHz sine wave. A square wave's harmonics are at 1, 3, 5, 7 kHz and so on. The filter keeps only the 1 kHz one, with amplitude times the square wave's, and throws away the rest. Square-wave oscillators followed by a filter are a cheap way to make a sine wave, and it's also why a square wave sent down a slow cable arrives with rounded corners.
Name it
Fourier series
The claim. Any periodic signal with period (frequency ) can be written as a sum of sinusoids at whole-number multiples of :
is the average (DC) value, and the term with frequency is the nth harmonic. The first harmonic, itself, is the fundamental.
The square wave. A square wave swinging between and is
Only odd harmonics appear, and their amplitudes fall as . The sharp corners need the high harmonics; with only a few, the corners are rounded.
Other shapes:
| Signal | Harmonics | Amplitudes fall as |
|---|---|---|
| sine | the fundamental only | |
| square | odd only | |
| triangle | odd only | |
| sawtooth | all |
The smoother the signal, the faster its harmonics shrink. A jump needs harmonics falling only as ; a kink (like a triangle's point) needs only .
Gibbs's overshoot. Right next to a jump, the partial sum overshoots by about 9% of the jump, however many harmonics you add. The overshoot gets narrower but no shorter. Real filters that cut off harmonics sharply show the same ringing.
Why it matters. A linear circuit responds to each harmonic separately (superposition, A8.14), multiplying it by its frequency response at that frequency. So to find what a filter does to a square wave, you work out what it does to each harmonic and add them up. The rest of this course builds on that idea.
Worked example
A ±5 V square wave runs at 1 kHz. What are its first three nonzero harmonics?
Show the solution
- Which harmonics. A square wave has only odd harmonics, with amplitudes
- The fundamental, at 1 kHz. With V:
- The 3rd harmonic, at 3 kHz.
- The 5th harmonic, at 5 kHz.
Answer 6.37 V at 1 kHz, 2.12 V at 3 kHz and 1.27 V at 5 kHz.
Worked example
That square wave drives an RC low-pass with its corner at 1 kHz. How big are the fundamental and the 3rd harmonic at the output?
Show the solution
- The filter's gain. The filter multiplies each harmonic by
- The fundamental. At the gain is :
- The 3rd harmonic. At the gain is :
- Compare. At the input the 3rd harmonic was a third of the fundamental. At the output it's of it, which is why the output looks rounder.
Answer the fundamental comes out at 4.50 V and the 3rd harmonic at 0.671 V, so the 3rd harmonic drops from a third of the fundamental to 0.149 of it.
Worked example
What are the first two harmonics of a ±1 V triangle wave?
Show the solution
- Which harmonics. A triangle wave has only odd harmonics, with amplitudes
- The fundamental.
- The 3rd harmonic. It's nine times smaller:
- Why it falls faster. Its harmonics fall as , against for a square wave, because a triangle has no jumps, only corners. The smoother a waveform, the faster its spectrum falls off.
Answer the fundamental is 0.811 V and the 3rd harmonic is 0.090 V.
Check
What is the frequency of the 3th harmonic of a 60 Hz signal?
Write units the way you normally would: 1.5 Hz, 1500 mHz and 0.0015 kHz are the same answer.
Check
A square wave swings between +5 V and −5 V. What is the amplitude of its 3th harmonic?
Write units the way you normally would: 1.5 V, 1500 mV and 0.0015 kV are the same answer.
Check
A square wave with equal time high and low contains which harmonics?
Check
A signal is the sum of a 3×100 Hz sine wave and a 3×100 Hz sine wave. What is the fundamental frequency of the sum?
Write units the way you normally would: 1.5 Hz, 1500 mHz and 0.0015 kHz are the same answer.
Check
A ±1 V square wave at 2 kHz goes through an RC low-pass filter with corner 2 kHz. What is the amplitude of the 3rd harmonic at the output?
Write units the way you normally would: 1.5 V, 1500 mV and 0.0015 kV are the same answer.
Check
A ±1 V triangle wave.
(a)
What is the amplitude of its fundamental?
Write units the way you normally would: 1.5 V, 1500 mV and 0.0015 kV are the same answer.
(b)
What is the amplitude of its harmonic number 3?
Check
A ± square wave has odd harmonics .
Step 1
What is the amplitude of harmonic ?
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Step 2
What power (into 1 Ω) does that harmonic carry?
Explain why
Why does a square wave need high harmonics, when a sine wave needs only one frequency?
Each sinusoid is smooth, so adding a few low-frequency ones can only make a smooth, rounded shape. A square wave jumps almost instantly from one level to the other, and changing that fast needs components that themselves change fast, which means high frequencies. The more harmonics included, the steeper the edges and the flatter the tops. A pure sine wave already is one sinusoid, so it needs nothing else.
Practice
Keep practicing
8 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.