Lab 8: Line Coding Techniques: Objective
Lab 8: Line Coding Techniques: Objective
Lab 8: Line Coding Techniques: Objective
Introduction:
A line code is the code used for data transmission of a digital signal over a transmission line.
1. Unipolar
2. Polar
3. Bi-polar
Unipolar Signaling
Unipolar signaling is also called as On-Off Keying or simply OOK.
The presence of pulse represents a 1 and the absence of pulse represents a 0.
Figure 2 Unipolar RZ
1. Polar Signaling
There are two methods of Polar Signaling. They are
Polar NRZ
Polar RZ
Biphase (Manchester, and differential Manchester)
Polar NRZ
In polar NRZ encoding, we use two levels of voltage amplitude. We can have two versions of polar NRZ:
NRZ-L and NRZ-I. In the first variation, NRZ-L (NRZ-Level), the level of the voltage determines the
value of the bit. In the second variation, NRZ-I (NRZ-Invert), the change or lack of change in the level of
the voltage determines the value of the bit. If there is no change, the bit is 0; if there is a change, bit is 1.
Polar RZ
Return-to-zero (RZ) scheme uses three values: positive, negative, and zero. In RZ, the signal changes not
between bits but during the bit. Here the signal goes to 0 in the middle of each bit. It remains there until
the beginning of the next bit.
Figure 4. Polar RZ
The idea of RZ (transition at the middle of the bit) and the idea of NRZ-L are combined into the
Manchester scheme. In Manchester encoding, the duration of the bit is divided into two halves. The
voltage remains at one level during the first half and moves to the other level in the second half.
Differential Manchester, on the other hand, combines the ideas of RZ and NRZ-I. There is always a
transition at the middle of the bit, but the bit values are determined at the beginning of the bit. If the
next bit is 0, there is a transition; if the next bit is 1, there is none.
Figure 5. Biphasic
Programming:
close all;
clear all;
clc;
% OUTPUT:
% x = Output line coding row vector
% T = time vector
A = 1;
Tb = 1;
inbits = [1 0 1 0 1 1 0 0 1 0];
% Unipolar NRZ
x=[];
for k = 1:N
x = [x A*inbits(k)*ones(1,length(tTb))];
for bit=1
x = [ 1* 1 * [1 1 1 1 … 1 1]]
x = [1 1 1 1 1 … 1 1]
for bit=0
x = [ 1* 0 * [1 1 1 1 … 1 1]]
x = [0 0 0 0 0 … 0 0]
end
% Polar RZ
x2=[];
for k2 = 1:N
c = ones(1,length(tTb)/2);
b = zeros(1,length(tTb)/2);
p = [c b];
x2 = [x2 ((-1)^(inbits(k2)+1))*(A/2)*p];
For bit=1
x2 = [ ((-1)^(1+1)* (0.5) * [1 1 1 … 1 1 0 0 0 … 0 0]]
= [ ((-1)^ 2 * (0.5) * [1 1 1 … 1 1 0 0 0 … 0 0]]
For bit=0
X2 = [ ((-1)^(0+1)* (0.5) * [1 1 1 … 1 1 0 0 0 … 0 0]]
X2 = [ ((-1)^ 1 * (0.5) * [1 1 1 … 1 1 0 0 0 … 0 0]]
end
T2 = linspace(0,N*Tb,length(x2)); %---Time vector for n bits
subplot(3,1,2);
plot(T2,x2);
title('Polar RZ');
axis([0 10 -0.75 0.75]);
In-Lab Tasks
Task 1:
Implement Unipolar NRZ, Polar RZ and Polar NRZ-L for bit stream [1 0 1 0 1 1 0 0 1 0]
Procedure:
Opening of LabVIEW
Installing of RT math module if using newer version
Then taking Math script node.
Putting MATLAB code in math script node.
Taking output form math script node.
Connect the output to the waveform graph
Observing the Unipolar NRZ, Polar RZ and Polar NRZ-L signaling in LabVIEW.
Front Panel:
Block Diagram:
MATLAB PLOTS:
Post-Lab
Task 1:
Implement Polar Biphasic Differential Manchester for bit stream [0 0 1 1 1 1 0 0 1 0]
Procedure:
Opening of LabVIEW
Installing of RT math module if using newer version
Then taking Math script node.
Putting MATLAB code in math script node.
Taking output form math script node.
Connect the output to the waveform graph
Observing the biphasic Manchester signaling in LabVIEW.
Front Panel:
MATLAB PLOTS:
Block Diagram:
Conclusion:
In the end of the lab