Skip to content

Fourier series and LTI systems

Send a repeating wave through an RC circuit one harmonic at a time, see why every harmonic is turned down and turned back, and measure the distortion.

Before this6.1 · 7.2 · 5 more
Chapter 7 · Lesson 4 of 4

First, the picture

Here one spinning arrow goes into an RC circuit, the circuit behind a guitar’s tone knob, and then a faster arrow follows it. Make a prediction: does a faster or a slower arrow come out? Watch the output arrow’s spin rate, its length and the angle it falls behind.

A spinning arrow through an RC circuit

RC = 1 s. First 1 rad/s, then 3 rad/s, in slow motion.

An arrow spinning at 1 radian per second goes into the circuit.

Spin rate, in and out
1.0 rad/s
H(jω)
–
0.00 / 8.00 s
Describe this picture

Three panels, “input”, “RC” and “output”, follow an arrow through the circuit, with RC=1RC=1 s; the picture has no control. It plays eight seconds in slow motion with the time scale fixed, 3 s per lap at 1 rad/s, and holds at the end. For the first 4 s the input arrow spins at 1 rad/s; between 3.7 s and 4.5 s it speeds up smoothly to 3 rad/s, one lap per second. The output panel holds a dashed copy of the input arrow, and an arc between the two arrows is labelled with the lag. Two readouts follow the frame: “Spin rate, in and out”, 1.0 rad/s and then 3.0 rad/s, and “H(jω)”, “0.707∠−45.0°” and then “0.316∠−71.6°”.

A spinning arrow through an RC circuit

On the page Fourier series coefficients (7.2) you drew a repeating wave as a row of lines, one for each spinning arrow. This page asks what a system does to that row. The answer is simple: a linear time-invariant (LTI) system treats every arrow separately.

The picture I want you to keep is the tone knob on a guitar. Turning it down does not block any note. Every harmonic of the sound is turned down, and the high ones are turned down most. The circuit behind that knob is an RC circuit, so I use the one from Differential equations and analog systems (6.2). It is the continuous-time twin of the leaky integrator in Difference equations (6.1).

That page wrote the circuit as RC v˙+v=vsRC\,\dot v+v=v_s, where vsv_s is the source and vv is the voltage across the capacitor. Here I rename the source as the input xx and the voltage as the output yy, so the equation is

RC y˙+y=x.RC\,\dot y+y=x .

Now feed in one spinning arrow, x(t)=ejωtx(t)=e^{j\omega t}, as on the page Complex exponentials & phasors (3.4). Try an output that is the same arrow times one fixed complex number HH, so y(t)=Hejωty(t)=He^{j\omega t}. The rule from 6.2, ddtest=s est\tfrac{d}{dt}e^{st}=s\,e^{st}, with s=jωs=j\omega gives y˙=jω Hejωt\dot y=j\omega\,He^{j\omega t}.

Put both into the equation and cancel the common factor ejωte^{j\omega t}:

RC jω H+H=1,soH(jω)=11+jωRC.RC\,j\omega\,H+H=1 ,\qquad\text{so}\qquad H(j\omega)=\frac{1}{1+j\omega RC}.

The guess works, so the circuit answers an arrow with the same arrow, scaled and turned by the number H(jω)H(j\omega). That is the property from Properties of LTI systems (5.4), now for a continuous-time system. One condition: this is the answer after the start-up part of 6.2, the natural part that decays, has died away.

What is 1/(1+jωRC)1/(1+j\omega RC) as an arrow? On the page Complex numbers for signals (3.3), multiplying multiplies the lengths and adds the angles. Dividing undoes that. So 1/z1/z has length 1/∣z∣1/\lvert z\rvert and angle −∠z-\angle z: you divide the lengths and subtract the angles.

Take z=1+jz=1+j, one step across and one step up. Its length is ∣1+j∣=12+12=2\lvert1+j\rvert=\sqrt{1^2+1^2}=\sqrt2 and its angle is 45°45°. So

11+j=0.707∠−45°,\frac{1}{1+j}=0.707\angle-45° ,

an arrow 0.7070.707 as long as the unit arrow, turned back by 45°45°.

For RC=1RC=1 s and an arrow spinning at ω\omega rad/s, H=1/(1+jω)H=1/(1+j\omega). Its length, the gain ∣H∣\lvert H\rvert, is 1/1+ω21/\sqrt{1+\omega^2}. Its angle is −arctan⁡ω-\arctan\omega, and I call the amount turned back, −∠H-\angle H, the lag.

Now go back to the picture at the top of the page. At 1 rad/s the arrow comes out spinning at the same rate, 0.7070.707 as long and 45.0°45.0° behind: the example you just divided out. Then the input speeds up to 3 rad/s, and the output speeds up with it. The faster arrow comes out 0.3160.316 as long and 71.6°71.6° behind. This is 1/(1+3j)1/(1+3j): ∣1+3j∣=10=3.162\lvert1+3j\rvert=\sqrt{10}=3.162, so the length is 0.3160.316, and the angle −arctan⁡3=−71.6°-\arctan3=-71.6°.

So the answer to the prediction is neither. The output spins at the same rate as the input. Only its length and its angle change, and the faster input is cut more and lags more.

One more fact, so that real waves work. The equation RC y˙+y=xRC\,\dot y+y=x has real coefficients. A cosine is the horizontal position of the arrow, as in 7.2, so the response to cos⁡ωt\cos\omega t is the horizontal position of the response to the arrow. From here on I read all arrows that way.

A square wave, one arrow at a time

Now a repeating input. Take the square wave between −1-1 and +1+1 with fundamental ω0=1\omega_0=1 rad/s, and keep RC=1RC=1 s. From Fourier series coefficients (7.2) and 7.1, its first four arrows have lengths bk=4/(πk)b_k=4/(\pi k) for k=1,3,5,7k=1,3,5,7. Each starts pointing down, at −90°-90°, because the harmonics of this wave are sines.

The system is linear, so the output is the sum of what each arrow produces on its own. Each arrow comes out as H(jkω0)H(jk\omega_0) times itself. For RC=1RC=1 s, H(jk)=1/(1+jk)H(jk)=1/(1+jk) has gain 1/1+k21/\sqrt{1+k^2} and lag arctan⁡k\arctan k. For k=1,3,5,7k=1,3,5,7 the gains are 0.7071, 0.3162, 0.1961, 0.14140.7071,\ 0.3162,\ 0.1961,\ 0.1414 and the lags are 45.0°, 71.6°, 78.7°, 81.9°45.0°,\ 71.6°,\ 78.7°,\ 81.9°.

Watch each arrow come out of the box shorter and turned, and then the shape of the output wave.

A square wave through the box, harmonic by harmonic

The square wave at 1 rad/s as arrows 1, 3, 5 and 7; RC = 1 s.

A square wave is four arrows (and more). Each goes through the circuit on its own.

0.00 / 12.00 s
Describe this picture

The square wave’s four arrows are the input, and the box between input and output is labelled “RC”; the picture has no control. Each input arrow goes through the box in turn, 2.5 s each, and comes out shorter and rotated. Each row is labelled “k = 1” and so on, with the input length, the output length and the lag, for example 1.2732, 0.9003 and “45.0° back” for k=1k=1. Each harmonic has its own colour on both sides. From 10 s the output wave is drawn over a faint dashed copy of the input, and at 12 s the lags are listed in the harmonics’ colours: 45.0°, 71.6°, 78.7°, 81.9°45.0°,\ 71.6°,\ 78.7°,\ 81.9°.

Arrow 3, for example, goes from 0.42440.4244 to 0.13420.1342: it is 0.31620.3162 as long and held back 71.6°71.6°. The output wave at the end is the sum of every arrow that came out, these four and the smaller ones after them. It is the circuit’s exact response, so it includes every harmonic, not only the four drawn. It is smooth, delayed and has rounded corners. Each harmonic is held back by its own angle, not in proportion to kk, so the shape changes, not just the size.

Compare this with a plain delay. If the circuit only delayed the wave, Fourier series coefficients (7.2) says line kk would turn by kk times the first angle. A delay of 0.7850.785 s turns line 1 by 45°45° at ω0=1\omega_0=1 rad/s, so the lines would turn by 45°, 135°, 225°, 315°45°,\ 135°,\ 225°,\ 315°. The RC turns them by 45°, 71.6°, 78.7°, 81.9°45°,\ 71.6°,\ 78.7°,\ 81.9°. The harmonics slip against each other, and that is why the corners round off.

Write the whole recipe in one line. If x(t)=∑kckejkω0tx(t)=\sum_k c_ke^{jk\omega_0t}, then

y(t)=∑k=−∞∞H(jkω0) ck ejkω0t.y(t)=\sum_{k=-\infty}^{\infty}H(jk\omega_0)\,c_k\,e^{jk\omega_0t}.

The line ckc_k becomes H(jkω0) ckH(jk\omega_0)\,c_k, and nothing else changes. The arrow at −kω0-k\omega_0 gets H(−jkω0)=H∗(jkω0)H(-jk\omega_0)=H^*(jk\omega_0), the mirror image of the arrow at kω0k\omega_0, because the circuit is real. So the output is still a mirror pair, and still a real wave.

The same line shows something else. Every arrow comes out at the spin rate it went in with, so no arrow is created. An LTI system never adds a frequency that was not in its input. I come back to that in the worked example.

The maths behind it · diagonalising an LTI system

The Fourier series diagonalises every LTI system. Change basis to the harmonics, multiply each coordinate by its own eigenvalue H(jkω0)H(jk\omega_0), and change back. In discrete time the same statement is that the DFT matrix diagonalises circulant matrices, on the page The DFT as a matrix (13.5).

Turning the highs down: the tone knob

The gain ∣H(jk)∣=1/1+(kω0RC)2\lvert H(jk)\rvert=1/\sqrt{1+(k\omega_0RC)^2} is a smooth slope across the harmonics. The corner frequency ωc=1/RC\omega_c=1/RC is where it reads 0.7070.707. You met that number in the first clip: at ω=1\omega=1 rad/s with RC=1RC=1 s, the gain was 0.7070.707 and the lag 45°45°.

A large RCRC puts the corner at a low frequency, so more of the harmonics are above it. The next instrument slides RCRC upward from 0.050.05 s to 33 s, so the corner slides from 2020 rad/s down to 0.330.33 rad/s. Watch the slope pass under the bars, and the output wave lose its corners.

The tone knob

The square wave through an RC low-pass while RC rises from 0.05 s to 3 s.

A tiny RC: every bar is turned down a little, the high ones a bit more. The wave is almost unchanged.

RC
0.05 s
Corner
20.00 rad/s
Gain at each bar
1 rad/s0.999
3 rad/s0.989
5 rad/s0.970
7 rad/s0.944
0.00 / 10.00 s
Describe this picture

Two panels share one horizontal axis, frequency from 0 to 8 rad/s. The upper panel holds the bars for the harmonics at 1,3,5,71,3,5,7 rad/s, arrow length from 0 to 1.3, with the input bars faint and the output bars in front. The lower panel holds the gain curve, from 0 to 1, with a dashed level at 0.7070.707 and a dot at the corner labelled with its frequency, such as “corner 2.58 rad/s”. A faint vertical line joins each bar to the gain it is multiplied by, and the output wave is drawn beside them. The clip is one continuous slide of 10 s, then it holds, with RC=0.05⋅60t/10RC=0.05\cdot60^{t/10} s. At the start the corner is off the edge of the frame, and a small arrow reads “corner: 20 rad/s →”, a number that falls as RCRC rises; the dot enters when the corner reaches 8 rad/s, at RC=0.125RC=0.125 s, about 2.24 s into the clip. The readouts “RC” and “Corner” follow the slide, and chips “Gain at each bar” give the four gains. When the clip has finished, the corner dot can be dragged along the gain curve, or moved with the arrow keys, to set RCRC between 0.1250.125 s and 33 s; the bars, the chips and the caption follow it. A button “Hear the output” plays the result.

With a tiny RCRC of 0.050.05 s every bar is turned down a little, the high ones a bit more. The gains are 0.999, 0.989, 0.970, 0.9440.999,\ 0.989,\ 0.970,\ 0.944, and the wave is almost unchanged. At 5 s, RC=0.39RC=0.39 s, the gains are 0.933, 0.652, 0.459, 0.3460.933,\ 0.652,\ 0.459,\ 0.346, and the corners of the wave are rounded: the higher the bar, the more it is turned down.

At 10 s, RC=3RC=3 s, every bar is far down the slope. The gains are 0.316, 0.110, 0.067, 0.0480.316,\ 0.110,\ 0.067,\ 0.048. The output is a rounded triangle, close to a single sine of amplitude 0.40260.4026 lagging 71.6°71.6° with pointed tops: the third harmonic is 0.04690.0469, about 11.6%11.6\% of the first. Nothing is blocked. Every harmonic is turned down, the high ones far more.

Watch the slope, and not a wall. Nothing is blocked at any setting. The first bar at RC=3RC=3 s is 0.3160.316 of its input and the seventh is 0.0480.048, so the seventh is turned down about 6.66.6 times as hard. Smoothing a square wave means turning the high harmonics down more than the low ones, until what is left is nearly the first sine.

When the clip has finished, drag the corner dot along the gain curve to set RCRC yourself, and press Hear the output to hear the result.

Distortion as a number

Use the buttons “Hear the input” and “Hear the output”. The output is duller. They are not controls: they play what is on screen. Now ask what numbers would say that.

Engineers use the total harmonic distortion, THD. It compares the size of everything beyond the first harmonic with the size of the first. A pure sine has no harmonic beyond the first, so its THD is 0.

The page How big is a signal (1.3) defined the RMS, the square root of the power. Powers of different harmonics add, by Parseval’s relation in 7.2, and sizes do not. So I compare powers first, with Pk=Ak2/2P_k=A_k^2/2 for an arrow of length AkA_k, and take the square root last:

THD=∑k≥2PkP1.\mathrm{THD}=\sqrt{\frac{\sum_{k\ge2}P_k}{P_1}} .

The square root turns the ratio of powers into a ratio of sizes. It is usually quoted as a percentage.

The next instrument stacks the power in the first harmonic under the power in all the others, for the input and for the output. Watch the top block shrink faster than the bottom one as the filter engages.

Distortion as a number

Power in the first harmonic and in all the others, before and after the RC (RC rises to 1 s).

The square wave: 81% of its power in the first arrow, the rest in the others. Ratio 0.2337; its square root, 0.4834, is the THD: 48.3%.

0.00 / 6.00 s
Describe this picture

Two stacked bars, one for the input and one for the output, on a power axis from 0 to 1. In each, a bottom block labelled “first” is the power in the fundamental and a top block labelled “others” is the power in everything else, at their true sizes. Under each bar a three-line readout gives the ratio, its square root and the THD, for example “top ÷ bottom = 0.2337”, ”↓ square root = 0.4834” and “THD 48.3%”. For 6 s the box between the bars engages, showing RCRC as it rises from 0 to 1 s.

The square wave has 81 % of its power in the first arrow and the rest in the others. With no filter the input blocks are 0.81060.8106 and 0.18940.1894, because the wave’s total power is 1. The ratio is 0.23370.2337 and its square root is 0.48340.4834, so the THD is 48.3%48.3\%.

At 3 s, RC=0.5RC=0.5 s, the output blocks are 0.64850.6485 and 0.03440.0344. The ratio is 0.053080.05308, the square root 0.23040.2304, and the THD 23.0%23.0\%. At 6 s, RC=1RC=1 s, the output blocks are 0.40530.4053 and 0.01080.0108. The ratio is 0.026740.02674, the square root 0.16350.1635, and the THD is 16.4%16.4\%, against 48.3%48.3\% for the input. The upper harmonics were turned down far more than the first, so the THD fell.

Why it falls is the gain squared. At RC=1RC=1 s the first harmonic’s power is multiplied by ∣H(j)∣2=0.5\lvert H(j)\rvert^2=0.5, and the third harmonic’s by 0.10.1. The first block halves, while the top block, which holds the third harmonic and everything above it, falls to about 6%6\% of its input size.

The maths behind it · variances of uncorrelated parts

THD and its relatives are ratios of variances of uncorrelated components, here the harmonics. A filter reduces the total variance by the squared gain of each component. The page Power spectral density (24.4) does this for random signals.

Worked example

  1. H(jk)H(jk) for RC=1RC=1 s and ω0=1\omega_0=1 rad/s. H(jk)=1/(1+jk)H(jk)=1/(1+jk). Dividing: ∣1+jk∣=1+k2\lvert1+jk\rvert=\sqrt{1+k^2} and ∠(1+jk)=arctan⁡k\angle(1+jk)=\arctan k, so H(jk)H(jk) has length 1/1+k21/\sqrt{1+k^2} and angle −arctan⁡k-\arctan k. For k=1k=1, ∣1+j∣=2\lvert1+j\rvert=\sqrt2, so H=0.7071∠−45.00°H=0.7071\angle-45.00° (−π/4-\pi/4 rad). For k=3,5,7k=3,5,7: 0.3162∠−71.57°0.3162\angle-71.57°, 0.1961∠−78.69°0.1961\angle-78.69°, 0.1414∠−81.87°0.1414\angle-81.87°. A plain delay of 0.7850.785 s would give −45°, −135°, −225°, −315°-45°,\ -135°,\ -225°,\ -315°. The RC’s lags, expressed as times, are 0.785, 0.416, 0.275, 0.2040.785,\ 0.416,\ 0.275,\ 0.204 s.
  2. The output arrows. The lengths are bk∣H∣b_k\lvert H\rvert with bk=4/(πk)b_k=4/(\pi k): 0.9003, 0.1342, 0.0499, 0.02570.9003,\ 0.1342,\ 0.0499,\ 0.0257. So y(t)≈0.9003sin⁡(t−45°)+0.1342sin⁡(3t−71.57°)+0.0499sin⁡(5t−78.69°)+0.0257sin⁡(7t−81.87°).y(t)\approx0.9003\sin(t-45°)+0.1342\sin(3t-71.57°)+0.0499\sin(5t-78.69°)+0.0257\sin(7t-81.87°).
  3. THD. For the input, the fundamental carries 8/π2=0.81068/\pi^2=0.8106 and the rest carry 1−0.8106=0.18941-0.8106=0.1894, since the total is 11 (x2=1x^2=1). The ratio is 0.23370.2337 and THD=0.2337=0.4834\mathrm{THD}=\sqrt{0.2337}=0.4834. For the output at RC=1RC=1 s, harmonic kk carries 8π2k2(1+k2)\dfrac{8}{\pi^2k^2(1+k^2)}. The fundamental carries 4/π2=0.40534/\pi^2=0.4053 and the rest carry 0.01080.0108. The ratio is 0.026740.02674 and THD=0.1635\mathrm{THD}=0.1635. At RC=0.5RC=0.5 s the fundamental carries 0.8106/1.25=0.64850.8106/1.25=0.6485, the rest 0.03440.0344, the ratio is 0.053080.05308 and THD=0.2304\mathrm{THD}=0.2304.
  4. Smoothing hard, RC=3RC=3 s. ∣H(jk)∣=1/1+9k2\lvert H(jk)\rvert=1/\sqrt{1+9k^2} gives 0.3162, 0.1104, 0.0665, 0.04760.3162,\ 0.1104,\ 0.0665,\ 0.0476 for k=1,3,5,7k=1,3,5,7. The first harmonic has amplitude 1.2732×0.3162=0.40261.2732\times0.3162=0.4026 at −arctan⁡3=−71.57°-\arctan3=-71.57°. The third has amplitude 0.4244×0.1104=0.04690.4244\times0.1104=0.0469, about 11.6%11.6\% of the first. At RC=0.387RC=0.387 s the gains are 0.9325, 0.6523, 0.4588, 0.34610.9325,\ 0.6523,\ 0.4588,\ 0.3461, and at RC=0.05RC=0.05 s they are 0.9988, 0.9889, 0.9701, 0.94390.9988,\ 0.9889,\ 0.9701,\ 0.9439.
  5. No new frequencies. At RC=3RC=3 s the first harmonic is multiplied by 0.3160.316 and the seventh by 0.0480.048. Both are turned down, the seventh about 6.66.6 times as hard, and neither is blocked. A repeating input with lines at 100, 300 and 500 Hz gives an LTI output with lines at 100, 300 and 500 Hz only, possibly smaller and possibly turned. So a clipper that turns a pure sine into a sine plus a third harmonic is not LTI.

Where you’ll meet this

An audio equaliser, a tone knob and a loudspeaker’s crossover all work this way: each harmonic is scaled and turned by the system’s value at its frequency. The distortion figure on an amplifier’s datasheet is the number of the last section, usually quoted as a percentage.

The next step is to look at H(jω)H(j\omega) for every frequency, not only at the harmonics, which is the subject of Frequency response and Bode plots (8.4). Letting the period grow without limit, so that the lines crowd into a curve, is the subject of the page From series to transform (8.1). Why a real system’s HH satisfies H(−jω)=H∗(jω)H(-j\omega)=H^*(j\omega), and why its poles come in mirror pairs, is on the pages First- and second-order systems (6.3) and Poles, zeros and the s-plane (9.3). Real filters are chosen and built on the pages Filter specifications (18.1) and Analog prototype filters (20.1). The square wave’s sum of arrows, and the overshoot that stays near its edges, are on the page Convergence and the Gibbs phenomenon (7.3).

Reference card

QuantityFormulaNotes
Eigenfunctionejωt→H(jω) ejωte^{j\omega t}\to H(j\omega)\,e^{j\omega t}LTI only; same spin rate in and out
Dividing complex numbers1z\dfrac1z: length 1∣z∣\dfrac1{\lvert z\rvert}, angle −∠z-\angle z1/(1+j)=0.707∠−45°1/(1+j)=0.707\angle-45°
RC low-passH(jω)=11+jωRCH(j\omega)=\dfrac1{1+j\omega RC}∣H∣=1/1+(ωRC)2\lvert H\rvert=1/\sqrt{1+(\omega RC)^2}, ∠H=−arctan⁡(ωRC)\angle H=-\arctan(\omega RC)
Corner frequencyωc=1/RC\omega_c=1/RC∣H∣=0.707\lvert H\rvert=0.707, lag 45°45° there
Periodic in, periodic outy(t)=∑kH(jkω0) ck ejkω0ty(t)=\sum_kH(jk\omega_0)\,c_k\,e^{jk\omega_0t}same period, no new frequencies
Real systemH(−jω)=H∗(jω)H(-j\omega)=H^*(j\omega)so the output is real: the mirror pair again
THD∑k≥2Pk/P1\sqrt{\sum_{k\ge2}P_k\big/P_1}, Pk=Ak2/2P_k=A_k^2/2power ratio, then the square root; quoted as a percentage

End of lesson 7.4

Where to go next.

Phasorium
LibraryEvery lesson, in order

Parts

About Phasorium
Look