A101 of 28
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

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 N odd harmonics of a 200 Hz sine wave, each with amplitude 1/n. The bottom panel shows how much of each frequency is in the sum.
  • Start at N=1 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?

Name it

Fourier series

The claim. Any periodic signal with period T (frequency f0=1/T) can be written as a sum of sinusoids at whole-number multiples of f0:

x(t)=a0+∑n=1∞Ancos⁡(2πnf0t+φn)

a0 is the average (DC) value, and the term with frequency nf0 is the nth harmonic. The first harmonic, f0 itself, is the fundamental.

The square wave. A square wave swinging between +1 and −1 is

x(t)=4π(sin⁡ω0t+sin⁡3ω0t3+sin⁡5ω0t5+⋯)

Only odd harmonics appear, and their amplitudes fall as 1/n. The sharp corners need the high harmonics; with only a few, the corners are rounded.

Other shapes:

SignalHarmonicsAmplitudes fall as
sinethe fundamental only
squareodd only1/n
triangleodd only1/n2
sawtoothall1/n

The smoother the signal, the faster its harmonics shrink. A jump needs harmonics falling only as 1/n; a kink (like a triangle's point) needs only 1/n2.

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
  1. Which harmonics. A square wave has only odd harmonics, with amplitudes 4Aπn
  2. The fundamental, at 1 kHz. With A=5 V: 4×5Vπ=6.37V
  3. The 3rd harmonic, at 3 kHz. V3=6.37V3=2.12V
  4. The 5th harmonic, at 5 kHz. V5=6.37V5=1.27V

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
  1. The filter's gain. The filter multiplies each harmonic by 11+(f/fc)2
  2. The fundamental. At f=fc the gain is 1/2: V1=6.37V2=4.50V
  3. The 3rd harmonic. At f=3fc the gain is 1/10: V3=2.12V10=0.671V
  4. Compare. At the input the 3rd harmonic was a third of the fundamental. At the output it's 0.6714.50=0.149 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
  1. Which harmonics. A triangle wave has only odd harmonics, with amplitudes 8π2n2
  2. The fundamental. V1=8π2=0.811V
  3. The 3rd harmonic. It's nine times smaller: V3=89π2=0.090V
  4. Why it falls faster. Its harmonics fall as 1n2, against 1n 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 ±A square wave has odd harmonics 4Aπn.

Step 1

What is the amplitude of harmonic n?

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°.

Explain why

Why does a square wave need high harmonics, when a sine wave needs only one frequency?

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.