58
CHAPTER 3. SPECTRUM REPRESENTATION
3-4
Fourier Series
The examples in Sec. 3-3 show that we can synthesize periodic waveforms by using a sum of harmonically
related sinusoids. Now, we want to describe a general theory that shows how any periodic signal can be
synthesized with a sum of harmonically related sinusoids, although the sum may need an infinite number of
terms. This is the mathematical theory of Fourier series which uses the following representation:
x.t/ D
1
X
ak e j.2=T0 /k t
(3.19)
kD 1
where T0 is the fundamental period of the periodic signal x.t /. The k th complex exponential in (3.19) has a
frequency equal to fk D k=T0 Hz, so all the frequencies are integer multiples of the fundamental frequency
f0 D 1=T0 Hz.7
There are two aspects of the Fourier theory: analysis and synthesis. Starting from x.t / and calculating fak g
is called Fourier analysis. The reverse process of starting from fak g and generating x.t / is called Fourier
synthesis. In this section, we will concentrate on analysis.
The formula in (3.19) is the general synthesis formula. When the complex amplitudes are conjugatesymmetric, i.e., a k D ak , the synthesis formula becomes a sum of sinusoids of the form
x.t / D A0 C
1
X
kD1
Ak cos..2=T0 /k t C k /
(3.20)
where A0 D a0 , and the amplitude and phase of the k th term come from the polar form, ak D 21 Ak e jk . In
other words, the condition a k D ak is sufficient for the synthesized waveform to be a real function of time.
By appropriate choice of the complex amplitudes ak in (3.19), we can represent a number of interesting
periodic waveforms, such as square waves, triangle waves, rectified sinusoids, and so on. The fact that a
discontinuous square wave can be represented with an infinite number of sinusoids was one of the amazing
claims in Fourier’s famous thesis of 1807. It took many years before mathematicians were able to develop a
rigorous convergence proof to support Fourier’s claim.
3-4.1
Fourier Series: Analysis
How do we derive the coefficients for the harmonic sum in (3.19), i.e., how do we go from x.t / to ak ? The
answer is that we use the Fourier series integral to perform Fourier analysis. The complex amplitudes for any
periodic signal can be calculated with the Fourier integral
1
ak D
T0
ZT0
x.t /e
j.2=T0 /k t
dt
(3.21)
0
where T0 is the fundamental period of x.t /. A special case of (3.21) is the k D 0 case for the DC component
a0 which is obtained by
ZT0
1
x.t / dt
(3.22)
a0 D
T0
0
7 There
are three ways to refer to the fundamental frequency: radian frequency !0 in rad/sec, cyclic frequency f0 in Hz, or with
the period T0 in sec. Each one has its merits in certain situations. The relationship among these is !0 D 2f0 D 2=T0 .
c H. McClellan, R. W. Schafer, & M. A. Yoder
J.
DRAFT, for ECE-2026 Fall-2012, September 8, 2012
59
CHAPTER 3. SPECTRUM REPRESENTATION
A common interpretation of (3.22) is that a0 is simply the average value of the signal over one period.
The Fourier integral (3.21) is convenient if we have a formula that defines x.t / over one period. Two
examples will be presented later to illustrate this point. On the other hand, if x.t / is known only as a recording,
then numerical methods such as those discussed in Chapters 66 and ?? will be needed.
3-4.2
Fourier Series Derivation
In this section, we present a derivation of the Fourier series integral formula (3.21). The derivation relies on a
simple property of the complex exponential signal—the integral of a complex exponential over any number of
complete periods is zero. In equation form,
ZT0
e j.2=T0 /k t dt D 0
(3.23)
0
where T0 is a period of the complex exponential whose frequency is !k D .2=T0 /k, and k is a nonzero
integer. Here is the integration:
ˇT
ZT0
j.2=T0 /k t ˇ 0
e
ˇ
e j.2=T0 /k t dt D
ˇ
j.2=T0 /k ˇ
0
0
D
e j.2=T0 /kT0 1
D0
j.2=T0 /k
The numerator is zero because e j 2k D 1 for any integer k (positive or negative). Equation (3.23) can also be
justified if we use Euler’s formula to separate the integral into its real and imaginary parts and then integrate
cosine and sine separately—each one over k complete periods:
ZT0
0
e
j.2=T0 /k t
dt D
ZT0
cos..2=T0 /k t / dt
0
Cj
ZT0
sin..2=T0 /k t / dt D 0 C j 0
0
A key ingredient in the infinite series representation (3.19) is the form of the complex exponentials, which
all must repeat with the same period as the period of the signal x.t /, which is T0 . If we define vk .t / to be the
complex exponential of frequency !k D .2=T0 /k, then
vk .t / D e j.2=T0 /k t
(3.24)
Even though the minimum duration period of vk .t / might be smaller than T0 , the following shows that vk .t /
still repeats with a period of T0 :
vk .t C T0 / D e j.2=T0 /k.tCT0 /
D e j.2=T0 /k t e j.2=T0 /kT0
D e j.2=T0 /k t e j 2k
D e j.2=T0 /k t D vk .t /
c H. McClellan, R. W. Schafer, & M. A. Yoder
J.
DRAFT, for ECE-2026 Fall-2012, September 8, 2012
60
CHAPTER 3. SPECTRUM REPRESENTATION
where again we have used e j 2k D 1 for any integer k (positive or negative).
Next we can generalize the zero-integral property (3.23) of the complex exponential to involve two signals:8
Othogonality Property
ZT0
0
(
0
vk .t /v` .t / dt D
T0
(3.25)
if k ¤ `
if k D `
where the * superscript in v` .t / denotes the complex conjugate.
Proof: Proving the orthogonality property is straightforward. We begin with
ZT0
vk .t /v` .t / dt
D
0
ZT0
e j.2=T0 /k t e
ZT0
e j.2=T0 /.k
j.2=T0 /`t
dt
0
D
`/t
dt
0
There are two cases to consider for the last integral: when k D ` the exponent becomes zero, so the integral is
ZT0
e
j.2=T0 /.k `/t
dt D
ZT0
e j 0t dt
ZT0
1 dt D T0
0
0
D
0
Otherwise, when k ¤ ` the exponent is nonzero and we can invoke the zero-integral property in (3.23) to get
ZT0
e
j.2=T0 /.k `/t
dt D
0
ZT0
e j.2=T0 /mt dt D 0
0
where m D k ` ¤ 0.
The orthogonality property of complex exponentials (3.25) simplifies the rest of the Fourier series derivation. If we assume that (3.19) is valid,
x.t / D
8 The
1
X
ak e j.2=T0 /k t
kD 1
integral in (3.25) is called the “inner product” between vk .t/ and v` .t/, sometimes denoted as hvk .t/; v` .t/i.
c H. McClellan, R. W. Schafer, & M. A. Yoder
J.
DRAFT, for ECE-2026 Fall-2012, September 8, 2012
61
CHAPTER 3. SPECTRUM REPRESENTATION
then we can multiply both sides by the complex exponential v` .t / and integrate over the period T0 .
ZT0
x.t /e
j.2=T0 /`t
dt D
0
ZT0
1
X
ak e
0
kD 1
D
1
X
kD 1
j.2=T0 /k t
!
e
0T
Z0
ak @ e j.2=T0 /.k
„
0
j.2=T0 /`t
dt
(3.26)
`/t
ƒ‚
1
dt A D a` T0
nonzero only when k D `
…
Notice that we are able to isolate one of the complex amplitudes .a` / in the final step by applying the orthogonality property (3.25).
The crucial step in (3.26) occurs when the order of the infinite summation and the integration is swapped.
This is a delicate manipulation that depends on convergence properties of the infinite series expansion. It
was also a topic of research that occupied mathematicians for a good part of the early 19th century. For our
purposes, if we assume that x.t / is a smooth function and has only a finite number of discontinuities within
one period, then the swap is permissible.
The final analysis formula is obtained by dividing both sides of (3.26) by T0 and writing a` on one side of
the equation. Since ` could be any index, we can replace ` with k to obtain
Fourier Analysis Equation
ZT0
1
ak D
x.t /e j.2=T0 /k t dt
T0
(3.27)
0
where !0 D 2=T0 D 2f0 is the fundamental frequency of the periodic signal x.t /. This analysis formula
goes hand in hand with the synthesis formula for periodic signals, which is
Fourier Synthesis Equation
1
X
x.t / D
ak e j.2=T0 /k t
(3.28)
kD 1
3-5
Spectrum of the Fourier Series
When we discussed the spectrum in Section 3-1, we described a graphical procedure for drawing the spectrum
when x.t/ is composed of a sum of complex exponentials. By virtue of the synthesis formula (3.28), the Fourier
series coefficients ak are, in fact, the complex amplitudes that define the spectrum of x.t /. In order to illustrate
this general connection between the Fourier series and the spectrum, we use the “sine-cubed” signal. First, we
derive the ak coefficients for x.t / D sin3 .3 t /, and then we sketch its spectrum.
c H. McClellan, R. W. Schafer, & M. A. Yoder
J.
DRAFT, for ECE-2026 Fall-2012, September 8, 2012
62
CHAPTER 3. SPECTRUM REPRESENTATION
C
M
DRO
Example 3-7: Fourier Series without
Integration
Determine the Fourier series coefficients of the signal:
x.t / D sin3 .3 t /
Solution: There are two ways to get the ak coefficients: plug x.t / into the Fourier integral (3.27), or use
the inverse Euler formula to expand x.t / into a sum of complex exponentials. It is far easier to use the latter
approach. Using the inverse Euler formula for sin./, we make the following expansion of the sine-cubed
function:
!3
e j 3 t e j 3 t
x.t / D
2j
D 18j e j 9 t 3e j 6 t e j 3 t C3e j 3 t e j 6 t e j 9 t
D j8 e j 9 t C
3j j 3 t
8 e
C
3j
8
e
j 3 t
C
j
8
e
j 9 t
(3.29)
We see that (3.29) is the sum of four terms with frequencies: ! D ˙3 and ! D ˙9 rad/s. Since gcd.3; 9/ D
3, the fundamental frequency is !0 D 3 rad/sec. The Fourier series coefficients are indexed in terms of the
fundamental frequency, so
8̂
0
for k D 0
ˆ
ˆ
ˆ
3
ˆ
ˆ
<j 8 for k D ˙1
ak D 0
(3.30)
for k D ˙2
ˆ
ˆ
1
ˆ˙j
for k D ˙3
ˆ
ˆ
8
:̂
0
for k D ˙4; ˙5; ˙6; : : :
This example shows that it is not always necessary to evaluate an integral to obtain the fak g coefficients.
Now we can draw the spectrum (Fig. 3-13) because we know that we have four nonzero ak components
located at the four frequencies: ! D f 9; 3; 3; 9g rad/sec. We prefer to plot the spectrum versus
frequency in hertz in this case, so the spectrum lines9 are at f D 4:5; 1:5; 1:5; and 4.5 Hz. The second
harmonic is missing and the third harmonic is at 4.5 Hz.
DRO
C
M
EXERCISE 3.5: Use the Fourier integral to determine all the Fourier series coefficients of the “sinecubed” signal. In other words, evaluate the integral
1
ak D
T0
ZT0
sin3 .3 t /e
j.2=T0 /k t
dt
0
for all k.
Hints: Find the period first, so that the integration interval is known. In addition, you might find it easier
to convert the sin3 ./ function to exponential form (via the inverse Euler formula for sin./) before doing the
Fourier integral on each of four different terms. If you then invoke the orthogonality property on each integral,
you should get exactly the same answer as (3.30).
9 Repeating this footnote from Section 3.1 here for convenience: Spectra of signals comprised of individual sinusoids are often
called “line spectra”. The term “line” seems appropriate for us here because we plot the components as vertical lines positioned at the
individual frequencies. However, the term originated in physics where lines are observed in emission or absorption spectra formed with
optical prisms (which serve as optical spectrum analyzers). These lines correspond to energy being emitted or absorbed at wavelengths
that are characteristic of atoms or ions.
c H. McClellan, R. W. Schafer, & M. A. Yoder
J.
DRAFT, for ECE-2026 Fall-2012, September 8, 2012
63
CHAPTER 3. SPECTRUM REPRESENTATION
3 jπ/2
8e
3 − jπ/2
8e
1 − jπ/2
8e
−4.5
1 jπ/2
8e
−1.5
0
1.5
4.5
f
Figure 3-13: Spectrum of the “sine-cubed” signal derived from its Fourier series coefficients. Only the range from
5
to C5 Hz is shown. The complex amplitude of each spectrum line is equal to the Fourier series coefficient ak for that
frequency, kf0 .
C
M
DRO
EXERCISE 3.6:
Make a sketch of the spectrum of the signal defined by:
x.t / D
3-6
3
X
kD 3
1
ej k t
1 C jk
Fourier Analysis of Periodic Signals
We can synthesize any periodic signal by using a sum of sinusoids (3.28), as long as we constrain the frequencies to be harmonically related. To demonstrate Fourier synthesis of waveshapes that do not look at all
sinusoidal, we will work out the details for a square wave, a triangle wave, and rectified sinusoids in this section.
The resulting formulas for their Fourier coefficients ak are relatively compact, but the number of coefficients
is infinite.
In order to synthesize the signal from its spectrum in hardware or software, a list of frequencies and a list of
complex amplitudes are needed, but these lists must contain a finite number of elements. Then an approximate
signal can be synthesized according to the finite Fourier synthesis summation formula
xN .t / D
N
X
ak e j.2=T0 /k t
(3.31)
kD N
If you have access to M ATLAB, it is straightforward to write a Fourier Synthesis Program that implements
(3.31). This M ATLAB programming exercise is described in more detail in the music synthesis project of Lab
#4. Figure 3-14 shows the relationship between Fourier analysis and Fourier synthesis using representative
plots for the square wave case where the finite synthesis (in the lower right) is an approximation to the original
square wave.
C
3-6.1
M
DRO
LAB: #4 Synthesis of Sinusoidal Signals
The Square Wave
The simplest example to consider is the periodic square wave, which is defined for one cycle by
(
1 for 0 t < 12 T0
x.t / D
0 for 12 T0 t T0
c H. McClellan, R. W. Schafer, & M. A. Yoder
J.
(3.32)
DRAFT, for ECE-2026 Fall-2012, September 8, 2012
64
CHAPTER 3. SPECTRUM REPRESENTATION
a0
a−1
a3
a
a−7 a−5 −3
···
−13f 0
a1
−7f 0
−3f 0
a5
a7
a9 a11 a13
f (Hz)
0 f 0 3f 0 5f 0 7f 0 9f 0 · · · 13f 0
Spectrum Plot
T0 = Period
Fourier Analysis
x(t)
1
T0
T0
Fourier Synthesis
{ak }
Extract Sinusoids
ak =
N = Number of Coefficients
(ak , k f 0 ) versus f
x(t)e− j2π k f0 t dt
Approximate the Signal
{k f 0 }
f0 =
0
1
T0
x N (t) =
Hz
N
k=−N
x(t)
0
ak e j2π k f0 t
x N (t)
1
−T0
x N (t)
1
1
2 T0
2T0
T0
t
−T0
0
1
2 T0
T0
2T0
t
Figure 3-14: Major components of Fourier analysis and synthesis showing the relationship between the original periodic
signal x.t /, its spectrum, and the synthesized signal xN .t / that approximates the original.
x(t)
1
−T0 − 1 T0
2
−2T0
0
2T0 t
T0
1
2 T0
Figure 3-15: Plot of the square-wave signal whose “duty cycle” is 50%.
Figure 3-15 shows a plot of this signal which is called a 50% duty cycle square wave because it switches
between zero and one (off and on), and is on during half of its period.
We will derive a formula that depends on k for the complex amplitudes ak . First of all, we substitute the
definition of x.t / into the integral (3.27) and immediately recognize that the integral must be broken into two
integrals to handle the two cases in (3.32)
ak D
1
T0
1
Z2 T0
.1/e
j.2=T0 /k t
0
dt C
1
T0
ZT0
*0
0 /k t dt
.0/e j.2=T
1 T0
2
The second integral drops out because the signal x.t / is zero for 12 T0 t T0 . Thus, we perform the integrac H. McClellan, R. W. Schafer, & M. A. Yoder
J.
DRAFT, for ECE-2026 Fall-2012, September 8, 2012
65
CHAPTER 3. SPECTRUM REPRESENTATION
tion from 0 to 21 T0 , and simplify as follows:
ak D
1
T0
D
1
T0
D
Since e
wave.
j
D
e
ˇ 1 T0
ˇ2
e
ˇ
ˇ
j.2=T0 /k ˇ
j.2=T0 /k t
0
1
j.2=T0 /k. 2 T0 /
e j.2=T0 /k.0/
j 2=T0 k
e
jk
1
j 2k
1, we can write the following general formula for the Fourier series coefficients of the square
. 1/k
for k ¤ 0
(3.33)
j 2k
There is one shortcoming with this formula for ak ; it is not valid when k D 0 because k appears in the denominator. Therefore, we must evaluate the DC10 coefficient a0 separately using (3.22)
ak D
1
1
Z2 T0
1
a0 D
.1/e
T0
D
1
T0
j 0t
0
1
Z2 T0
.1/ dt D
0
dt
1
T0
1
2 T0
D
1
2
The formula (3.33) for ak when k ¤ 0 has a numerator that is either 0 (for k even) or 2 (for k odd), because
. 1/k alternates between C1 and 1. Therefore, the final answer for all the Fourier series coefficients of the
square wave has three cases:
8̂
1
ˆ
k D ˙1; ˙3; ˙5; : : :
ˆ
< jk
ak D 0
(3.34)
k D ˙2; ˙4; ˙6; : : :
ˆ
ˆ
:̂ 1
kD0
2
Notice that the magnitude of these coefficients decreases as k ! 1, so the high frequency terms contribute
less and less when synthesizing the waveform via (3.31).
3-6.1.1
DC Value of a Square Wave
The Fourier series coefficient for k D 0 has a special interpretation as the average value of the signal x.t /. If
we repeat the analysis integral (3.27) for the case where k D 0, then
1
a0 D
T0
ZT0
x.t /dt
(3.35)
0
10 Repeating
this footnote from Section 3.1 here for convenience: The terminology “DC” comes from electric circuits, where a
constant value of current is called direct current, or DC. It is common to call a0 the DC component of the spectrum. Since the DC
component is constant, its frequency is f D 0.
c H. McClellan, R. W. Schafer, & M. A. Yoder
J.
DRAFT, for ECE-2026 Fall-2012, September 8, 2012
66
CHAPTER 3. SPECTRUM REPRESENTATION
The integral is the area under the function x.t / for one period. If we think of the area as a sum and realize that
dividing by T0 is akin to dividing by the number of elements in the sum, we can interpret (3.35) as the average
value of the signal.
In the specific case of the 50% duty-cycle square wave, the average value should be 12 because the signal is
equal to C1 for half the period and then 0 for the other half. In the synthesis formula (3.28), the a0 coefficient
is an additive constant, so a change in its value will move the plot of the signal up or down vertically. The
following example shows another 50% duty cycle square with a different DC value.
DRO
C
M
EXERCISE 3.7: Determine the DC value of the following bipolar square wave which alternates between
the positive and negative values ˙ 21
(
1
for 0 t < 12 T0
s.t / D 1 2
for 12 T0 t T0
2
This signal is similar to the square wave defined in (3.32).
Answer: Make a sketch to see that the DC value is zero.
3-6.1.2
Spectrum for a Square Wave
Figure 3-16 shows the spectrum for the 50% duty cycle square wave analyzed in (3.34) when the fundamental
frequency is 25 Hz. Since ak D 0 for k nonzero and even, the only frequency components present in the
j
π
j
j
13π
11π
−325
j
9π
1
2
−j
π
j
3π
j
j
5π
7π
−175
−75
−25 0
25
−j
3π
75
−j
5π
125
−j
7π
175
−j
9π
225
−j
11π
275
−j
13π
325
f
Figure 3-16: Spectrum of a square wave derived from its Fourier series coefficients. Only the range from k D 13 to C13
is shown. With a fundamental frequency of 25 Hz, this corresponds to frequencies ranging from 325 Hz to C325 Hz.
spectrum are the odd harmonics at ˙25, ˙75, ˙125, and so on. The complex amplitudes of the odd harmonics
are the Fourier series coefficients, ak D j=.k/, and these are used as the labels on the spectrum lines in
Fig. 3-16. Also the figure shows that the magnitude of these coefficients drops off as 1=k.
C
3-6.1.3
M
DRO
DEMO: Spectrograms: Simple Sounds
Synthesis of a Square Wave
The fact that the spectrum of a square has an infinite number of spectral lines means that it is impossible to
have/use such a signal in a a real hardware system built with electronics or other physical devices. No realizable
system has infinite bandwidth, so any attempt to transmit the square wave would be subject to a bandwidth limit
and the higher frequency spectral components would be changed or lost. Therefore, it is quite interesting to
c H. McClellan, R. W. Schafer, & M. A. Yoder
J.
DRAFT, for ECE-2026 Fall-2012, September 8, 2012
67
CHAPTER 3. SPECTRUM REPRESENTATION
study the approximate resynthesis of a square wave from a finite number of its spectral lines, and ask the
question “How good is the approximation when using N spectral lines?”
Using a simple M ATLAB M-file, a synthesis was done via (3.31) with a fundamental frequency of f0 D 25
Hz, and fk D kf0 . The fundamental period is T0 D 1=25 D 0:04 secs. In Fig. 3-17, the plots are shown for
three different cases where the number of terms in the sum is N D 3, 7, and 17. Notice how the period of the
synthesized waveform is always the same, because it is determined by the fundamental frequency.
Sum of DC, 1st and 3rd Harmonics
x3 .t / 1
1
2
DC Level
0
0
0.02
0.04
0.06
0.08
0.1
Sum of DC and 1st through 7th Harmonics
x7 .t / 1
1
2
DC Level
0
0
0.02
0.04
0.06
0.08
0.1
Sum of DC and 1st through 17th Harmonics
x17 .t / 1
1
2
DC Level
0
0
0.02
0.04
0.06
Time t (sec)
0.08
0.1
Figure 3-17: Summing harmonic components via (3.31): N D 3 (top panel); N D 7 (middle) and N D 17 (bottom).
The DC level of
1
2
can be seen in each synthesis.
The synthesis formula (3.31) usually can be simplified to a cosine form. For the particular case of the
square wave coefficients (3.34), when we take the DC value plus first and third harmonic terms, i.e., N D 3,
we get the sum of two sinusoids plus the constant (DC) level derived below:
x3 .t / D a
D
3e
j 3!0 t
1
e
j 3
Ca
j 3!0 t
C
1e
j!0 t
1
e
j
C a0 C a1 e j!0 t C a3 e j 3!0 t
j!0 t
C a0 C
1 j!0 t
1 j 3!0 t
e
C
e
j
j 3
1
1
D a0 C .e j=2 e j!0 t C e j=2 e j!0 t / C
.e j=2 e j 3!0 t C e j=2 e
3
1
2
2
D C cos.!0 t =2/ C
cos.3!0 t =2/
2 3
(3.36)
j 3!0 t
/
As more harmonic terms are added, the approximating formula is still a sum of sinusoids but higher frequency terms are included. In Fig. 3-17 the ripples are higher in frequency as N increases However, the
synthesized waveshape does look more like a square-wave signal as N increases, and it appears to converge
to the constant values C1 and 0. The size of the ripples gets smaller, but the convergence is not uniformly
c H. McClellan, R. W. Schafer, & M. A. Yoder
J.
DRAFT, for ECE-2026 Fall-2012, September 8, 2012
68
CHAPTER 3. SPECTRUM REPRESENTATION
good—there are “ears” at the discontinuous steps never go away completely. This behavior, which occurs at
any discontinuity of a waveform, is called the Gibbs phenomenon, and it is one of the interesting subtleties of
Fourier theory that is extensively studied in advanced treatments.
C
M
DRO
LAB: #4 Synthesis of Sinusoidal Signals
C
3-6.2
M
DRO
DEMO: Fourier Series
Triangle Wave
Another interesting case that is still relatively simple is that of a triangle wave shown in Fig. 3-18. The mathe-
Amplitude
Triangle Waveform (Period = 0.04 secs)
1
1
2
0
0
0.02
0.04
0.06
0.08
Time t (sec)
0.1
0.12
Figure 3-18: Periodic triangle wave with T0 D 0:04 s.
matical formula for the triangle wave consists of two segments. To set up the Fourier analysis integral, we have
to give the definition of the waveform over exactly one period, so we define two line segments:
(
2t =T0
for 0 t < 21 T0
x.t / D
(3.37)
2.T0 t /=T0 for 21 T0 t < T0
The first line segment has a slope of 2=T0 , the second, 2=T0 . Unlike the square wave, the triangle wave is a
continuous signal.
Now we attack the Fourier integral for this case to derive a formula for the fak g coefficients of the triangle
wave. We might suspect from our earlier experience that the DC coefficient has to be found separately, so we
do that first. Plugging into the definition with k D 0, we obtain
1
a0 D
T0
ZT0
x.t / dt
0
If we recognize that the integral over one period is, in fact, the area under the triangle, we get
a0 D
1
1
(area) D
.T0 /. 12 / D
T0
T0
1
2
(3.38)
For the general case where k ¤ 0, we must break the Fourier series analysis integral into two sections because
c H. McClellan, R. W. Schafer, & M. A. Yoder
J.
DRAFT, for ECE-2026 Fall-2012, September 8, 2012
69
CHAPTER 3. SPECTRUM REPRESENTATION
the signal consists of two pieces:
1
Z2 T0
1
.2t =T0 /e
ak D
T0
j.2=T0 /k t
dt
0
C
1
T0
ZT0
.2.T0
(3.39)
t /=T0 /e
j.2T0 /k t
dt
1
2 T0
After integration by parts and many tedious algebraic steps, the integral for ak can be written as
ak D
Since e
ak :
j k
e
j k
1
2k2
(3.40)
D . 1/k , the numerator in (3.40) equals either 0 or 2, and we can write the following cases for
ak D
8̂
2
ˆ
ˆ
< 2k2
ˆ
ˆ0
:̂ 1
2
k D ˙1; ˙3; ˙5; : : :
k D ˙2; ˙4; ˙6; : : :
kD0
(3.41)
DRO
C
M
EXERCISE 3.8: Starting from (3.39), derive the formula (3.41) for the Fourier series coefficients of
the triangle wave. Use integration by parts to manipulate terms of the form t e j.2=T0 /k t which occur in the
integrands.
DRO
C
M
EXERCISE 3.9: Make a plot of the spectrum for the triangle wave (similar to Fig. 3-16 for the square
wave). Use the complex amplitudes from (3.41) and assume that f0 D 25 Hz.
3-6.2.1
Synthesis of a Triangle Wave
The ideal triangle wave in Fig. 3-18 is a continuous signal, unlike the square wave which is discontinuous.
Therefore, it is easier to approximate the triangle wave with a finite Fourier sum (3.31). Two cases are shown
in Fig. 3-19, for N D 3 and 9. The fundamental frequency is equal to f0 D 25 Hz. In the N D 9 case
the approximation is nearly indistinguishable from the true triangularly-shaped waveform but there is slight
rounding at the top and bottom of the waveform. Adding harmonics for N > 9 will improve the synthesis near
those points. Even the N D 3 case is reasonably good, despite using only DC and two sinuosoidal terms. We
can see the reason for this by plotting the spectrum (as in Exercise 3.9), which will show that the high frequency
components decrease in size much faster those of the square wave.
DRO
C
M
EXERCISE 3.10: For the N D 3 approximation of the triangle wave, derive the mathematical formula
for the sinusoids; similar to what was done in (3.36) for the square wave.
c H. McClellan, R. W. Schafer, & M. A. Yoder
J.
DRAFT, for ECE-2026 Fall-2012, September 8, 2012
70
CHAPTER 3. SPECTRUM REPRESENTATION
Sum of DC, 1st and 3rd Harmonics
x3 .t / 1
1
2
0
0
0.02
0.04
0.06
0.08
0.1
Sum of DC and 1st through 9th Harmonics
x9 .t / 1
1
2
0
0
0.02
0.04
0.06
Time t (sec)
0.08
0.1
Figure 3-19: Summing harmonic components for a 25-Hz triangle wave via (3.31): first and third harmonics (top
panel); up to and including the ninth harmonic (bottom).
3-6.3
Full-Wave Rectified Sine
Another interesting case that is still relatively simple is that of a full-wave rectified sine wave shown in Fig. 320. This signal is an essential part of DC power supplies as well as AC to DC power converters—the ubiquitous
devices that are needed to recharge batteries in cell phones, laptops, and so on. Battery charging requires
constant DC current, but the power companies distribute AC (alternating current) which, in our terms, is a pure
sinusoid with zero DC value.11 A simple rectifier circuit built with diodes will turn a sinusoid into a signal with
a nonzero DC component which can then be cleaned up and used as a DC power source for recharging. We
will examine two rectified sinusoids: full-wave and half-wave.
The mathematical formula for the full-wave rectified sine signal is just the absolute value of a sinusoid.
(3.42)
x.t / D jsin.2 t =T1 /j
For 50-Hz AC power the period of the sinusoid is T1 D 0:02 s but after “rectification” the period is halved as
shown in Fig. 3-20. The full-wave rectified sine is a continuous signal, but its first derivative is discontinuous,
Amplitude
Full-Wave Rectified Sine Signal (Period = 0.01 s)
1
1
2
0
0
0.01
0.02
0.03
Time t (sec)
0.04
0.05
Figure 3-20: Periodic full-wave rectified sine signal.
resulting in the sharp points when the signal is zero (at t D 0; 0:01; 0:02; 0:03; : : :). The fundamental period
(T0 ) is equal to 12 T1 because the negative lobe of the sinusoid is identical to the positive lobe after being flipped
by the absolute value operator, so f0 D 100 Hz in Fig. 3-20.
11 In
most of the world, AC power is 50 hertz, but, in the Americas, 60 hertz is common.
c H. McClellan, R. W. Schafer, & M. A. Yoder
J.
DRAFT, for ECE-2026 Fall-2012, September 8, 2012
71
CHAPTER 3. SPECTRUM REPRESENTATION
The Fourier integral for this case requires only one integral, and there are no special cases
1
ak D
T0
ZT0
sin.2 t =T1 /e
j.2=T0 /k t
(3.43)
dt
0
where T1 D 2T0 . The integration can be carried out efficiently by using the inverse Euler formula for sine.
After simplifying many complex exponentials, the final result for ak can be written as
ak D
2
.1
(3.44)
4k 2 /
Notice that the DC value is nonzero, i.e., a0 D 2= 0:6366 which is 63.66% of the maximum value of the
rectified sine as shown in Fig. 3-21.
C
M
DRO
EXERCISE 3.11: Starting from (3.43), derive the formula (3.44) for the Fourier series coefficients of the
full-wave rectified sine. Exploit complex exponential simplifications such as e j 2k D 1, e j D
1, and so on.
Sum of DC, 1st through 3rd Harmonics
x3 .t /
1
DC Level
1
2
0
0
0.01
0.02
0.03
0.04
0.05
Sum of DC and 1st through 9th Harmonics
1
x9 .t /
DC Level
1
2
0
0
0.01
0.02
0.03
Time t (sec)
0.04
0.05
Figure 3-21: Summing harmonic components for the full-wave rectified sine signal via (3.31): DC, first and third
harmonics (top panel); up to and including the ninth harmonic (bottom).
DRO
C
M
EXERCISE 3.12:
Make a plot of the spectrum for the full-wave rectified sine (similar to Fig. 3-16
for the square wave). Use the complex amplitudes from (3.44) and note that T1 D 0:02 s gives a fundamental
frequency of f0 D 100 Hz.
3-6.3.1
Synthesis of a Full-Wave Rectified Sine
Since the ideal full-wave rectified sine signal in Fig. 3-20 is a continuous signal, unlike the square wave which
is discontinuous, it is easier to approximate with a finite Fourier sum (3.31). Two cases are shown in Fig. 321, for N D 3 and 9. In the N D 9 case the approximation is very close to the original waveform. Adding
harmonics for N > 9 will improve the synthesis very little, but it will sharpen the dips at t D 0:01; 0:02; : : :.
The N D 3 case exhibits noticeable ripples because it is only using only DC and three sinusoidal terms. It
should be possible to explain these differences by plotting the spectrum (as in Exercise 3.12), which will show
that the relative magnitudes of the higher frequency components being dropped for k > 3.
c H. McClellan, R. W. Schafer, & M. A. Yoder
J.
DRAFT, for ECE-2026 Fall-2012, September 8, 2012
72
CHAPTER 3. SPECTRUM REPRESENTATION
3-6.4
Half-Wave Rectified Sine
Another interesting case that is still relatively simple is that of a half-wave rectified sine wave shown in Fig. 322, i.e., the negative lobes of a sine wave are clipped off. The mathematical formula for the half-wave rectified
sine signal consists of two cases when defined over exactly one period, 0 t T0 :
(
sin.2 t =T0 / for 0 t < 12 T0
x.t / D
(3.45)
0
for 12 T0 t < T0
where T0 D 0:02 sec in Fig. 3-22. The half-wave rectified sine is a continuous signal, but its first derivative is
Amplitude
Half-Wave Rectified Sine Signal (Period = 0.02 s)
1
1
2
0
0
0.01
0.02
0.03
Time t (sec)
0.04
0.05
Figure 3-22: Periodic half-wave rectified sine signal.
discontinuous, resulting in the sharp points when the signal is zero at t D 0; 0:01; 0:02; 0:03; : : : in Fig. 3-22.
We must break the Fourier series analysis integral into two sections because the signal consists of two
pieces:
1
Z2 T0
1
ak D
sin.2 t =T0 /e
T0
j.2=T0 /k t
dt
0
*0
1
0 /k t dt
C
.0/ej.2T
T0
1
2 T0
(3.46)
ZT0
For the general case where k ¤ ˙1, the integration can be carried out efficiently by using the inverse Euler
formula for sine. After simplifying many complex exponentials, the final result for ak can be written as
8̂
1
ˆ
ˆ
< .1 k 2 / for k even
(3.47)
ak D j 1
for k D ˙1
ˆ
4
ˆ
:̂0
for k D ˙3; ˙5; : : :
The special cases of k D ˙1 are handled easily because the integrand becomes (e.g., for k D 1)
sin.2 t =T0 /e
j.2=T0 /t
D
j 12 C je
j.4=T0 /t
and the two terms can be integrated directly.
c H. McClellan, R. W. Schafer, & M. A. Yoder
J.
DRAFT, for ECE-2026 Fall-2012, September 8, 2012
73
CHAPTER 3. SPECTRUM REPRESENTATION
DRO
C
M
EXERCISE 3.13: Starting from (3.46), derive the formula (3.47) for the Fourier series coefficients of the
half-wave rectified sine. Exploit complex exponential simplifications such as e j 2k D 1, e j D 1, and so
on. Show how the k D ˙1 cases can be treated separately.
3-6.4.1
Synthesis of a Half-Wave Rectified Sine from its Spectrum
Since the ideal half-wave rectified sine signal in Fig. 3-22 is a continuous signal, unlike the square wave which
is discontinuous, it is easier to approximate with a finite Fourier sum (3.31). Two cases are shown in Fig. 3-23,
for N D 2 and 8. The fundamental frequency is equal to f0 D 50 Hz. In the N D 8 case the approximation is
Sum of DC, 1st and 2nd Harmonics
1
x2 .t /
1
2
0
DC Level
0
0.01
0.02
0.03
0.04
0.05
Sum of DC and 1st through 8th Harmonics
1
x8 .t /
1
2
0
DC Level
0
0.01
0.02
0.03
Time t (sec)
0.04
0.05
Figure 3-23: Summing harmonic components for the half-wave rectified sine signal via (3.31): DC, first and second
harmonics (top panel); up to and including the eighth harmonic (bottom).
very close to the original waveform, but small ripples are visible. Adding harmonics for N > 8 will improve
the synthesis just a little bit by reducing the ripples. The N D 2 case exhibits noticeable ripples because it is
only using DC and two sinusoidal terms. It is possible to explain these differences by examining the spectrum,
which will show that the relative magnitudes of the higher frequency components being dropped for k > 2 are
quite small. A plot of the spectrum for the half-wave rectified sine (similar to Fig. 3-16 for the square wave) is
shown in Fig. 3-24 for f0 D 50 Hz. The complex amplitudes given in (3.47) fall off very rapidly, and only the
even-index harmonics are present for k > 1.
1
j
4
1
3
0
50 100
1
15
1
35
1
63
1
99
200
300
400
500 f
Figure 3-24: One-sided spectrum of a half-wave rectified sine signal up to the tenth harmonic, showing only the
nonegative frequency region.
c H. McClellan, R. W. Schafer, & M. A. Yoder
J.
DRAFT, for ECE-2026 Fall-2012, September 8, 2012
74
CHAPTER 3. SPECTRUM REPRESENTATION
3-6.5
Convergence of Fourier Synthesis
We can think of the finite Fourier sum (3.31) as making an approximation to the true signal; i.e.,
x.t / xN .t / D
N
X
ak e j.2=T0 /k t
kD N
In fact, we anticipate that with enough complex exponentials the approximation will be perfect, i.e., as N ! 1.
One way to assess the quality of the approximation is to define an error signal, eN .t / D x.t / xN .t /, that
measures the difference between the true signal and the synthesis with N terms. Then we can quantify the
error by measuring a feature of the error. For example, a commonly used feature is the maximum magnitude of
the difference, which is called the worst-case error.
Eworst D max jx.t /
t 2Œ0;T0
|e7 (t)|
|e17 (t)|
Error with 1st through 7th Harmonics
1
2
0
0
0.02
0.04
0.06
0.08
0.1
Error with 1st through 17th Harmonics
1
2
0
(3.48)
xN .t /j
0
0.02
0.04
0.06
Time t (sec)
0.08
0.1
Figure 3-25: Worst-case error magnitude when approximating a square wave with a sum of harmonic components via
(3.31): N D 7 (top panel) and N D 17 (bottom).
For the 50% duty cyle square wave, the worst-case error is shown in Fig. 3-25 for N D 7 and N D 17. Figure 325 was generated by using the Fourier coefficients from (3.34) in a M ATLAB script to generate a plot of the
worst-case error. Since the ideal square wave is discontinuous, the worst-case error is always half the size of
the jump in the waveform right at the discontinuity point. The more interesting feature of the worst-case error
comes from examining the size of the “ears” seen in Fig. 3-17. In Fig. 3-25, this overshoot error is found in
e7 .t/ at t 0:0025 s, and is about 0.1. In fact, it has been proven that the overshoot will be about 9% of the
size of the discontinuity. The mathematical analysis of this worst-case error was first published by J. Willard
Gibbs12 in 1898, and is now referred to as the Gibbs’ Phenomenon in Fourier Series.
If we perform a similar comparison for the triangle wave, or the rectified sines, the worst-case error is wellbehaved because these signals are continuous. The worst-case error will converge to zero as N ! 1, i.e., there
is no Gibbs’ phenomenon. For the N D 3 and N D 9 approximations of the triangle wave a measurement of
their worst-case errors can be done by making a zoomed version of Fig. 3-19. When these errors are measured,
the result is 0.0497 for N D 3 and 0.0202 for N D 9.
12 Gibbs
received the first American doctorate in engineering from Yale in 1863.
c H. McClellan, R. W. Schafer, & M. A. Yoder
J.
DRAFT, for ECE-2026 Fall-2012, September 8, 2012
75
CHAPTER 3. SPECTRUM REPRESENTATION
Worst-case error is not the only way to measure the difference. The worst-case error only measures pointwise convergence of the approximation to the ideal signal. In fact, to prove convergence of the Fourier Series
for signals such as the square wave, another error measure has been developed. This is the mean-square error
where the measurable feature of the difference is an averaging integral of the squared error over the whole
period, i.e.,
ZT0
1
E2 D
jx.t / xN .t /j2 dt
T0
0
Using the mean-square error measure, the theory of Fourier Series can be made mathematically rigorous.
DRO
C
M
EXERCISE 3.14: Carry out a measurement of the worst-case error for the full-wave rectified sine signal
when approximating with N terms for N D 3 and N D 9.
3-6.6
Operations on Fourier Series
Scaling is a simple property because it should be obvious that multiplying a periodic signal by a scale factor,
i.e., x.t/, will multiply all its Fourier Series coefficients by the same scale factor . /
x.t / D
1
X
.ak /e j 2f0 k t
kD 1
Another simple operation is addition, but there are two cases: If the two periodic signals have the same fundamental frequency, then the Fourier coefficients are summed
x.t / C y.t / D
1
X
kD 1
.ak C bk /e j 2f0 k t
where the Fourier coefficients of x.t / are fak g, and fbk g for y.t /. It the fundamental frequencies are different,
the situation is much more complicated because sum signal might not even be periodic; if it is periodic, finding
the new fundamental frequency involves a gcd (greatest common divisor) operation. Then using the new fundamental frequency all the Fourier coefficients must be re-indexed which makes adding the Fourier coefficients
very tedious. One more thing, f0 could change once again after the addition (see Exercise 3.16).
C
M
DRO
Example 3-8: New Square Wave
Define a bipolar square wave with a 50% duty cycle as follows:
(
C1 for 0 t < 12 T0
b.t / D
1 for 12 T0 t < T0
This square can be related to the zero-one 50% duty cycle square via b.t / D 2.x.t / 12 /. Subtracting 12 from
x.t/ will change only the DC value, then multiplying by two will double the size of all the Fourier coefficients.
Since the Fourier coefficients of the zero-one square wave are
8̂
1
for k D 0
<2
j
ak D k for k odd
:̂
0
for k D ˙2; ˙4; : : :
c H. McClellan, R. W. Schafer, & M. A. Yoder
J.
DRAFT, for ECE-2026 Fall-2012, September 8, 2012
76
CHAPTER 3. SPECTRUM REPRESENTATION
the Fourier coefficients fbk g for b.t / are
bk D
3-6.7
8̂
<0
:̂
for k D 0
for k odd
for k D ˙2; ˙4; : : :
2j
k
0
Time-Shifting x.t/ Multiplies ak by a Complex Exponential
If we form a new signal y.t / by time shifting x.t /, then there is a simple change in the Fourier coefficients.
y.t / D x.t
Because
y.t / D x.t
3-6.8
d / D
1
X
!
d /
ak e
bk D ak e
j 2f0 k.t d /
kD 1
j 2f0 kd
1 X
D
ak e j 2f0 kd e j 2f0 k t
ƒ‚
…
kD 1 „
bk
Derivative of x.t/ Multiplies ak by j!0 k
If we form a new signal y.t / by taking the derivative of x.t /, then there is a simple change in the Fourier
coefficients.
d
y.t / D
x.t /
! bk D .j 2f0 k/ak
dt
Since the derivative operator can be applied to each term in the sum, we get
1
1
X
X
d j 2f0 k t
d
x.t / D
ak e
D
.j 2f0 k/ak e j 2f0 k t
y.t / D
„ ƒ‚ …
dt
dt
kD 1
3-6.9
kD 1
bk
Multiply x.t/ by Sinusoid
If you multiply a periodic signal by a sinusoid, the Fourier Series coefficients will be changed in a simple
predictable fashion. Here is the derivation for a periodic x.t / multiplied by sin.2f0 t /, where f0 is the fundamental frequency of x.t /.
1
X
x.t / D
ak e j 2f0 k t
(3.49a)
kD 1
1 j 2f0 t
1 j 2f0 t
e
C
e
2j
2j
!
1
X
1 j 2f0 t
1
ak e j 2f0 k t
e
C
e
2j
2j
(3.49b)
sin.2f0 t / D
y.t / D x.t / sin.2f0 t / D
kD 1
j 2f0 t
(3.49c)
The product signal, y.t /, will be periodic and it is quite likely that its fundamental frequency will also be f0 .
Therefore, y.t / has a Fourier Series with coefficients fbk g.
y.t / D
1
X
bk e j 2f0 k t
(3.49d)
kD 1
c H. McClellan, R. W. Schafer, & M. A. Yoder
J.
DRAFT, for ECE-2026 Fall-2012, September 8, 2012
77
CHAPTER 3. SPECTRUM REPRESENTATION
1
X
kD 1
1
X
bk e j 2f0 k t D
bk e
j 2f0 k t
kD 1
1
1
X
X
ak j 2f0 .kC1/t
e
C
2j
kD 1
kD 1
1
X
1
D
2j
a`
1e
`D 1
Finally, we see that the Fourier Series coefficients fbk g for y.t / are
bk D
C
M
DRO
ak
akC1
1
1
X
j 2f0 .`/t
ak j 2f0 .k
e
2j
a`C1 e
1/t
j 2f0 .`/t
`D 1
!
for all k
2j
(3.49e)
(3.49f)
(3.50)
Example 3-9: Rectified Sinusoid
The product of a zero-one square wave sz .t / and a sinusoid
y.t / D sz .t / sin.2f0 t /
is a rectified sinusoid. When the frequency of the sinusoid equals the fundamental frequency of the square˙wave,
make a plot of y.t /. Determine whether the resulting plot is a half-wave or full-wave rectified sine.
DRO
C
M
EXERCISE 3.15: Find the Fourier Series coefficients of the half-wave rectified sine signal by using the
fact that the signal can be expressed as a product of a square wave and a sinusoid.
Answer: The odd and even indexed Fourier coefficients are treated separately: bk for k odd depends on ak for
k even, and vice versa. Since all ak are zero for k D ˙2; ˙4; : : : , only a0 D 21 can contribute to bk for k odd.
Thus, bk D 0 for k D ˙3; ˙5; : : :, and
b1 D
a0
a2
2j
D
1
D
4j
0:25j
and
b
For k even we use the known ak ’s for the square wave:
ak 1 akC1
j
bk D
D
2j
.k 1/
1
D
j
.k C 1/
a
2
2j
a0
D
1
D 0:25j
4j
1
1
D 2
2j
.k
1/
DRO
C
M
EXERCISE 3.16: If a periodic signal has Fourier Series coefficients where all the odd-indexed ones are
zero, explain why the fundamental frequency has been chosen incorrectly. Determine the correct fundamental
frequency and also redefine the Fourier coefficients for the new f0 .
Answer: Rather than give a general proof, we generate an example where f0 D 3 Hz and the Fourier coefficients area
(
.1 C . 1/k / for k D 0; ˙1; ˙2; ˙3; ˙4
ak D
0
elsewhere
It should be easy to verify that a1 D 0, a3 D 0, as well as all other odd-indexed ak ’s. Then the signal can be
written out using the Fourier synthesis summation
x.t / D 2 C 2e j 2.2/.3/t C 2e j 2.
c H. McClellan, R. W. Schafer, & M. A. Yoder
J.
2/.3/t
C 2e j 2.4/.3/t C 2e j 2.
4/.3/t
DRAFT, for ECE-2026 Fall-2012, September 8, 2012
78
CHAPTER 3. SPECTRUM REPRESENTATION
The true fundamental frequency is f0 D gcdf6; 6; 12; 12g D 6 Hz. With respect to 6 Hz the formula for
x.t/ consists of DC plus the first and second harmonics. The relabelled Fourier coefficients are
(
2 for k D 0; ˙1; ˙2
aO k D
0 elsewhere
DRO
C
M
EXERCISE 3.17:
Find the Fourier Series coefficients of the full-wave rectified sine signal by using
the fact that the signal can be expressed as the sum of the half-wave rectified sine plus a shifted version of the
half-wave rectified sine, i.e.,
xf .t / D xh .t / C xh .t T =2/
(3.51)
where T is the period of the half-wave rectified sine.
Answer: Denote the Fourier coefficients of the half-wave rectified sine as fbk g. The shifting property allows
us to combine the Fourier coefficients for the two terms on the RHS of (3.51)
(
2bk for k even
bk C bk e j.2=T /k.T =2/ D bk 1 C e j./k D bk 1 C . 1/k D
0
for k odd
Therefore, we can express the LHS of (3.51) as the following summation
xf .t / D
X
bk e
j.2=T /k t
keven
1
X
D
b2` e
j.2=T /.2`/t
`D 1
The fundamental period of the full-wave rectified sine is not T ; it is actually T =2. This is reflected in the fact
that the Fourier summation is missing all of its odd-indexed terms. Thus, we need to rewrite the exponent with
Tf which means we must replace T =2 with Tf
xf .t / D
1
X
b2` e
j.2=Tf /.`/t
`D 1
If we call the Fourier coefficients of the full-wave rectified sine signal fc` g, then
c` D b2` D
1
..2`/2
1/
D
1
.4`2
1/
` D 0; ˙1; ˙2; : : :
DRO
C
M
EXERCISE 3.18: Homework Problem? Find the Fourier Series coefficients of the full-wave rectified sine
signal by using the fact that the signal can be expressed as the product of a bipolar square wave and a sinusoid.
c H. McClellan, R. W. Schafer, & M. A. Yoder
J.
DRAFT, for ECE-2026 Fall-2012, September 8, 2012
© Copyright 2026 Paperzz