Title: By: Dr. Uri Mahlab
1Simulation in Digital Communication
By Dr. Uri Mahlab
2chapter 1 Signal and Linear Systems
By Dr. Uri Mahlab
3Fourier Series
Xn - are called the Fourier series coefficients
of the signal x(t)
4Open Matlab now
5Example 1
FT of ( )
x(-100.110) plot(x,sinc(x)) grid
Answer Matlab M-file ip_01_01
6Example 2 A program to compute the Fourier
Series Coefficients
a
b
A Periodic Signal
7Example 2.1
This function creates the rectangular function
x(-30.13) function yrect_function(x) yr
ect_function(x) generates a rectangular
signal y(xgt-1 xlt0)(x0)(xgt0
xlt1) plot(x,y) axis( -5 5 -1 2)
8Example 2.2
This function creates the triangular function
x(-30.13) function ylambda(x) ylambda(x
) generates a triangular signal y(x1).(xgt-1
xlt0)(x0)(-x1).(xgt0 xlt1) plot(x,y) axis(
-5 5 -1 2)
9This function computes the Fourier Series
coefficients
functionlambda a-3 b3 n24 tol0.05 xxf
series(function,a,b,n,tol) plot(abs(xx))
A-3 b3 n24 tol0.05 xxfseries(lambda,a,b,n
,tol,p1,p2,p3) plot(abs(xx))
10function xxfseries(funfcn,a,b,n,tol,p1,p2,p3) FS
ERIES Returns the Fourier series
coefficients. XXFSERIES(FUNFCN,A,B,N,TOL,P1,P2
,P3) funfcnThe given function, in an
m-file. It can depend on up to three
parameters p1,p2, and p3. The function is
given over one period extending from 'a' to
'b' xxvector of length n1 of Fourier
Series Coefficients, xx0,xx1,...,xxn. p1,p2,
p3parameters of funfcn. tolthe error
level. jsqrt(-1) args for nn1nargin-5
argsargs,',p',int2str(nn) end argsargs,')'
tb-a xx(1)eval('1/(',num2str(t),').quad(funf
cn,a,b,tol,',args) for i1n
newfun'exp(-j2pix(',int2str(i),')/(',num2str
(t),')).',funfcn xx(i1)eval('1/(',num2str(
t),').quad(newfun,a,b,tol,',args) end
11Magnitude and phase spectra
x(-30.13) function ylambda(x) ylambda(x
) generates a triangular signal y(x1).(xgt-1
xlt0)(x0)(-x1).(xgt0 xlt1) plot(x,y) axis(
-5 5 -1 2)
Determine and plot the discrete magnitude and the
phase spectra of the periodic signal x(t) with a
period equal 8 and defined as
Answer Matlab M-file ip_01_02
12Magnitude and phase spectra 3
Determine and plot the discrete magnitude and the
phase spectra of the periodic signal x(t) with a
period equal 8 and defined as
Answer Matlab M-file ip_01_03
13Periodic Signal Linear Systems
Linear System
14Example 4 filtering of periodic Signals
- Determine the Fourier Series coefficients of
x(t). - Plot the discrete spectrum of x(t)
- Plot the discrete spectrum of the output y(t).
Answer Matlab M-file ip_01_04
15(No Transcript)
16Fourier transform
17Fourier transforms properties
Linearity
Duality
Time Shift
Scale
18Fourier transforms properties continue
Modulation
Differentiation
Convolution
Parsevals relation
19Example 5 Fourier Transform
Plot the magnitude and the phase spectra of
signals x1(t) and x2(t).
x1(t)
x2(t)
1
1
1
2
1
-1
Answer Matlab M-file ip_01_05
20Sampling theorem
samples(1 1 -1 2 -2 1 2) xsinc(t3)sinc(t2)-s
inc(t1)2sinc(t) -2sinc(t-1)sinc(t-2)
2sinc(t-3)
Answer sincuri.m
21Example 6Analytical and numerical derivation
of the Fourier transform
X(t)
1
0
-2
-1
1
2
- Determine the Fourier transform of x(t)
analytically and plot the - spectrum of x(t).
- Determine the Fourier transform numerically (by
Matlab) and - plot the spectrum of x(t)
Answer Matlab M-file ip_01_06
22Example 7LTI system analysis in the frequency
domain
X(t)
h(t)
-2 0 1 3 4
- Determine the FFT of the Signal
- If the Signal is passed through an ideal LPF
with BW of 1.5 Hz - find the output of the filter and plot it.
- If the signal is passed through a filter whose
impulse response is - h(t) derive the expression of the filter output.
Answer Matlab M-file ip_01_07
23Power and Energy
Power Spectral density
24Example 8Power and power spectrum
- The signal x(t) has a duration of 10 and is the
sum of two - sinusoidal signals of unit amplitude one with
frequency of - 47Hz, and the other with frequency 219hz.
- The signal is Sampled at a rate of 1000
samples/sec. - Find the power content and the power spectral
density for this signal
Answer Matlab M-file ip_01_08
25Lowpass equivalent of bandPass Signals
Analytical Signal
Hilbert transform of x(t)
26(No Transcript)
27Envelope
Phase
28Matlab M-file analytic(x) Returns the
analytic signal corresponding to signal x
Matlab M-file loweq(x) Returns the lowpass
equivalent of the signal x
Matlab M-file quadcomp(x) Returns the in
phase and quadrature components of the signal x
Matlab M-file env_phas(x) Returns the
envelope and phase of the band pass signal x
29Example 9Bandpass to lowpass transformation
- The signal x(t) is given as
- Plot this signal and its magnitude spectrum.
- With fo200Hz, find the lowpass equivalent and
plot its - magnitude spectrum.
- Plot the in phase and the quadrature components
and the envelop - of this signal
- Repeat for fo100Hz
Answer Matlab M-file ip_01_09