Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Experiment 3 - Fourier Synthesis of Periodic Waveforms

Department of Electrical Engineering and Electronics

September 2020, Ver.  5.0

Experiment speciications

Module(s)

ELEC270

Experiment code

3

Semester

1

Level

2

Lab location

Computer lab, third/fourth loor, check the lab timetable

Work

In groups

Timetabled time

7 hrs

Subject(s) of relevance

Fourier theorem

Assessment method

Report template

Submission deadline

7 days after lab date

Instructions:

Read this script before attempting the experiment.

The  Pre-Lab  Questions  should  be  answered  before  the  lab  day.    They  are available online and worth 10%.

The script questions should be answered while carrying out the experimental procedure.

The report template should be completed with the graphs and answers to the questions and submitted before the deadline.

1    Objectives

This experiment is aimed at:

. Studying quantitatively Fourier components of some basic periodic waveforms.

. Verifying that periodic waveforms can be synthesised by the superposition of sinusoids having harmonically related frequencies.

. Studying the efect ofilters on waveforms.

. Investigating the efect of phase on sound.

2    Apparatus

. A computer with Matlab

Students of the University of Liverpool can download a copy of Matlab for use in their personal computers/laptops from the following link:

https://www.liverpool.ac.uk/csd/software/software-downloads/#matlab

3    Introduction

In the ields of communications, signal processing and in electrical engineering more generally, a signal is any time-varying or spatial-varying quantity. A graph of the amplitude of this signal plotted against time produces a waveform (an example is shown in Figure 1).  Perhaps the most familiar type of waveforms is the sinusoid shown in Figure 1 (b). Here, the voltage (V) at any time (t) is given by the equation:

 

Figure 1: Examples of waveforms.


V (t) = Vosin(2πft + φ)                                                (1)

where Vo  is the amplitude of the sinusoid, f is the frequency and φ is the phase angle measured in radians.

It may be seen from the igure that this sinusoidal waveform is periodic with period T, i.e. the waveform repeats itself after every T seconds, or V (t + nT) = V (t) for all t, where n is an integer.  The frequency f , measured in Hertz, and the period T are related by T = 1/f.  The phase angle determines the starting point of the sine wave at t = 0.

Analysis:

Many real-life signals are periodic but non-sinusoidal.  Examples are shown in Figure 2.  Fourier analysis is based on a theorem which states that periodic waveforms may be expressed as the sum of ininite simple sines and cosines  (plus possibly a constant).   If T  is the  period of a periodic signal f (t), which satisies certain conditions (normally satisied by signals of practical interest), then f (t) can be expressed as the sum of sine and cosine functions called a Fourier series that is uniquely deined by constants known as Fourier coe历cients. Hence:

 

Figure 2: Non-sinusoidal periodic waveforms.

f (t) = ao  +  an cos(2πnfot) +  bn sin(2πnfot)                            (2)

where fo  = 1/T and is termed as the fundamental frequency, ao , an  and bn  (for n = 1, 2, 3, . . . ) are the Fourier coe伍cients that can be calculated from the following expressions:

ao  = 0T f (t)dt                          (3) 

an  = 0T f (t) cos(2πnfot)dt                (4)

bn  = 0T f (t) sin(2πnfot)dt                 (5)

Equation 2 may also be written in an alternative form:

f (t) = co  +  cn cos(2πnfot + φn )

where cn  =4(an(2) + bn(2)) and tan φn  = -bn /an.

Note that f (t) has been expressed as the sum of a constant (DC) voltage co  and sinusoids of frequencies fo , 2fo , 3fo , 4fo  and so on.  The sinusoid at frequency  fo , i.e.  c1 sin(2πfot + φ1 ), is called the fundamental component of f (t).  The other sinusoids are called harmonic compo- nents; the component at frequency 2fo  being the second harmonic; the component at 3fo  being the third harmonic and so on.

Representing a periodic function f (t) as a series of sinusoids of speciic amplitudes is referred to as Fourier Analysis.

Example:  Fourier analysis of a triangular wave.

It is required to analyse a triangular wave (Figure 3) using Fourier analysis. First, we need to establish an expression for the time domain waveform f (t).  It can be concluded easily that f (t) can be written as:

 

Figure 3: Triangular wave.

f (t) = {

1 -   - 3

0

T

2

t

t

T   2   T

Now, using the deinition Equations 3, 4 and 5, we can ind that:

ao  = 0T/2  ( 1 -  dt + T/(T)2    - 3) dt = 0

and,

an  = {  nπ(8))2            n eve(n odd)n

Similarly, it can be found that bn = 0 for all n (the triangular wave has even symmetry).  Hence, the Fourier series for f (t) is:

f (t) =

or:

cos(2πfot) +

cos(2π3fot) +

 cos(2π5fot) + . . .]                        (10)

f (t) =  sin(2πfot + ) +  sin(2π3fot + ) + . . .                        (11)

The spectrum off (t) (frequency domain view) contains an ininite number of frequency compo- nents, hence, the bandwidth off (t) is ininite. A practical system would restrict f (t) to a inite bandwidth by removing all frequency components above certain upper limit.  This would distort the shape of the triangular waveform.  Fortunately, the irst few terms in the Fourier series of a triangular wave are the most important since the amplitudes, an , decrease rapidly as n increases.

Synthesis:

The addition of a series of harmonically-related sinusoids in order to generate a periodic wave- form is referred to as Fourier synthesis, and is the reverse process of analysis.

To synthesise a periodic wave with a good approximation, the sine and cosine waves with the proper amplitudes (as deined by the coe伍cients) must be electronically generated and com- bined up to the highest possible (and practical) value of n. The larger the value of n for which sine and cosine wave signals are generated the more nearly the synthesised waveform matches the desired waveform.  Figure 4 is an example of successive approximation of a sawtooth wave by adding harmonics with amplitude inversely proportional to the harmonic number.  The re- sultant waveform at each stage of addition is shown at right.

 

Figure 4: Successive approximation of sawtooth signal.

Fourier synthesis is used in many practical applications.  For example, it is used extensively in electronic music applications to generate waveforms that mimic the sounds of familiar mu- sical instruments. Although many musicians can create very clear-tones on their instruments,

all instruments have their own characteristic voice.  Voices are diferentiated by the shape of their associated sound waves. All instrument voices display an array of frequencies which sum together to produce a wave of characteristic shape.  Fourier synthesis is also employed in lab- oratory instruments known as function (signal) generators that are used to generate diferent waveforms for various purposes like electronic and communication systems test.

Example:  Fourier synthesis of a triangular wave with Matlab.

The triangular wave analysed above can be synthesised in Matlab by generating the right sine/cosine components at the right harmonic frequencies and calculating a weighted sum of them.   The  Matlab  script  below  shows  how  to  do  this  based  on the expressions  shown in equations 8, 9 and 10:

 

Figure 5: Matlab code to synthesise a triangular waveforms (3 harmonics).

Figure 6 compares the original triangular wave and its synthesised version with  1, 3, 5, and 9 harmonic components  (left-to-right,  top-to-bottom).   It  can  be seen that the synthesised waveform will reproduce the original triangular signal more accurately as more harmonic com- ponents are added. However, only the irst few terms in the Fourier series of a triangular wave are the most important.

4    Experimental work

As mentioned above, Fourier synthesis is a method of electronically constructing a signal with a speciic, desired periodic waveform.  It works by combining sinusoidal harmonics (signals at multiples of the lowest or fundamental frequency) in certain proportions.  In this experiment you are going to use Matlab to synthesis arbitrary waveforms using harmonics as shown in the example above (you can use this example as a reference).

 

Figure 6:  Original triangular wave and its synthesised version with 1, 3, 5, and 9 harmonic components (left- to-right, top-to-bottom).

4.1    Part A (30 Marks)

Objectives: To familiarise yourself with Fourier synthesis using Matlab and to investigate the extent of the accompanied error.

It is required to synthesise the following function:

f (t) = Vosin!t +

1

1

7

sin 7!t +

 sin 9!t)                    (12)

where Vo  is the maximum applicable voltage (you can select an arbitrary value, for example Vo  = 1 volt) and ! = 2πfo.

Requirements:

. Provide the Matlab code required to synthesise the waveform in equation 12 and the re- sulting waveform.  [5 marks]

Questions:

. Explain the features of the resulting waveform (peak-to-peak amplitude, symmetry, ripple, etc.)  [5 marks]

. How do you think the waveform would look if an unlimited number of harmonics was available (i.e. n goes to 1)?  To support your answer, provide a couple of igures along with their associated code.  [5 marks]

. Referring to Equation 3, what is the value of ao? [5 marks]

. Find an expression (in terms of n) for an  and bn. [5 marks]

. Plot the spectrum (frequency domain view) of f(t) using cn  =(a n(2) + bn(2)).  Provide the

igure and the Matlab code used to obtain it (you can use the stem function from Matlab to plot the frequency components).  [5 marks]

4.2    Part B (20 Marks)

Objective: To synthesise and study a sawtooth waveform.

The periodic waveform shown in Figure 7 is called a sawtooth function, and can be represented mathematically as follows:

f(t) = V - t,  0 ≤ t < T                                              (13)

Using, the Fourier analysis equations (Equations 3, 4 and 5), the Fourier coe伍cients can be shown to be ao =0, an =0 and bn =2V/πn.

 

Figure 7: Sawtooth waveform.

Requirements:

1. Write f(t) in Fourier synthesis form, i.e. as in Equation 2.  [4 marks]

2. Calculate the irst 10 sinewave coe伍cients (i.e. b1 , b2 , . . . b10 ). [4 marks]

3. Synthesise theirst 10 harmonics of this waveform and plot the result (provide your Matlab code as well).  [4 marks]

Questions:

. Plot in the same igure the original and synthesised sawtooth waveforms (provide your Matlab code).  Compare the resulting waveform with what you expected to see and discuss the results.  [4 marks]

. If the number of harmonics is reduced to 5, comment on the changes that will be observed practically.  [4 marks]

4.3    Part C (15 Marks)

Objective: To synthesise and study various waveforms.

Requirements:

1. Synthesise the waveforms below.  Plot the resulting waveforms and provide the Matlab code used to obtain the plots as well.  [1, 1, 1 and 2 marks, respectively]

(a) f1 (t) = sin ωot - ot - ot + . . ..

(b) f2 (t) = 0.1(cos ωot + cos 2ωot + cos 3ωot + cos 4ωot + . . .).

(c) f3 (t) = sin ωot -  cos 2ωot -  cos 4ωot -  cos 6ωot -  cos 8ωot -  cos 10ωot. (d) The waveform in (c) above with the fundamental component (sin ωot) switched of.

Question:

. Comment on your results for each waveform.  [3, 3, 2 and 2 marks, respectively]

4.4    Part D (15 Marks)

Objectives: To study and simulate the efect of a linear ilter on a wave.

The efect of a linear ilter on a certain waveform can be simulated by passing each Fourier component of that waveform through the ilter and observing the efect on the amplitude and phase of each separate component.

Requirements:

Consider an ideal square wave with frequency of 1 kHz expressed as a Fourier series:

V (t) =

sin(2πfot) +

sin(2π3fot) +

 sin(2π5fot) + . . .)                        (14)

1. Synthesise and plot this square wave (provide your Matlab code as well).  Calculate the percentage overshoot of the synthesised waveform (compared with the ideal waveform) at the discontinuity. How does this compare with the expected limit of 17.9%?  [2 marks]

2. What is the name of this overshoot? Explain it.  [2 marks]

3. Give the Fourier series in each case for the resulting waveform if the above square wave is used as an input for:

(a) A low-pass ilter with gain and phase responses as given in Figures 8 and 10 respec- tively.  [1 mark]

(b) A low-pass ilter with gain and phase responses as given in Figures 8 and 11 respec- tively.  [1 mark]

(c) A band-pass ilter with gain and phase responses as given in Figures 9 and 10 respec- tively.  [1 mark]

4. Synthesise the above waveforms and draw the obtained waveforms for ilters (a), (b) and (c), providing the Matlab code as well.  [3 marks]

Question:

. What is the fundamental frequency of the output from ilter (c)? Why?  [5 marks]

 

Figure 8: Low-pass ilter gain response.

 

Figure 9: Band-pass ilter gain response.

 

Figure 10: Example of a phase response.

 

Figure 11: Example of another phase response.

4.5    Part E (10 Marks)

Objectives: To listen to harmonics and chord, and investigate the efect of phase on sound.

In this part, you need to listen to the sound generated by the speaker of your computer when playing one or more harmonic components of a signal.

The example below shows how to play in Matlab atone of 500 Hz with a duration of 3 seconds. The amplitude can be modiied to adjust the volume.  The sampling frequency fs  = 44:1 kHz is commonly used by most computer sound cards.

 

Figure 12: Example of Matlab code to play a tone.

To plot a signal generated this way,  it is convenient to clip it irst.   Notice  that the tone generated in the example above has a frequency of 500 Hz and its period is 2 ms. This period is repeated 1500 times in 3 seconds, so plotting the complete signal will not be very useful.  The example below shows how to clip the signal generated in the example above to just 3 periods before plotting it.

 

Figure 13: Example of Matlab code to clip a long audio signal for plotting.

Consider the following wave with a fundamental frequency fo  = 500 Hz:

V (t) = 10 [sin(2πfot) + sin(2π2fot) + sin(2π3fot)]                            (15)

Requirements:

1. For the wave in equation 15, listen to harmonics 1, 2 and 3 individually then as a chord. Plot the chord waveform as well.  Provide the Matlab code used to listen to the harmon- ics/chord and plot the chord.  [3 marks]

2. Alter the phase of the third harmonic in equation 15 by 90 and repeat the tasks in the

point above.  [3 marks]

Questions:

. Discuss the efectofaltering the phase of the third harmonic, both on the sound and plot of the chord.  Do the sound or plot change as you alter the phase? Why?  [2 marks]

. What does the above tell you about the human ear?  [2 marks]