Birla Vishwakarma Mahavidyalaya Engineering College: Department of Electronics & Communication Laboratory Manual
Birla Vishwakarma Mahavidyalaya Engineering College: Department of Electronics & Communication Laboratory Manual
Engineering College
(An Autonomous Institution)
Group : 17CP016,17CP017,17CP025,17CP026,17CP029
Department of Electronics & Communication ID:17CP016,17CP017,17CP025,17CP026,17CP029
INDEX
7 Draw Simulink block to find out Bit Error Rate for Phase
Shift Keying (PSK) technique.
1
Department of Electronics & Communication ID:17CP016,17CP017,17CP025,17CP026,17CP029
2
Department of Electronics & Communication ID:17CP016,17CP017,17CP025,17CP026,17CP029
Experiment – 1.1
Pseudo Code:
Initialize index from -pi to pi at the interval of 0.1
Initialize variable for sin plot.
Create plot using index and sin variable.
Set x and y label
Give title for plot
Repeat step 1 to 5 step for cos, exp and ramp.
Program:
##Practical-1 : Part 1
##continues
clear all;
close all;
clc;
x = -pi:0.1:pi
y = sin(x)
subplot(2,2,1)#row,column,which place
plot(x,y,'s')
xlabel('Time');
ylabel('Amp');
title("Sin PLot");
3
Department of Electronics & Communication ID:17CP016,17CP017,17CP025,17CP026,17CP029
z = -pi:0.1:pi
a = cos(x)
subplot(2,2,2)
plot(z,a,'c')
xlabel('Time');
ylabel('Amp');
title("Cos Plot")
z = -pi:0.1:pi
a = exp(x)
subplot(2,2,3)
plot(z,a,'o')
xlabel('Time');
ylabel('Amp');
title("Exponentional Plot")
r = x
subplot(2,2,4)
plot(x,r,'r')
xlabel('Time');
ylabel('Amp');
title('Ramp')
4
Department of Electronics & Communication ID:17CP016,17CP017,17CP025,17CP026,17CP029
Output:
Theory:
1) Plot(x, y): It plots all lines defined by Xn versus Yn pairs. If only Xn or Yn is a matrix, the
vector is plotted versus the rows or columns of the matrix.
5
Department of Electronics & Communication ID:17CP016,17CP017,17CP025,17CP026,17CP029
2) Stem(x, y): stem(X,Y) plots X versus the columns of Y. It is generally used for discrete
plotting of the graph of any function.
8) Rand: It returns a pseudorandom, scalar value drawn from a uniform distribution on the
unit interval.
9) Input: Through this command one can request the user to input the values.
10) Grid on: This command used to turn grids ‘ON’ of the plot. It controls the presence of
appearance of grid lines.
6
Department of Electronics & Communication ID:17CP016,17CP017,17CP025,17CP026,17CP029
11) Subplot: subplot divides the current figure into rectangular panes that are numbered
row-wise. Each pane contains an axes object. Subsequent plots are output to the
current pane.
12) Hold on: hold on retains the current plot and certain axes properties so that subsequent
graphing commands add to the existing graph.
Experiment – 1.2
Pseudo Code:
Initialize index from -pi to pi at the interval of 0.1
Initialize variable for sin plot.
Create stem using index and sin variable.
Set x and y label
Give title for plot
7
Department of Electronics & Communication ID:17CP016,17CP017,17CP025,17CP026,17CP029
Program:
##Practical-1 : Part 2
##Discrete
clear all;
close all;
clc;
x = -pi:0.1:pi
y = sin(x)
subplot(2,2,1)#row,column,which place
stem(x,y,'s')
xlabel('Time');
ylabel('Amp');
title("Sin PLot");
z = -pi:0.1:pi
a = cos(x)
subplot(2,2,2)
stem(z,a,'c')
xlabel('Time');
ylabel('Amp');
title("Cos Plot")
z = -pi:0.1:pi
a = exp(x)
subplot(2,2,3)
stem(z,a,'o')
xlabel('Time');
ylabel('Amp');
title("Exponentional Plot")
r = x
8
Department of Electronics & Communication ID:17CP016,17CP017,17CP025,17CP026,17CP029
subplot(2,2,4)
stem(x,r,'r')
xlabel('Time');
ylabel('Amp');
title('Ramp')
output:
Conclusion:
From this practical we can understand how to use the MATLAB and we can also learn
the various command of the MATLAB related to wireless communication.
9
Department of Electronics & Communication ID:17CP016,17CP017,17CP025,17CP026,17CP029
Experiment – 2
AIM: To study about random data generation and calculating Bit Error Rate in it.
Apparatus: MATLAB Version R2020a.
Description:
1. The bit error rate (BER) is the number of bit errors per unit time.
2. The bit error ratio (also BER) is the number of bit errors divided by the total
number of transferred bits during a studied time interval.
No . of Error bits
BER =
Total no . of transmitted bits
Pseudo Code:
10
Department of Electronics & Communication ID:17CP016,17CP017,17CP025,17CP026,17CP029
Program:
##Random data generation and calculating bit
error(probability of error)
##BER = PE = no. of errors/total no. of bits
clear all;
close all;
clc;
ne = xor(tx,rx)
tne = sum(ne)
ber = tne/length(tx)
11
Department of Electronics & Communication ID:17CP016,17CP017,17CP025,17CP026,17CP029
Output:
Conclusion: Through this practical we conclude that we can find the BER and can
analyze the communication system for various modulation types and various
modulation index.
12