In this assignment, you will:
- Use MATLAB to calculate the Fourier Series (FS) of periodic continuous signals.
- Synthesize a signal from its Fourier Series.
- Explore the Fourier Transform (FT) of continuous signals.
- Use MATLAB to compute and plot the FT.
- Explore the Discrete Time Fourier Series (DTFS) and Discrete Time
Fourier Transform (DTFT).
The prerequisite theory for completing this assignment can be found in Lecture6: Frequency Analysis.
This description of the Assignment includes code that you can borrow and/or use to complete the tasks. You should run the sample codes in MATLAB so that you can look at the output and ensure you understand how the code works. If you understand the operation of the code samples, you will find it easier to extend this to complete the tasks in the assignment.
You should upload a single PDF file to Moodle. This PDF file should include your MATLAB code, figures, and answers to all the tasks and the questions therein.
Task 1: Fourier Series (FS) Coefficients (Analytical Method)
In Lab 1, we saw how a periodic square wave can be generated (or synthesized) by combining various complex exponential functions having different frequencies and weights. We used the Fourier series synthesis equation to achieve this.
x
(
t
)
=
∑
n
=
−
N
N
X
n
e
j
2
π
n
f
0
t
x(t)=\sum_{n=-N}^N X_ne^{j2\pi nf_0t}
x(t)=n=−N∑NXnej2πnf0t
In this assignment, we will explore the Fourier series of the periodic triangular
wave shown in the following figure. The blue/red/purple portion of the signal
constitutes one full period.
Recall that the
n
t
h
n^{th}
nth FS coefficient for a function
x
(
t
)
x(t)
x(t) is given by
X
n
=
1
T
∫
0
T
x
(
t
)
e
−
j
2
π
n
f
0
t
d
t
X_n={1\over T}\int_{0}^T x(t)e^{-j2\pi n{f_0}t}dt
Xn=T1∫0Tx(t)e−j2πnf0tdt
where
T
T
T and
f
0
=
1
T
f_0={1\over T}
f0=T1 are the fundamental period and frequency of
x
(
t
)
x(t)
x(t),respectively. This is referred to as the analysis equation. Note that the weight
X
n
X_n
Xn represents the contribution that the complex exponential function
e
−
j
2
π
n
f
0
t
e^{-j2\pi n{f_0}t}
e−j2πnf0t with the frequency
n
f
0
nf_0
nf0 makes to the composition of
x
(
t
)
x(t)
x(t).
Clearly, the fundamental period and fundamental frequency of x ( t ) x(t) x(t) are T = 2 T = 2 T=2s and f 0 = 1 2 = 0.5 f_0={1\over 2} =0.5 f0=21=0.5 Hz, respectively.
Mathematical model of x ( t ) x(t) x(t)
Before we can use the analysis equation, we need to write down a description of
one period of
𝑥
(
𝑡
)
𝑥(𝑡)
x(t), which will be necessarily piecewise. Each coloured section is
described by a straight line over the relevant domain.
x ( t ) = { 2 t 0 ≤ t ≤ 0.5 − 2 ( t − 1 ) 0.5 ≤ t ≤ 1.5 2 ( t − 2 ) 1.5 ≤ t ≤ 2 x(t)= \left \{ \begin{array}{ll} 2t & 0\leq t\leq 0.5 \\ -2(t-1) & 0.5\leq t\leq 1.5 \\ 2(t-2) & 1.5\leq t\leq2 \end{array} \right. x(t)=⎩ ⎨ ⎧2t−2(t−1)2(t−2)0≤t≤0.50.5≤t≤1.51.5≤t≤2
Calculating FS Coefficients
Trivial Case: 𝒏 = 𝟎 𝒏 = 𝟎 n=0
- We now take the analysis equation from above and step through values of
n n n. The simplest case is when n = 0 n = 0 n=0. - This makes the exponent of the complex exponential
0
0
0 (because Font metrics not found for font: .
is 0 0 0 when 𝑛 = 0 𝑛 = 0 n=0). Thus, we have