Sunteți pe pagina 1din 10

COMMUNICATION SYSTEM

LAB MANUAL

DEPARTMENT OF TELECOM ENGINEERING UNIVERSITY OF


ENGINEERING AND TECHNOLOGY TAXILA

COMMUNICATION SYSTEM LAB MANUAL Page 1


List of Experiments
1. Introduction to MATLAB
2. Signal transformation techniques
3. Square wave synthesis (Gibb’s Phenomenna), Power and energy of signals, Gaussian noise,
4. Auto-correlation sequence (ACS) and effect of time-shifting on auto correlation, Power
spectral density
5. Fourier Series, exponential fourier series
6. Fourier Transform
7. Simulation of communication system using MATLAB (amplitude modulation)
8. Single side band
9. Balanced Modulator
10. Frequency mixer
11. Introduction of Communication Systems Trainer, Envelop Detector using Trainer Modules
12. Phase Modulation and Demodulation on Trainer
13. Frequency Modulation and Frequency Demodulation using PLL method
14. Pre-Emphasis and De-Emphasis Filters
15. Pulse Modulation and Demodulation

COMMUNICATION SYSTEM LAB MANUAL Page 2


LAB 01

INTRODUCTION TO MATLAB
Objectives:

(a) To get acquainted with MATLAB’s environment.

(b) To use MATLAB as a calculator.

(c) To learn to create MATLAB variables and basic plots.

(d) To learn to initialize and manipulate vectors, matrices.

Pre-lab theory:

What is MATLAB?

MATLAB is a software program that allows you to do data manipulation and visualization, calculations,
math and programming. It can be used to do very simple as well as very sophisticated tasks. It
can solve large systems of equations efficiently and it is therefore useful for solving differential
equations and optimization problems. It also provides excellent means for data visualization and has
symbolic capabilities. Whilst simple problems can be solved interactively with MATLAB, its real
power shows when given calculations that are cumbersome or extremely repetitive to do by hand!

Where can we use MATLAB?

MATLAB is recognized as the interactive program for numerical linear algebra and matrix
computation. In industries, MATLAB is used for research and to solve practical engineering and
mathematical problems. Also, in automatic control theory, statistics and digital signal processing (Time-
Series Analysis) one can use MATLAB. The following tool boxes make it useful in soft computing at
various industrial and scientific areas:

(i) Neural Networks (ii) Optimization (iii) Genetic Algorithms (iv) Wavelets (v) Fuzzy Logic
(vi) Control systems (vi) Signal processing (vii) Communication Systems

Starting MATLAB

After logging into your account, you can enter MATLAB by double-clicking on the MATLAB shortcut
icon on the Window. After starting MATLAB, the MATLAB Desktop will appear. The default
three-part window looks similar to the figure below. The Desktop is also known as an Integrated
Development Environment (IDE). Clicking the Start button in the lower left-hand corner will display
a list of MATLAB tools, shortcuts, and documentation.

COMMUNICATION SYSTEM LAB MANUAL Page 3


Figure 1 : GUI view of MATLAB

𝟏 𝟐
1. Given that x=-5+9i and y=6-2i, Z=[ ] use MATLAB find the following
𝟑 𝟏 + 𝟐𝒊
A. x+y
B. x-y
C. xy
D. x/y
E. transpose of Z
F. inverse of Z
Solution:
Simple mathematical operations can be performed by following code:
x=-5+9i;
y=6-2i;
a=x+y;
b=x-y;
c=x*y;
d=x/y;
e=Z’
f=inv(Z)

display(a)
display(b)
display(c)
display(d)

COMMUNICATION SYSTEM LAB MANUAL Page 4


display(e)
display(f)

Result it displays is:


a=
1.0000 + 7.0000i
b=
-11.0000 +11.0000i
c=
-12.0000 +64.0000i
d=
-1.2000 + 1.1000i
e=
1 3
[ ]
2 1 + 2𝑖

2. Use MATLAB to compute: 6(35^1.4)+14^0.35


Solution:
We can write it as:
clc
clear all
e=6*35^1.4+14^0.35;
display(e)
It displays the result:
e=
873.1743

3. Define a 4x3 matrix with zeros everywhere except the first line that is filled with 1. Hint= use
ones and zeros command
Solution:
First we define 4x3 matrix then make it null matrix by replacing the rows and columns with zero. Then
using the same command for the replacement of first row from zero to one. Code is given below:
clc
clear all
close all
syms m;
matrix=[2,4,3;24,3,4;6,5,4;7,4,3];
display(matrix);
matrix(:,:)=0;
display (matrix);
matrix([1],:)=1;
display(matrix);
It displays the following result:
First matrix is matrix which we introduce, second one is null matrix and third one is required matrix.
matrix =

2 4 3
4 3 4
6 5 4

COMMUNICATION SYSTEM LAB MANUAL Page 5


7 4 3
matrix =
0 0 0
0 0 0
0 0 0
0 0 0
matrix =

1 1 1
0 0 0
0 0 0
0 0 0

4. Use MATLAB to solve following set of equations.


6x - 4y + 8z = 112
-5x – 3y +7z = 75
14x + 9y – 5z = -67
Solution:
To solve the ODE (ordinary differential equation) we use simple method here. We just take inverse of
matrix and multiply with constant matrix to get the values of X,Y and Z.

clc
clear all
close all
syms xyz;
A=[6 -4 8; -5 -3 7; 14 9 -5];
%X=[x;y;z];
B=[112;75;-67];
C=1./A;
X=C*B;
display(X);
Result that we get from above code is as follows:
X=
-8.4583
-56.9714
29.7333
5. Use MATLAB to find roots of 13x3 + 182x2 – 184x +2503 = 0
Solution:
To find the rootes of equation we just make its matrix and then apply command of ‘roots()’ which gives
roots in matrix form. Code for above equation is:

clc
clear all
close all
syms x;
A=[13 182 -184 2503];
r=roots(A);
display(r);

Roots we get from above code is:


r=

COMMUNICATION SYSTEM LAB MANUAL Page 6


-15.6850
0.8425 + 3.4008i
0.8425 - 3.4008i

LAB 01-B
INTRODUCTION TO PLOTTING COMMAND ON MATLAB
Objectives:

(a) To use MATLAB for plotting.

(b) To learn to create MATLAB basic plots.

Pre-lab theory:

MATLAB is very useful for making scientific and engineering plots. You can create plots of known,
analytical functions, you can plot data from other sources such as experimental measurements, and you
can analyze data, perhaps by fitting it to a curve, and then plot a comparison. MATLAB also has powerful
built-in routines for drawing contour and three-dimensional surface plots.

A vector is plotted against a vector, lengths of vectors must match

plot ─ for CT signals

stem ─ for DT signals

Two-dimensional line and symbol plots are created with the plot command. In its simplest form plot takes
two arguments

>> plot(xdata, ydata)

where xdata and ydata are vectors containing the data. Note that xdata and ydata must be the same length
and both must be the same type, i.e., both must be either row or column vectors. Additional arguments to
the plot command provide other options including the ability to plot multiple data sets, and a choice of
colors, symbols.

1. Use MATLAB to plot the functions y=4√(6x+1) and z=5e0.3x – 2x over the interval 0<x<1.5
Solution:
Code for plot of above two functions is:
clc
clear all
x=0:0.1:1.5;
y=4*sqrt(6*x+1);
z=5*exp(0.3*x)-2*x;
plot(x,y,'r');
hold on;
plot(x,z,'b');

COMMUNICATION SYSTEM LAB MANUAL Page 7


xlabel('x');ylabel('y=4sqrt(6x+1) z=5exp(0.3x)-2x');
gtext('y=red, z=blue');
title('Q3');

Its gives the result:

2. Use MATLAB to plot function s= 2 sin (3t+2) + √(5t+1) over the interval 0<t<5.
Solution:
Code for above function is:
clc
clear all
close all
symst;
t=0:0.1:5;
s=2*sin(3*t+2)+sqrt(5*t+1);
plot(t,s);
xlabel('t');ylabel('s=2sin(3t+2)+?(5t+1)');
gtext('s=2sin(3t+2)+?(5t+1)');
title('Q4');
It gives the graph:

3. Plot exp(-x) sin(8x) for 0≤ x ≤2Π


Solution:
Code for this function is:

COMMUNICATION SYSTEM LAB MANUAL Page 8


clc
clear all
close all
syms x;
x=0:0.1*pi:2*pi;
w=sin(8*x);
plot(x,w,'k');
title('Q5 (b)');
holdon;
q=exp(-x);
plot(x,q,'r');
title('Q5');
xlabel('Pi');ylabel('exp(-x) & sin(8x)');
It gives the graph like this:

4. Plot the function y= (4/Π) [(sin x) + (sin 3x)/3 + (sin 5x)/5 + (sin7x)/7] over the interval –Π<x<Π.
These are the first four terms of the Fourier Series representation of a square wave.
Solution:
Code for this function is as follows:
clc
clear all
close all
syms x;
x=-pi:0.1*pi:pi;
y=(4/pi)*[sin(x)+(sin(3*x)/3)+(sin(5*x)/5)+(sin(7*x)/7)];
plot(x,y,'r');
title('Q6');
xlabel('Pi');ylabel('y=(4/pi)*[sin(x)+(sin(3*x)/3)+(sin(5*x)/5)+(sin(7*x)/7)]');

COMMUNICATION SYSTEM LAB MANUAL Page 9


COMMUNICATION SYSTEM LAB MANUAL Page 10

S-ar putea să vă placă și