Saad Khalid (FA16-BCE-087) PCS LAB Report #9 To Explore Different Line Coding Schemes
Saad Khalid (FA16-BCE-087) PCS LAB Report #9 To Explore Different Line Coding Schemes
METHODOLOGY:
The process for converting digital data into digital signal is said to be Line
Coding. Digital data is found in binary format. It is represented (stored) internally as
series of 1s and 0s. Digital signal is denoted by discreet signal, which represents
digital data. There are three types of line coding Schemes.
Unipolar encoding schemes use single voltage level to represent data.
In this case, to represent binary 1, high voltage is transmitted and to represent 0, no
voltage is transmitted. It is also called Unipolar-Non-return-to-zero, because there is
no rest condition i.e. it either represents 1or 0.
Polar encoding scheme uses multiple voltage levels to represent
binary values. It uses two different voltage levels to represent binary values.
Generally, positive voltage represents 1 and negative value represents 0. It is also
NRZ because there is no rest condition. NRZ scheme has two variants: NRZ-L and
NRZ-I. Problem with NRZ is that the receiver cannot conclude when a bit ended and
when the next bit is started, in case when sender and receiver’s clock are not
synchronized. This encoding scheme is a combination of RZ and NRZ-L. Bit time is
divided into two halves. It transits in the middle of the bit and changes phase when a
different bit is encountered.
Bipolar encoding uses three voltage levels, positive, negative and
zero. Zero voltage represents binary 0 and bit 1 is represented by altering positive and
negative voltages.
RESULT:
Post lab task
clc;
close all;
clear all;
x=[1 0 1 1 0 1];
nx=size(x,2);
sign=1;
i=1;
while i<nx+1
t = i:0.01:i+1-0.01;
if x(i)==1
unipolar_code=square(t*2*pi,100);
polar_code=square(t*2*pi,100);
bipolar_code=sign*square(t*2*pi,100);
sign=sign*-1;
manchester_code=-square(t*2*pi,50);
else
unipolar_code=0;
polar_code=-square(t*2*pi,100);
bipolar_code=0;
manchester_code=square(t*2*pi,50);
end
subplot(4,1,1);
plot(t,unipolar_code);
ylabel('unipolar code');
hold on;
grid on;
axis([1 10 -2 2]);
subplot(4,1,2);
plot(t,polar_code);
ylabel('polar code');
hold on;
grid on;
axis([1 10 -2 2]);
subplot(4,1,3);
plot(t,bipolar_code);
ylabel('bipolar code');
hold on;
grid on;
axis([1 10 -2 2]);
subplot(4,1,4);
plot(t,manchester_code);
ylabel('manchester code');
hold on;
grid on;
axis([1 10 -2 2]);
i=i+1;
end
Result:
Conclusion:
In this lab, we learned different coding schemes and how digital data is
represented in the form of a digital signal. We became familiar with Line Encoder and
Decoder modules of TIMS. We worked on Hardware to practically observe all the
aspects that are used in line coding techniques and then we verified them through
MATLAB code.