Академический Документы
Профессиональный Документы
Культура Документы
Submitted by
Farzana Latif (08 TL 04)
Submitted To
Sir M. Abdullah
Department
Telecom (morning)
6th semester (3rd year)
Session (2008-2012)
EXPERIMENT # 1
Objective:
To become familiar with creating signals in MATLAB and then plotting them.
Part 1: Continuous-Time Signals
You are to plot three different signals using MATLAB.
x 1 ( t )=4 e−t /5
x 2 [ n ] =sin ( 2Nπn ) where N = 10 (this is the period)
x [ n ]=x 1 [ n ] x 2 [ n ]
Use the subfigure command to create two separate plots on the same figure. In the upper region
of this figure, plot x1[n] and x2[n] overlaying each other. In the lower portion of this figure, plot
x[n]. Only plot these sequences on the range 0 to 20 samples.
On the upper plot, do not create a legend to distinguish the two traces, but instead plot the two
traces with different markers.
Part 3:
Given a pair of sequences, use discrete convolution to find the response to the input x[n] of the
linear time-invariant system with impulse response h[n].
x[n]=[1 0 0 0 1 1 1 1 0 0 ]
y[n]= [1 1 0 1 ]
i. Use PLOT command to plot the x and y
ii. Write a MATLAB function to compute the convolution of the two finite-length
sequences and plot the results.
EXPERIMENT #2
Objective:
Digital filter frequency response
Solution
EXPERIMENT # 3
Objective:
Z-Transform in Matlab
Assume we have a transfer function in the z-domain given by
−1
z z
X ( z )= −1 −2
= 2
1−0 .25 z −0 .375 z z −0 .25 z−0 . 375 .
z c1 z c2 z 0 .8 z −0 .8 z
X ( z )= = + = +
( z −0 .75 ) ( z+0 .5 ) ( z−0 . 75 ) ( z+ 0 .5 ) ( z−0 . 75 ) ( z+ 0 .5 ) .
>> roots(den)
ans =
0.7500
-0.5000
We can find the impulse response (or inverse z-transform) of the polynomial based on the power series
expansion method using the “impz” function
h = impz(num,den,N) where N is the number of terms or coefficients to compute
>> h = impz(num,den,10)
h=
0
1.0000
0.2500
0.4375
0.2031
0.2148
0.1299
0.1130
0.0770
0.0616
We can also plot the frequency response of a particular polynomial with freqz
z
X ( z )= 2
For z −0 . 25 z −0 .375 we would enter
>> num = [0 1 0];
freqz(num,den,N)
where ‘num’ are the numerator coefficients, ‘den’ are the denominator coefficients, and ‘N’ is the number
of points to use in the plot which goes from 0 to . An alternative form is to use
[H,f] = freqz(num,den,N,Fs)
plot(f, abs(H))
‘num’ and ‘den’ are the same. ‘Fs’ is the sampling frequency. ‘N’ values between 0 and Fs are
calculated. The response data versus frequency are stored in H.
>> plot(f,abs(H))
EXPERIMENT # 4
Objective
Z-transform and Impulse response
Description
a) Channel Response shown in figure 1.
0.8
0.6
0.4
Imaginary Part
0.2
-0.2
-0.4
-0.6
-0.8
-1
-1 -0.5 0 0.5 1
Real Part
c) Also Find y[n] ,when x[n]=[1 0 1 2 3 5 0 4 5] and plot them using MATLAB
y[n] =x[n]*h1[n]
y[n] =x[n]*h1[n]*h2[n]
Solution
a) Mathematical expression
For H(z)
As zeros are the roots of numerator of H(z) and poles are roots of denominator of H(z) so,
z 1=−0.5−0.5 i
z 2=−0.5+ 0.5i
p1=0.5+ 0.5i
p2=0.5−0.5 i
b) Mathematical expression
For H(z)
As zeros are the roots of numerator of H(z) and poles are roots of denominator of H(z) so,
p1=−0.5−0.5 i
p2=−0.5+0.5 i
z 1=0.5+0.5 i
z 2=0.5−0.5 i
For H(exp(jw))
− jω −2 jω
jω 1−e +0.5 e
H 2 ( e )=
1+e− jω +0.5 e−2 jω
Y ( z ) 1−z −1 +0.5 z−2
=
X (z ) 1+ z−1 +0.5 z−2
For h[n]
c) Mathematical expression
EXPERIMENT # 5
Objective
Digital Processing of Continuous Signals
Description
Digital processing of analog signals has following advantages over its analog counterpart.
Programmable Operations
Greater flexibility
Higher order of precision
Better performance.
An analog signal can be converted into digital using the following steps
Sampling
Quantization
Digital Coding
Nyquist Sampling Theorm explains, the minimum sampling rate to avoid the Aliasing Effect,
should be equal to twice the highest frequency component of the signal.
Matlab Code
% Illustration of the Sampling Process
Experiment No #6
Objective
Implement the Given Block Diagram in MATLAB.
(QUESTION N0.1)
0.5
-0.5
-1
0 0.5 1 1.5 2 2.5 3 3.5 4
4
x 10
800
600
400
200
0
0 0.5 1 1.5 2 2.5 3 3.5 4
4
x 10
Figure 01: Input Signal
0.5
-0.5
-1
0 0.5 1 1.5 2 2.5 3 3.5 4
4
x 10
800
600
400
200
0
0 0.5 1 1.5 2 2.5 3 3.5 4
4
x 10
Figure 02: Input Signal after Low pass filter
0.5
Amplitude
-0.5
-1
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Time index n 4
x 10
400
300
200
100
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
4
x 10
Figure 03: Input Signal after Down Sapling
0.5
Amplitude
-0.5
-1
0 0.5 1 1.5 2 2.5 3 3.5 4
time index n 4
x 10
400
300
200
100
0
0 0.5 1 1.5 2 2.5 3 3.5 4
4
x 10
0.5
-0.5
-1
0 0.5 1 1.5 2 2.5 3 3.5 4
4
x 10
800
600
400
200
0
0 1 2 3 4 5 6 7 8
4
x 10
Figure 05: Output Signal after Low Pass filter
Experiment No #7
Objective
To become familiar with creating Filters in MATLAB
Impulse response of IIR Low pass filter using Chebyshev 1, Fc=4 KHz
Impulse response of IIR Low pass filter using Elliptic, Fc=4 KHz
Experiment No 8
Objective: To become familiar with creating Filters in MATLAB
Solution
Impulse response of FIR Low pass filter using windowing method, Fc=4 KHz
Impulse response of FIR Low pass filter using Complex Equiripple, Fc=4 KHz
Impulse response of FIR Low pass filter using Least Square Method, Fc=4 KHz