Worksheet 2#
To accompany Unit 3.1 Trigonometric Fourier Series#
Colophon#
This worksheet can be downloaded as a PDF file. We will step through this worksheet in class.
An annotatable copy of the notes for this presentation will be distributed before the second class meeting as Worksheet 2 in the Week 3: Classroom Activities section of the Canvas site. I will also distribute a copy to your personal Worksheets section of the OneNote Class Notebook so that you can add your own notes using OneNote.
You are expected to have at least watched the video presentation of Unit 3.1: Trigonometric Fourier Series of the notes before coming to class. If you haven’t watch it afterwards!
After class, the lecture recording and the annotated version of the worksheets will be made available through Canvas.
Motivating Examples#
This Fourier Series demo, developed by Members of the Center for Signal and Image Processing (CSIP) at the School of Electrical and Computer Engineering at the Georgia Institute of Technology, shows how periodic signals can be synthesised by a sum of sinusoidal signals.
It is here used as a motivational example in our introduction to Fourier Series. (See also Fourier Series from Wolfram MathWorld referenced in the Quick Reference on Blackboard.)
To install this example, download the zip file and unpack it somewhere on your MATLAB path.
The Trigonometric Fourier Series#
Any periodic waveform
or equivalently (if more confusingly)
where
Evaluation of the Fourier series coefficients#
The coefficients are obtained from the following expressions (valid for any periodic waveform with fundamental frequency
Demo 1#
Building up wave forms from sinusoids.
% Setup working directory
clear vars
cd ../matlab
format compact; setappdata(0, "MKernel_plot_format", 'svg')
% Add install directory to path
path('/Users/eechris/MATLAB-Drive/EG-247-Examples/fseriesdemo',path)
% Run demo
fseriesdemo
Demo 2#
Actual measurements
Taken by Dr Tim Davies with a Rhode&Schwarz Oscilloscope.
Note all spectra shown in these slides are generated numerically from the input signals by sampling and the application of the Fast Fourier Transform (FFT).
1 kHz Sinewave#
Spectrum of 1kHz sinewave#
1 kHz Squarewave#
Spectrum of 1kHz square wave#
Clearly showing peaks at fundamental, 1/3, 1/5, 1/7 and 1/9 at 3rd, 5th and 7th harmonic frequencies. Note for sawtooth, harmonics decline in amplitude as the reciprocal of the of harmonic number
1 kHz triangle waveform#
Spectrum of 1kHz triangle waveform#
Clearly showing peaks at fundamental, 1/9, 1/25, 1/7 and 1/49 at 3rd, 5th and 7th harmonic frequencies. Note for triangle, harmonics decline in amplitude as the reciprocal of the square of
Odd, Even and Half-wave Symmetry#
Odd- and even symmetry#
An odd function is one for which
. The function is an odd function.An even function is one for which
. The function is an even function.
Half-wave symmetry#
A periodic function with period
is a function for whichA periodic function with period
, has half-wave symmetry if
Symmetry in Trigonometric Fourier Series#
There are simplifications we can make if the original periodic properties has certain properties:
If
is odd, and there will be no cosine terms so
If
is even, there will be no sine terms and . The DC term ( ) may or may not be zero.
If
has half-wave symmetry only the odd harmonics will be present. That is and is zero for all even values of (0, 2, 4, …)
Symmetry in Common Waveforms#
To reproduce the following waveforms (without annotation) publish the script waves.m.
Squarewave#

Average value over period
is …?It is an odd/even function?
It has/has not half-wave symmetry
?
Shifted Squarewave#

Average value over period
isIt is an odd/even function?
It has/has not half-wave symmetry
?
Sawtooth#

Average value over period
isIt is an odd/even function?
It has/has not half-wave symmetry
?
Triangle#

Average value over period
isIt is an odd/even function?
It has/has not half-wave symmetry
?
Symmetry in fundamental, Second and Third Harmonics#
In the following,
Fundamental#

Average value over period
isIt is an odd/even function?
It has/has not half-wave symmetry
?
Second Harmonic#

Average value over period
isIt is an odd/even function?
It has/has not half-wave symmetry
?
Third Harmonic#

Average value over period
isIt is an odd/even function?
It has/has not half-wave symmetry
?
Some simplifications that result from symmetry#
The limits of the integrals used to compute the coefficents
and of the Fourier series are given as which is one periodWe could also choose to integrate from
If the function is odd, or even or has half-wave symmetry we can compute
and by integrating from and multiplying by 2.If we have half-wave symmetry we can compute
and by integrating from and multiplying by 4.
(For more details see page 7-10 of the textbook)
Computing coefficients of Trig. Fourier Series in Matlab#
As an example let’s take a square wave with amplitude

Solution#
Solution: See square_ftrig.mlx. Script confirms that:
: function is odd : for even - half-wave symmetry
ft =
(4*A*sin(t))/pi + (4*A*sin(3*t))/(3*pi) + (4*A*sin(5*t))/(5*pi) + (4*A*sin(7*t))/(7*pi) + (4*A*sin(9*t))/(9*pi) + (4*A*sin(11*t))/(11*pi)
open square_ftrig
Note that the coefficients match those given in the textbook (Section 7.4.1).
Using symmetry - computing the Fourier series coefficients of the shifted square wave#

As before
We observe that this function is even, so all
coefficents will be zeroThe waveform has half-wave symmetry, so only odd indexed coeeficents will be present.
Further more, because it has half-wave symmetry we can just integrate from
and multiply the result by 4.
See shifted_sq_ftrig.mlx.
ft =
(4*A*cos(t))/pi - (4*A*cos(3*t))/(3*pi) + (4*A*cos(5*t))/(5*pi) - (4*A*cos(7*t))/(7*pi) + (4*A*cos(9*t))/(9*pi) - (4*A*cos(11*t))/(11*pi)
open shifted_sq_ftrig
Note that the coefficients match those given in the textbook (Section 7.4.2).