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

A10 · Lesson 4 · Power and harmonics

Parseval's theorem, distortion and the Gibbs overshoot

An audio amplifier's datasheet quotes its total harmonic distortion: how much power ends up in harmonics that weren't in the input. A power-quality meter on a factory floor measures the same thing for the mains current. Both rest on one fact: a signal's power is the sum of the powers of its harmonics, as if each one were heating the load on its own. That's Parseval's theorem, and with it you can find the RMS of a square wave, the distortion of a clipped sine, and how many harmonics a filter must pass to keep a signal's shape.

  • The curve adds up the square wave's harmonics through number N. The flat line is the square wave itself.
  • The readout gives the fraction of the square wave's power captured so far.
  • Even with many harmonics the sum overshoots near each jump by about 9%. Does adding harmonics shrink the overshoot, or just squeeze it closer to the jump?

Predict

The fundamental alone carries what fraction of a square wave's power?

Name it

Parseval's theorem

For a periodic signal with complex coefficients cn,

1T∫0T|x(t)|2dt=∑n=−∞∞|cn|2=c02+∑n=1∞An22

where An=2|cn| is the amplitude of harmonic n. Mean-square power is the sum of the harmonics' powers, because the cross terms between different harmonics average to zero. The RMS value is its square root.

Total harmonic distortion

THD=A22+A32+⋯A1

the RMS of everything except the fundamental, relative to the fundamental.

WaveformTHD
sine0
triangleπ4/96−1=12.1%
squareπ2/8−1=48.3%

The Gibbs phenomenon

Wherever a signal jumps, a truncated Fourier series overshoots by about 9% of the jump, however many harmonics you keep. The overshoot narrows toward the jump but doesn't shrink. It's why filtering a square wave sharply makes ringing on its edges, and why S7 shapes filters to roll off gently.

Worked example

Use Parseval's theorem to find ∑odd n1n2.

Show the solution
  1. The power in time. The ±1 square wave has power 1.
  2. The power in its harmonics. They have amplitudes 4πn for odd n, so by Parseval's theorem 1=∑odd n12(4πn)2=8π2∑odd n1n2
  3. Solve for the sum. ∑odd n1n2=π28=1.2337 A fact about numbers, found by measuring a signal's power two ways.

Answer the sum is π28=1.2337.

Worked example

What is the THD of a square wave?

Show the solution
  1. Split the power. The fundamental's power is 8π2 of the total 1, leaving 1−8π2 in the harmonics.
  2. Take the ratio. THD=1−8/π28/π2=π28−1=0.483

Answer the THD of a square wave is 0.483, or 48.3%.

Worked example

A 5 V pulse train with 20% duty. What is its RMS value, and how much of its power is DC?

Show the solution
  1. The mean square. 25V2×0.2=5V2
  2. The RMS value. 5V2=2.24V
  3. The DC part. The DC level is 1 V, contributing 12=1 V² of the 5.
  4. The harmonics. The other 4 V², 80%, is spread over the harmonics. By Parseval's theorem the sum of their squared amplitudes over two must equal exactly 4.

Answer the RMS value is 2.24 V, and DC carries 1 V² of the 5 V²; the other 80% is in the harmonics.

Check

What percent of a square wave's power is in its harmonics 1 through 5?

Check

A signal is 1+3cos⁡(ωt)+2cos⁡(2ωt+30°). What is its RMS value?

Check

An amplifier's output has a fundamental of 10 V and harmonics of 1 V and 0.3 V. What is its THD, in percent?

Check

What percent of the power of a square wave switching between ±5 V is in its fundamental?

Check

A truncated Fourier series of a signal that jumps by 8 V overshoots near the jump. By about how many volts?

Check

Write thd(x) for an array x holding exactly one period of a signal: take np.fft.rfft(x), use bin 1 as the fundamental and bins 2 and up as the harmonics, and return the THD as a fraction.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

A pulse train of 3 V with duty 0.1.

(a)

What is its RMS value?

Write units the way you normally would: 1.5 V, 1500 mV and 0.0015 kV are the same answer.

(b)

How much of its mean square is in the harmonics (everything but DC)?

Check

A signal is acos⁡t+bsin⁡3t.

Step 1

What is its mean square?

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 the power of a signal equal the sum of the powers of its harmonics?

Practice

Keep practicing

9 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.