Tutorial 2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Tutorial 2

Q1. Study the MATLAB code in Listing 1, comment on the purpose of all relevant lines of the
codes. Simulate and analyze the results. Plot the signal and Fourier Transform graphs.

Listing 1
close all
clear
clc

t = -2:0.01:2;
f = -2:0.01:2;

n = 1;
for time = t;

if time < 0
u(n) = 0;
elseif time >= 0
u(n) = 1;
end
n = n+1;
end
figure(1),
plot(t,u)

a = 0.5;
x = exp(-a*t);

figure(2),
plot(t,x)

x_u = exp(-a*t).*u;
figure(3), plot(t,x_u)

X = 1 ./ (a + i*2*pi*f);
magX = abs(X);
phaseX = angle(X);

figure(4)
plot(f,magX,f,phaseX)

Q2. Show that the Fourier transform of 𝑥(𝑡) = 𝑡𝑒 !"# 𝑢(𝑡) where u(t) is the step function is given
$
by 𝑋(𝜔) = ("&'()! for a > 0. Design a code to simulate the results. Analyze and interpret the
results. Plot the signal and Fourier Transform (spectral) graphs.

(
Q3. Show that the inverse Fourier transform of 𝑋(𝜔) = 𝑟𝑒𝑐𝑡 ,*( - illustrated in Figure 1 is given
"
(
by 𝑥(𝑡) = +" 𝑠𝑖𝑛𝑐(𝜔, 𝑡). Design a code to simulate the results. Analyze and interpret the
results. Plot the signal and Fourier Transform graphs.
an = 0 and bn = x(t) sin nω0 t dt (6.15)
T0 0
“06-Lathi-C06” D—R 2017/9/25
I L L 7.2 —Inverse15:54 —Fourierpage 609Transform
— #17 of a Rectangular Pulse
Observe that because of symmetry, the integration required to compute the coefficients need be
performed over only half the period.
Show that the inverse Fourier transform of X(ω) illustrated
If a periodic signal x(t) shifted by half the period remains unchanged except for a sign—that
in Fig. 7.17 is
is, if (ω0 /π)sinc (ω0 t). Sketch x(t).
" #
T0
x t− = −x(t)
2
then the signal is said to have a half-wave symmetry. It can be shown that for a signal with a
6.1 Periodic
half-wave symmetry, all the Signal
even-numbered X(v) by
Representation
harmonics Trigonometric
vanish Fourier
(see Prob. 6.1-6). Series
The signal in 609
1
Fig. 6.4a is an example of such a symmetry. The signal in Fig. 6.6a also has this symmetry,
although it is not obvious owing to a dc component. If we subtract the dc component of 0.5 from
this signal, the remaining signal has half-wave
x(t) symmetry. For this reason, this signal has only odd
harmonics and a dc component of 0.5.
t2 Figure 7.17 A frequency-domain
! " re
!5 !4 !3
!v0
!2 !1 0 1
v
2
v0
3 4
pulse5X(ω) = rectt
ω
2ω0
.
D R I L L 6.1 Compact Trigonometric
(a) 1Fourier Series
Figure
Find the compact trigonometric Fourier series for periodic signals shown in Fig. 6.7. Sketch
their amplitude and phase spectra. Allow Cn x(t)
to take on negative values if bn = 0 so that the
A Eqs. (6.14) and (6.15) for appropriate symmetry
phase spectrum can be eliminated. [Hint: Use
conditions.]
!4 !2 !1 1 2 4 t
!A
ANSWERS
Figure
(b) 2 Transform of a
D
1 R4I L L 7.3
"
1 Fourier
1 1
# General Sinusoid
(a) x(t) = − 2
cos π t − cos 2π t + cos 3π t − cos 4π t + · · ·
3 πfor Drills 6.14 and 6.6. 9
Figure 6.7 Periodic signals 16
Show ∞ cosn(ω0 t + θ ) ⇐⇒ π [δ(ω + ω0 )e−jθ + δ(ω − ω0 )ejθ ].
that
$
1 4 (−1)
Q4. Show that the Fourier
= + series
2
of 2thecos
signal
nπ t in Figure 2 is given by:
3 π n=1
n
2A % 1 1 1 &
(b) x(t) = sin π t −
sin 2π t + sin 3π t − sin 4π t + · · ·
π 2 3 4
6.1-3 Determining 2A the
% Fundamental 1 Frequency
1 and Period
7.2-1
= cosConnection ◦
(π t − 90 ) + cos (2π
π the results. Plot Between◦
the
t + 90 ) + cos
2 the relevant graphs.
3
(3πFourier
t − 90◦ ) and Laplace Transforms
WeDesign
have aseen
code to simulate
that every periodic signal can be& expressed as aAnalyze
sum of the results of
sinusoids anda determine
fundamental
how many harmonicsThe general
is adequate
1 (bilateral)
to represent
◦ Laplace
the transform
signal. of a signal x(t), according to Eq. (4.1), is
frequency ω0 and its harmonics.
+ 4
cos (4πOne may ask whether a sum of sinusoids of any frequencies
t + 90 ) + · · ·
represents a periodic signal. If so, how does one determine the period? # ∞ Consider the following
three
Q5. functions:
Review the simulation exercises to perform convolution.X(s) = x(t)e−st dt
−∞
!1 " !2 " ! "
x1 (t) = 2 + 7 cos 2 t + θ1 + 3 cos 3 t + θ2 + 5 cos 76 t + θ3
Setting s = jω in this equation yields
x2 (t) = 2 cos (2t + θ1 ) + 5 sin (πt + θ2 )
! √ " ! √ " # ∞
x3 (t) = 3 sin 3 2t + θ + 7 cos 6 2t + φ
X( jω) = x(t)e−jωt dt
−∞
Recall that every frequency in a periodic signal is an integer multiple of the fundamental
frequency ω0 . Therefore the X(
where ratio
jω)of=any two frequencies is of the form m/n, where m and n are
X(s)| s=jω . But, the right-hand-side integral defines X(ω), the Fourier tr
integers. This means that
x(t).the
Doesratio of mean
this any twothatfrequencies
the Fourieristransform
a rational can
number. When the
be obtained ratio
from theofcorrespondin
two frequencies is a rational
transformnumber, the frequencies
by setting s = jω? Inare said words,
other to be harmonically
is it true thatrelated.
X( jω) = X(ω)? Yes and
The largest number of which all the frequencies are integer multiples
−at
is true in most cases. For example, when x(t) = e u(t), its Laplaceis the fundamental
transform is 1/(s
frequency. In other words, the fundamental frequency is the greatest common factor
X( jω) = 1/( jω + a), which is equal to X(ω) (assuming a < 0). However, for (GCF) of the unit ste
all the frequencies in the series.
u(t), The frequencies
the Laplace transforministhe spectrum of x1 (t) are 1/2, 2/3, and 7/6 (we
do not consider dc). The ratios of the successive frequencies are 3:4 and 4:7, respectively. Because
1
both these numbers are rational, all the three frequencies inu(t) the ⇐⇒
spectrum areRe harmonically
s>0 related,
and the signal x1 (t) is periodic. The GCF, that is, the greatest number s of which 1/2, 2/3, and
7/6 are integer multiples, is 1/6.† Moreover, 3(1/6) = 1/2, 4(1/6) = 2/3, and 7(1/6) = 7/6.
Therefore the fundamental frequency is 1/6, and the three frequencies in the spectrum are the
third, fourth, and seventh harmonics. Observe that the fundamental frequency component is absent
in this Fourier series.

You might also like