0% found this document useful (0 votes)
13 views

Lab 3

This document provides instructions for lab 3 on Fourier series and frequency transfer functions. The objectives are to learn Fourier series representations of periodic signals using Simulink and frequency transfer functions of linear systems. Tutorial 1 involves designing a Simulink model to approximate the Fourier series of a square wave signal by summing scaled sines of different frequencies. The lab tasks require applying this to find the Fourier series of another square wave and implementing it in Simulink. The document outlines the necessary mathematical background and steps to complete the tasks and objectives of the lab.

Uploaded by

ARSLAN HAIDER
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Lab 3

This document provides instructions for lab 3 on Fourier series and frequency transfer functions. The objectives are to learn Fourier series representations of periodic signals using Simulink and frequency transfer functions of linear systems. Tutorial 1 involves designing a Simulink model to approximate the Fourier series of a square wave signal by summing scaled sines of different frequencies. The lab tasks require applying this to find the Fourier series of another square wave and implementing it in Simulink. The document outlines the necessary mathematical background and steps to complete the tasks and objectives of the lab.

Uploaded by

ARSLAN HAIDER
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

TITLE : Fourier Series and Frequency Transfer Function

DATE OF
: Fall 2023
EXPERIMENT

LAB NUMBER : 3

NAME : _______________________________

ROLL NO : ___________________
COMMUNICATION SYSTEMS LAB (308202)

Instructions:
1. You are required to complete and submit ALL the tasks given at the end of each tutorial during
your lab timings strictly.
2. At the end of the lab manual, you will find some experiments which are required to be done as
home assignment and submitted before the next lab.
3. Please show your complete work, through Simulink models and results for both lab performance
(submitted during lab timings) and lab report (report submitted as home assignment).
4. Save your models after performing each step to avoid loss of your work due to any reason.
Objective:
In this lab, you will learn to conduct simulation in Simulink/MATLAB after obtaining:
a. Fourier series of periodic signals.
b. Frequency transfer function of a linear system.
3.1 Periodic Signals and Fourier Series
A periodic function is a function that repeats itself exactly after some given period, or cycle. We represent
the definition of a periodic function mathematically as:
𝑓(𝑡) = 𝑓(𝑡 + 𝑇0 ), (3.1)
where 𝑇0 > 0 represents the period. Any function that satisfies equation (3.1) is a periodic signal. Now,
any periodic function 𝑓(𝑡) with an arbitrary time period 𝑇0 can be represented by a linear combination of
harmonic sinusoids, as follows:

𝑎0
𝑓(𝑡) = + ∑(𝑎𝑛 cos(𝑛𝜔0 𝑡) + 𝑏𝑛 sin(𝑛𝜔0 𝑡)), (3.2)
2
𝑛=1
2𝜋
where 𝜔0 = is the fundamental frequency in rad/seconds. The 𝑎𝑛 and 𝑏𝑛 – Fourier coefficients specify
𝑇0
that “how much” of the sinusoids cos(𝑛𝜔0 𝑡) and sin(𝑛𝜔0 𝑡) are present in 𝑓(𝑡). Equation (3.2) also shows
1
that any combination of sinusoids of frequencies 0, 𝑓0 , 2𝑓0 , … , 𝑛𝑓0 is a periodic signal of period 𝑇0 = 𝑓0
regardless of the values of amplitudes 𝑎𝑛 and 𝑏𝑛 of these sinusoids. By changing the values of 𝑎𝑛 and 𝑏𝑛
in equation (3.2), we can construct a variety of periodic signals, all with same period 𝑇0 . These three
coefficients are computed as:
1
𝑎0 = ∫ 𝑓(𝑡) 𝑑𝑡, (3.3a)
𝑇0
𝑇0
2
𝑎𝑛 = ∫ 𝑓(𝑡) cos(𝑛𝜔0 𝑡) 𝑑𝑡, (3.3b)
𝑇0
𝑇0

Lab #3: Fourier Series and Frequency Transfer Function Page 2 of 7


COMMUNICATION SYSTEMS LAB (308202)

2
𝑏𝑛 = ∫ 𝑓(𝑡) sin(𝑛𝜔0 𝑡) 𝑑𝑡. (3.3c)
𝑇0
𝑇0

3.2 Frequency Transfer Function of Linear Systems


If an eigenfunction such as complex sinusoid of frequency 𝜔0 rad/s—that is, exp(𝑗𝜔0 𝑡) is applied at the
input of a linear system, the steady-state output is also a complex sinusoid of the same frequency 𝜔0 rad/s.
The amplitude and phase of output complex sinusoid are determined by the system’s frequency response.
In other words, the output 𝑦(𝑡) can be expressed as
𝑦(𝑡) = 𝐻(𝜔0 ) exp(𝑗𝜔0 𝑡), (3.4)
where 𝐻(𝜔0 ) is a complex-valued function of the input frequency 𝜔0 . Rewrite 𝑦(𝑡) as:

𝑦(𝑡) = |𝐻(𝜔0 )| exp(𝑗∠𝐻(𝜔0 )) exp(𝑗𝜔0 𝑡), (3.5a)

= |𝐻(𝜔0 )| exp(𝑗𝜔0 𝑡 + 𝑗∠𝐻(𝜔0 )). (3.5b)

Clearly, the magnitude and the phase of the output complex sinusoid 𝑦(𝑡) are influenced by |𝐻(𝜔0 )| and
∠𝐻(𝜔0 ), respectively. The general function 𝐻(𝜔), which is the Fourier transform of the system impulse
response, is called the frequency transfer function. The concept will be further explained through tutorial
#2 (Section 3.4).
3.3 Tutorial #1: Designing a Fourier-Series System in Simulink
Consider the following square wave signal:

Figure 3.1 A square wave periodic signal.


From equation set (3.3):
0 𝜋 0 𝜋
1 1 1 1
𝑎0 = ∫ 𝑓(𝑡) 𝑑𝑡 + ∫ 𝑓(𝑡) 𝑑𝑡 = ∫ 1 𝑑𝑡 + ∫ 0 𝑑𝑡 = 1, (3.6a)
𝜋 𝜋 𝜋 𝜋
−𝜋 0 −𝜋 0
0 𝜋
1 1
𝑎𝑛 = ∫ 𝑓(𝑡) cos(𝑛𝑡) 𝑑𝑡 + ∫ 𝑓(𝑡) cos(𝑛𝑡) 𝑑𝑡,
𝜋 𝜋
−𝜋 0
0 𝜋
1 1
= ∫ 1 cos(𝑛𝑡) 𝑑𝑡 + ∫ 0 cos(𝑛𝑡) 𝑑𝑡 = 0. (3.6b)
𝜋 𝜋
−𝜋 0

Lab #3: Fourier Series and Frequency Transfer Function Page 3 of 7


COMMUNICATION SYSTEMS LAB (308202)

0 𝜋
1 1
𝑏𝑛 = ∫ 𝑓(𝑡) sin(𝑛𝑡) 𝑑𝑡 + ∫ 𝑓(𝑡) sin(𝑛𝑡) 𝑑𝑡,
𝜋 𝜋
−𝜋 0
0 𝜋
1 1 1
= ∫ 1 sin(𝑛𝑡) 𝑑𝑡 + ∫ 0 sin(𝑛𝑡) 𝑑𝑡 = − (1 − cos(𝑛𝜋)). (3.6c)
𝜋 𝜋 𝑛𝜋
−𝜋 0

Thus,

0, 𝑛 even
𝑏𝑛 = { 2 (3.7)
− , 𝑛 odd
𝑛𝜋

From equations (3.2), (3.6) - (3.7), the Fourier series of the signal shown in Figure 3.1 is given as:

1 2 1 1 1
𝑓(𝑡) = − [sin 𝑡 + sin(3𝑡) + sin(5𝑡) + sin(7𝑡) + ⋯ ], (3.8)
2 𝜋 3 5 7
2𝜋
where 𝜔0 = = 1.
𝑇0

The objective of this tutorial is to check, in Simulink, whether the right-hand side of equation (3.8)
converges to 𝑓(𝑡). Since the right-hand side of (3.8) is the sum of infinite number of scaled sine waveforms
of different frequencies, it is impossible to generate it exactly in Simulink. Thus, a partial-sum
approximation will be performed.
i. Design a Simulink model as shown in Figure 3.2.

Figure 3.2 Design for a partial-sum approximation of 𝑓(𝑡).


ii. Ensure proper arrangement of Sine Wave blocks so that their names occur in numerical order, as
shown in Figure 3.2.
iii. Set the parameters (such as amplitude, phase and frequency) of EACH Sine Wave properly
according to equation (3.8), with following additional settings:
Sine type: Time based,
Time (t): Use simulation time,

Lab #3: Fourier Series and Frequency Transfer Function Page 4 of 7


COMMUNICATION SYSTEMS LAB (308202)

Bias: 0,
Sample time: 0.01.
iv. Run the simulation for 20 seconds. Make sure that Layout of the Scope block is properly set to
display all four signals separately.
v. After the simulation completes, double click on the Scope icon to view the waveform.
vi. Document your observations on the Fourier series approximation of the periodic square wave
as the number of sinusoids increases in the sum. Assess both the shape and the ripples in the
approximated waveform.
At the end of this tutorial, you should be able to implement a Simulink model for partial-sum Fourier Series
of a periodic signal and analyze the results.
Task #1
i. Consider a square wave as shown in Figure 3.3.
ii. Set 𝑇0 to the last two digits of your student ID/registration number. For example, if your student
ID is 18040190, then 𝑇0 = 90. Calculate the subsequent frequency 𝜔0 .
iii. Find out Fourier series of the subsequent signal and implement a partial-sum Fourier Series model
in Simulink using equation set (3.3). The derivation of Fourier series shall be part of your lab
performance.

Figure 3.3 A square wave periodic signal for the task in Section 3.4.

iv. Record the remaining work (Simulink model, Scope’s display, Sine Wave blocks settings etc.).
3.4 Tutorial #2: Testing of Frequency Transfer Function in Simulink
Consider an RC low-pass filter shown in Figure 3.4.

Figure 3.4 RC low-pass filter.

Lab #3: Fourier Series and Frequency Transfer Function Page 5 of 7


COMMUNICATION SYSTEMS LAB (308202)

With 𝑓(𝑡) and 𝑦(𝑡) defining the input and output voltages, respectively, of the RC circuit shown, their
relationship can be defined through the following differential equation:

𝑑 𝑦(𝑡)
𝑅𝐶 + 𝑦(𝑡) = 𝑓(𝑡). (3.9)
𝑑𝑡

Plugging 𝑓(𝑡) = exp(𝑗𝜔0 𝑡), and 𝑦(𝑡) = 𝐻(𝜔0 ) exp(𝑗𝜔0 𝑡) in equation (3.9), yields:

1 1
𝐻(𝜔0 ) = = | | ∠ − tan−1(𝜔0 𝑅𝐶), (3.10)
1 + 𝑗𝜔0 𝑅𝐶 √1 + (𝜔 0 𝑅𝐶)
2

to be the frequency transfer function of the RC circuit shown in Figure 3.4.


The objective of this tutorial is to check and to implement the model of RC circuit of Figure 3.4 in Simulink.
You will need Simulink toolbox SimPowerSystems for this tutorial.
i. Design a Simulink model as shown in Figure 3.5 by following the given steps:
a. Open a new model in Simulink.
b. Search and add powergui, Sine Wave, Controlled Voltage Source, two Series RLC
Branch, Voltage Measurement, and Ground blocks to your model.
c. Rotate any block by right-clicking on it and selecting appropriate option from the pop-
up menu.
ii. Set the following parameters in the two RLC branches to create Figure 3.4 design in the Simulink
model of Figure 3.5.
a. For the first Series RLC Branch, select Branch type: R and Resistance (Ohm) = 500.
b. For the second Series RLC Branch (rotated clockwise by 90ο as in Figure 3.5), select
Branch type: C and Capacitance (F) = 1XXXe-6, where XXX = the last three digits of
your student ID/ registration number.

Figure 3.5 Initial Simulink design for RC low pass filter of Figure 3.4.

Lab #3: Fourier Series and Frequency Transfer Function Page 6 of 7


COMMUNICATION SYSTEMS LAB (308202)

iii. Set the Frequency: 10 rad/s in the Sine Wave block and run the simulation for 2 seconds and
display the result on the Scope.
iv. Measure the output signal frequency and compare it with the input frequency. Also note the
difference in their amplitudes.
v. Now re-set the Frequency: 120 rad/s in the Sine Wave block and after running the simulation for
0.2 seconds, compare the input and output signal.
Task #2
Following the steps given in above tutorial, make necessary amendments to develop an RL circuit. Assume
R = 500 Ω and L = 3 H. Take measurement across both R and L at two different (high and low) frequencies.
What type of filter is this?
3.5 Experiments:
i. Consider the Simulink design model developed in Tutorial #2. Keep the same values for resistor
and capacitor.
a. For each of the frequencies 𝜔 given in the first column of Table 3.1, calculate |𝐻(𝜔)| by
using equation (3.10) and fill in the second column. You may need to change the simulation
run time for every frequency to have a proper display on Scope.
b. Measure the output signal amplitude from the model of the RC low-pass filter in Simulink
and complete the third column of the Table 3.1. Is the measured value different than the
calculated value? Why?
ii. To the simulink model of experiment (i), give the periodic input signal generated in tutorial #1
(partial-sum Fourier Series) of this lab. Is the output signal peridoic? Why?
Input Observed |𝑯(𝝎)| from Scope
Calculated |𝑯(𝝎)| from equation
frequency 𝝎 𝑽𝒐𝒖𝒕
(3.10) |𝑯(𝝎)| =
[rad/s] 𝑽𝒊𝒏
0
5
10
20
40
80
120

Lab #3: Fourier Series and Frequency Transfer Function Page 7 of 7

You might also like