MathematicsGrade 13 · University

Fourier series

Square, sawtooth and other waves are built from many sine waves. You can also listen to them.

Loading simulation …

What is it about?

A 2π2\pi-periodic function can be written as a Fourier series f(x)≈a02+∑k=1N(akcos⁡kx+bksin⁡kx)f(x) \approx \frac{a_0}{2} + \sum_{k=1}^{N}(a_k \cos kx + b_k \sin kx). Writing each term as A^ksin⁡(kx+φk)\hat A_k \sin(kx + \varphi_k) gives the amplitude spectrum A^k=ak2+bk2\hat A_k = \sqrt{a_k^2 + b_k^2} and the phase spectrum φk\varphi_k. The square wave is 4π(sin⁡x+13sin⁡3x+15sin⁡5x+…)\frac{4}{\pi}(\sin x + \frac13 \sin 3x + \frac15 \sin 5x + \ldots).

  • Phasors: each term is a phasor of length A^k\hat A_k turning kk times as fast as the fundamental; chained together, the height of the tip draws SNS_N.
  • Symmetry: odd functions have sine terms only, even functions cosine terms only; if f(x+π)=−f(x)f(x + \pi) = -f(x), all even kk vanish.
  • Jumps vs. kinks: with jumps the amplitudes fall like 1k\frac1k, with kinks like 1k2\frac{1}{k^2}.
  • Gibbs phenomenon: at a jump the partial sums overshoot by about 9 %9\,\% of the jump (square wave: 1.1791.179), however large NN is. Fejér factors σk=1−kN+1\sigma_k = 1 - \frac{k}{N+1} remove the overshoot.
  • Parseval: P=12π∫f2 dx=(a02)2+12∑(ak2+bk2)P = \frac{1}{2\pi}\int f^2\,dx = (\frac{a_0}{2})^2 + \frac12 \sum (a_k^2 + b_k^2). The fundamental of the square wave carries 8π2≈81.06 %\frac{8}{\pi^2} \approx 81.06\,\% of the power.

Try it

  1. Square wave: press “Add a harmonic” several times, then “Play the build-up”.
  2. Phasors draw a square wave and stacked harmonics.
  3. Gibbs phenomenon versus Fejér smoothing.
  4. Clarinet versus flute – compare spectra and listen.
  5. LED dimmer: change the duty cycle dd.

Tasks

Task 1: Symmetry

Why does the square wave series contain only sines and the triangle series only cosines? What happens if the square wave is shifted by 90°90°?

Show solution

The square wave is odd (ak=0a_k = 0), the triangle is even (bk=0b_k = 0). Shifted by π2\frac{\pi}{2} the square wave becomes even: cosine terms only, same amplitudes. Show

Task 2: Parseval

What share of the power of the square wave is contained in S1S_1 and in S3S_3? From which NN on is it at least 95 %95\,\%? Load task

Show solution

S1S_1: 8π2≈81.06 %\frac{8}{\pi^2} \approx 81.06\,\%; S3S_3: 8π2(1+19)≈90.06 %\frac{8}{\pi^2}(1 + \frac19) \approx 90.06\,\%; S7S_7: 94.96 %94.96\,\%; S9S_9: 95.96 %95.96\,\% – so from N=9N = 9 on. Show

Task 3: LED dimmer

A pulse train (height 11, duty cycle d=25 %d = 25\,\%) drives an LED. Find the DC part and the first four amplitudes. Which one is missing?

Show solution

DC part d=0.25d = 0.25; A^k=2∣sin⁡(πkd)∣πk\hat A_k = \frac{2|\sin(\pi k d)|}{\pi k}: 0.4500.450, 0.3180.318, 0.1500.150 and A^4=0\hat A_4 = 0 (every fourth harmonic vanishes). Show

Task 4: Full-wave rectifier

Mains at 50 Hz50\,\text{Hz} gives ∣sin⁡x∣|\sin x| after the rectifier. Find the mean and the second harmonic (first overtone, k=2k = 2). At which frequency does the power supply hum?

Show solution

Mean 2π≈0.637\frac{2}{\pi} \approx 0.637; only even kk: a2=−43π≈−0.424a_2 = -\frac{4}{3\pi} \approx -0.424 at 100 Hz100\,\text{Hz}. Show

Ideas for the classroom

  • Start with “Play the build-up”, then add the values by hand in the stacked view; with “Values in the picture” off (info=0) the pictures work as exercises.
  • Link to acoustics (timbre of clarinet, violin, flute) and electronics (rectifier, pulse-width modulation).
  • Common stumbling blocks: the constant term is a02\frac{a_0}{2}; expecting the Gibbs overshoot to vanish; a shift changes only the phases, not the amplitudes.