A wave that is 1 for half of each period and 0 for the rest, wound around a circle. Watch the dot: the average position of the wound-up curve.
Wind the wave, find its balance point
Six winding settings, one after another; then the wave is lifted.
Winding setting 1: every point is turned back one lap per period.
Describe this picture
Three parts: the wave; the wound-up curve on the complex plane, with a dot at the average position of the part drawn so far; and a strip of bars named ”: half an arrow’s length”, with an “average” slot 0 and slots 1 to 5. The clip plays the winding settings in the order , two and a half seconds each, and after each setting stamps a bar on the strip: the average in slot 0 and in slots 1 to 5. From 15 s it shows setting 0 again and lifts the wave by 0.5. The step buttons |◀ and ▶| jump from one setting to the next. The finished frame shows setting 0 on the lifted wave; then dragging along the bars, or the arrow keys, Home and End, pick any setting from 0 to 5, and the caption describes the lifted wave. The readouts are “Winding setting” and “Balance point”, the dot as a complex number.
From arrows to a formula
On the page Signals as sums of sinusoids (7.1) you saw that a repeating wave is a sum of spinning arrows. You also saw that one arrow can be measured alone: multiply the wave by that arrow’s harmonic, average, and double. This page turns that trick into a formula that works for any repeating wave.
The formula comes in three forms, and an exam may ask for any of them. I will show that they describe the same wave. Then I will draw the answer as a row of lines, and use symmetry to know in advance which lines are empty.
The wave I use throughout is a 0-to-1 square wave. It is 1 for the first half of each period and 0 for the second half. I chose it, and not 7.1’s wave between and , because it has a constant part, and I want that part to have something to show. It equals plus half of 7.1’s wave, so you already know most of its arrows.
There is one change of reading from 7.1. There I followed the height of an arrow’s tip, so a sine started at height 0. From here on I follow the horizontal position of the tip, as on the page Complex exponentials & phasors (3.4).
A cosine is then an arrow that starts pointing right. A sine is a cosine delayed by a quarter turn, as in Sinusoids (3.2), so it is an arrow that starts pointing down.
Winding the wave up
Here is 7.1’s trick, rewritten with complex numbers. To measure harmonic , multiply the wave by the arrow and average. Here is the fundamental, and is the angle it has turned by time .
Multiplying by a point on the unit circle only rotates, as on the page Complex numbers for signals (3.3). So at every instant this turns the wave’s value back by . I call that winding the wave at setting .
The wave’s value is a point on the real axis of the complex plane. Where the wave is 1, the wound-up point rides the unit circle. Where the wave is 0, it stays at the origin. The average of where this point has been is a complex number, and I call it .
Go back to the picture at the top of the page. While the curve is drawn, the dot is the average position of the part drawn so far, so it moves. When the curve is complete, the dot is , the curve’s balance point. At setting 1 the curve leans to one side, and the dot settles from the centre. At setting 2 the curve closes into a full circle, and the dot sits at the centre.
Setting 0 is no winding at all, so the dot is the average of the wave itself, which is 0.5. At the end the clip lifts the wave by 0.5, which raises every value of the wave by 0.5. The dot slides from 0.5 to 1.0, and only the bar in the “average” slot moves.
When the clip has finished, drag along the bars to pick any setting from 0 to 5. Settings 2 and 4 put the dot at the centre. Odd settings lean it to one side, and the dot is nearer the centre for larger settings.
The strip says “half an arrow’s length” for a reason. In 7.1 a real wave needs one arrow for each harmonic. On the page Complex exponentials & phasors (3.4) that arrow is really two, spinning in opposite directions at and , and each is half as long. The winding at setting measures one of the two. For the 0-to-1 wave, 7.1’s arrow 1 is long and the bar for setting 1 is . The next section draws the pair.
Now the formula. Averaging a complex quantity means averaging its real parts and its imaginary parts separately, as when you add points in Complex numbers for signals (3.3). Written with the area from to divided by , as in 7.1,
This is the analysis equation. Any one period gives the same answer for a repeating wave, so I use to unless another period is easier, as in step 4 of the worked example.
Why does the winding find harmonic and nothing else? Suppose the wave is a sum of arrows, , with running over all whole numbers, positive and negative. Multiply by . The term for harmonic becomes , an arrow that turns laps per period.
For , that arrow keeps turning, and its average is zero. For the arrow stands still and survives with the value . The zero comes from one line of calculus: for a constant that may be complex, . With and ,
because , so . This is the same cancellation as in 7.1, now for any pair of harmonics. It also gives the other half of the pair of equations, the synthesis equation:
Let’s use the analysis equation on the running wave, which is 1 on and 0 after that. For nothing winds, and is the average of the wave, which is . For ,
For even , and , which is the circle that closes. For odd , , so , since . That gives , and , the bars of the instrument.
Watch out
is the average of the wave over a period. It is not the value of the wave at . Lifting the whole wave by adds to and changes no other , because a constant has no turning part to average.
One harmonic, three ways to write it
Each harmonic with is a real wave at . You can write it in three ways, and the picture below shows that they are one wave. I use the example from the page Complex exponentials & phasors (3.4): .
Watch the traced wave. It never changes, while the description of it does.
Two arrows, one arrow, a mirror pair
Three ways to write 3 cos θ + 4 sin θ. The traced wave never changes.
Two arrows: 3 cos θ, and 4 sin θ, which starts pointing down.
Describe this picture
Arrows on the complex plane and the wave they trace, with three rows appearing below the figure one after another: “Two arrows (trigonometric)”, “One arrow (compact)” and “Mirror pair (complex)”. First there are two arrows, a length-3 arrow pointing right for the cosine and a length-4 arrow pointing down for the sine, and they spin one lap together. The second arrow then moves until its tail sits on the first arrow’s tip, and the two make one arrow of length 5. At 8 s that arrow splits into two arrows of length 2.5, which spin one lap in opposite directions. The rows end with and .
The two arrows, 3 and 4, join into one arrow of length 5, and that arrow splits into a mirror pair of arrows 2.5 long, spinning in opposite directions.
The three forms are these. In the trigonometric form, a harmonic is . In the compact form, it is one shifted cosine, . In the complex form, it is a mirror pair of arrows, . On this page and are Fourier coefficients; on the page Difference equations (6.1) the same letters name filter coefficients, which are a different thing.
The two arrows of the complex form are mirror images of each other. For a real wave, the analysis equation gives
since is real and conjugating the integrand turns into . Here is the mirror image of from Complex numbers for signals (3.3). The pair adds to , which is real.
Now put into that pair. Multiplying out gives . So
Here is the angle of the point , in the range , as the readouts use and as on the page Complex numbers for signals (3.3). The minus sign appears because the arrow that starts pointing down is a sine with a positive . The constant is . Some books write for the constant, with .
For we have and . Then , so and ( rad). The arrow lengths of 7.1 are , which is here. That is why the bars of the first instrument were half an arrow: each real arrow is the sum of two halves.
For the 0-to-1 wave, is purely imaginary. So and for odd , which is 0.6366, 0.2122 and 0.1273 for . These are half of 7.1’s lengths for the wave between and , as they should be.
The line spectrum, and what a delay does
Plot the length and the angle against , for negative and positive alike. The result is a row of lines, the line spectrum of the wave. For the 0-to-1 wave the line at has length . The odd lines have length , and their angles are for and for , as the mirror rule requires.
Now delay the wave by a time , as on the page Shifting, reversing and scaling time (2.1). The notes of a recording played a moment later are the same notes at the same loudness. So what happens to the lines?
Put in the analysis equation. The delayed wave has the coefficient
The length of every line is unchanged. Line turns by the angle , which is times as far as line 1. Before you watch, decide: if the whole wave moves later by , does every line turn by the same angle?
Press play and watch the dial under each line as the wave moves later, first by , then by .
The square wave delayed by a quarter period
Line lengths, and a dial for each line’s angle.
No delay yet. Lines 1, 3 and 5 all point at −90°.
Angles are given between −180° and 180°; −180° and 180° point the same way.
Describe this picture
The 0-to-1 wave with its harmonics 1 and 3 (the key reads “wave, harmonic 1, harmonic 3”), the lines of its spectrum, and a dial under each line showing its angle. The readouts are “Delay”, “Angle of line 1”, “Angle of line 3” and “Angle of line 5”; at first all three angles read . The wave moves later in two steps, to at about 3.5 s and to at 7 s. Each angle readout also shows how far its dial has turned, and angles are given between and , so when a dial turns past , its reading jumps to the other end of that range.
At first every angle reads . The dial for line 3 turns three times as far as the dial for line 1, and line 5 turns five times as far. The answer to the question is no: one time shift is a different angle on every line. The readouts give angles between and .
At a delay of the angle step is . So line 1 reads . Line 3 is at , which the readout shows as . Line 5 is at , shown as . At the turns are , and , and the lines read , and .
Line 0 never moves. Its length stays and its angle stays . But the wave near does change. At first it jumps from 0 to 1 at , so just after it is 1. After the delay of it is 0 there. So the line at is the average, not the value of the wave at .
Symmetry tells you what is zero
You can often tell that whole families of coefficients are zero without computing any integral. The reason is this: a cosine is even and a sine is odd. These words are from Kinds of signals (1.2): a wave is even if its mirror image about lies exactly on it, and odd if the mirror image is the wave turned upside down.
Take the mirrored copy of a wave, . It leaves every cosine term as it was and flips every sine term. So if the copy equals the wave, no sine term can be present, because each would have to equal its own negative. If the copy is the wave turned upside down, no cosine term can be present, including the constant.
There is a third kind of symmetry. A wave has half-wave symmetry if its second half is its first half turned upside down: .
Advance the wave by and use the delay rule from the last section with . Each coefficient is multiplied by , so odd flips and even stays. Half-wave symmetry says the advanced wave is , so , and every even is zero.
Even and odd depend on where you place , as in Decomposing signals (2.3).
Here are three tests, one after another. The bars are signed arrow lengths, as in 7.1: each bar for is , and is . A dashed bar marked ”?” could be anything. Press play and watch the dashed bars.
Three copies that fit onto the wave
When a moved copy fits exactly onto the wave, a whole family of bars is zero.
A wave, and every bar it could have.
Describe this picture
A wave and a moved copy of it (the key names the “wave” and its “copy”), above two strips of bars, ” (cosine)” and ” (sine)”. A bar that has been decided to be zero shows “0”. Three tests run one after another, each for four seconds. First, an even triangle is mirrored across the vertical axis and fits onto itself; the sine bars change to “0”, the cosine bars at odd settle at , and , and the even- bars keep their ”?”. Next, the 0-to-1 wave loses its constant part: the bar shrinks to “0”, leaving an odd wave between and . From about 5.7 s a copy turned over both axes fits onto it; the cosine bars become “0” and the sine bars at odd settle at , and . In the last four seconds, the triangle is slid by half a period and turned upside down, fits onto itself, and the even bars change from ”?” to “0”.
First, an even triangle is mirrored across the vertical axis and fits onto itself, so every sine bar is “0”. The even- bars keep their ”?”, because mirror symmetry says nothing about them.
Next, the 0-to-1 wave first loses its constant part, and what remains is an odd wave between and . A copy turned over both axes fits onto it, so no cosine bars remain.
Last, the triangle is slid by half a period and turned upside down, and it fits onto itself. Now the even bars change from ”?” to “0”. For the triangle only the odd cosine bars survive. The odd wave of the second part passes the same test, so only its odd sine bars survive.
Moving the origin matters too. The delay of in the last section turned lines 1, 3 and 5 to , and . Those lines point along the real axis, so those are real numbers, and . The delayed wave has no sine terms. It is even, although the original was not.
Where the power goes
The last quantity is power. As on the page How big is a signal (1.3), the power of a wave is the average of .
Write with , and average. The cross terms between different harmonics spin and average to zero, as before. Only the terms with the same harmonic survive, and each contributes :
This is Parseval’s relation. For a real wave, lines and carry the same power. Together they give , which is 7.1’s fact that averages to for an arrow of length . The total is .
I will check it on the wave between and , because its square is 1 at every instant and so its power is exactly 1. Fill a tank with one layer per arrow: the arrow for harmonic adds , and only odd have one. Watch “Power so far” climb towards 1.
Filling the power tank
The ±1 square wave; one layer per arrow.
The square wave's average power is 1: its square is 1 all the time.
Describe this picture
The ±1 square wave with the sum of the arrows so far, and a tank labelled “power” with a level marked “1: the mean of x²”. A new arrow adds its layer about every 1.2 seconds, and the readouts “Arrows” and “Power so far” follow. The clip holds for a moment at four arrows, from 4.8 s, where the level is , and again at eight arrows, from 10.5 s, where it is . A list under the picture gives the power of each arrow.
The first arrow alone fills , which is of the total. Four arrows reach and eight reach . Each later arrow adds a thinner layer, so the level rises more slowly towards 1.
I do not sum the infinite series here. The total of 1 comes straight from . The small gap that remains after a given number of arrows is the subject of the page Convergence and the Gibbs phenomenon (7.3). The wave panel of this instrument shows the sum of the arrows overshooting near each jump. That overshoot is explained there too.
For the 0-to-1 wave, , so its power is its average, . The constant part carries of that total, which is half.
The maths behind it · orthogonal bases
Measuring by multiplying and averaging works like measuring how far one arrow in space points along another. Harmonics at different whole-number frequencies average to zero against each other, like arrows at right angles. Parseval’s relation then says that a squared length is the sum of the squared lengths of its parts, which is Pythagoras’ theorem with infinitely many directions. Linear algebra calls the multiply-and-average a projection, and calls the set of harmonics an orthogonal basis.
The maths behind it · splitting the variance
The constant is the average of the signal, the same number a statistician calls the sample mean. Parseval’s relation says that the total mean square is the squared mean plus one share from each harmonic. Harmonics at different frequencies do not rise and fall together, so their shares add with no cross terms. Statistics calls this splitting the variance into parts, and calls such components uncorrelated.
Worked example
- Square wave between and . It is on and on . Then for odd , and for even and for . So , and . Then , the lengths of 7.1.
- The 0-to-1 square wave. It equals . So , and for odd : , , . The arrow lengths are 0.6366, 0.2122 and 0.1273. Lifting the wave by moves only , from to .
- Three forms. For : , , , rad . Also with and , and . Check: .
- A pulse train. Take s and a pulse of half-width s, so for and elsewhere in the period. Integrating from to , with , Here , so , and . Then , , , and . Its power is , because .
- A time shift. Delay the wave of step 1 by . Each becomes , so , and . The magnitudes and are unchanged.
- Parseval. For the wave of step 1, harmonic carries : 0.8106, 0.0901, 0.0324 and 0.0165 for . The running totals are 0.8106, 0.9006, 0.9331 and 0.9496. With eight arrows the total is , and the exact total is .
- Three quick cases. Lifting a wave by changes only , by . For , and . A delay of keeps every and turns line 3 by , not .
Where you’ll meet this
The lines of a spectrum are what an audio analyser shows: the length of each line is how much of that frequency a sound contains. The phase dials explain why a sound stays recognisable when it is delayed, while a different delay for each frequency, as in some filters, changes its shape. This is the subject of Fourier series and LTI systems (7.4), where each passes through a system on its own.
Power per harmonic is how harmonic distortion is measured: the power in the harmonics that should not be there, compared with the power in the one that should. The next step is to let the period grow without limit, so that the lines crowd together into a curve. That is the page From series to transform (8.1). The rule that a delay turns each line by an angle in proportion to its frequency returns on the page Properties of the Fourier transform (8.2).
Reference card
| Quantity | Formula | Notes |
|---|---|---|
| Synthesis (complex) | ||
| Analysis | any one period would do; is the average | |
| Trigonometric | , , ; here are Fourier coefficients | |
| Compact | , | |
| Real signal | even magnitude, odd angle | |
| Lifting a wave | , all other unchanged | is the average, not the value at |
| Time shift | magnitudes and unchanged; line turns by | |
| Symmetries | even: ; odd: and ; half-wave (): even vanish | a cosine is even, a sine is odd |
| Parseval | power per harmonic ; the constant part’s share is | |
| Square wave () | , odd | |
| 0-to-1 square wave | , , odd | half the lines, plus the average |
| Pulse train, |