Lab 4 Line Coding Techniques
Lab 4 Line Coding Techniques
Lab 4 Line Coding Techniques
The objective of this lab is implementation of line coding techniques using Matlab.
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
1. UnipolarSignaling
Unipolar signaling is also called as On-Off Keying or simply OOK.
Advantages
It is simple.
A lesser bandwidth is required.
Disadvantages
No clock is present.
Loss of synchronization is likely to occur (especially for long strings of 1s and 0s).
Advantages
It is simple.
The spectral line present at the symbol rate can be used as a clock.
Disadvantages
No error correction.
Occupies twice the bandwidth as unipolar NRZ.
The signal droop is caused at the places where signal is non-zero at 0 Hz.
2. PolarSignaling
There are two methods of Polar Signaling. They are −
Polar NRZ
Polar RZ
Polar NRZ
In this type of Polar signaling, a High in data is represented by a positive pulse, while a Low in data
is represented by a negative pulse. The following figure depicts this well.
Advantages
It is simple.
No low-frequency components are present.
Disadvantages
No error correction.
No clock is present.
The signal droop is caused at the places where the signal is non-zero at 0 Hz.
Polar RZ
In this type of Polar signaling, a High in data, though represented by a Mark pulse, its duration T0 is
less than the symbol bit duration. Half of the bit duration remains high but it immediately returns
to zero and shows the absence of pulse during the remaining half of the bit duration.
However, for a Low input, a negative pulse represents the data, and the zero level remains same for
the other half of the bit duration. The following figure depicts this clearly.
Advantages
It is simple.
No low-frequency components are present.
Disadvantages
No error correction.
No clock is present.
The signal droop is caused at places where the signal is non-zero at 0 Hz.
3. BipolarSignaling
This is an encoding technique which has three voltage levels namely +, - and 0. Such a signal is
called as duo-binary signal.
An example of this type is Alternate Mark Inversion (AMI). For a 1, the voltage level gets a
transition from + to – or from – to +, having alternate 1sto be of equal polarity. A 0 will have a zero
voltage level.
Bipolar NRZ
Bipolar RZ
From the models so far discussed, we have learnt the difference between NRZ and RZ. It just goes in
the same way here too. The following figure clearly depicts this.
The above figure has both the Bipolar NRZ and RZ waveforms. The pulse duration and symbol bit
duration are equal in NRZ type, while the pulse duration is half of the symbol bit duration in RZ
type.
Advantages
Following are the advantages −
It is simple.
This technique is suitable for transmission over AC coupled lines, as signal drooping doesn’t
occur here.
Disadvantages
Following are the disadvantages −
No clock is present.
Long strings of data cause loss of synchronization.
Programming:
close all;
clear all;
clc;
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))];
end
T = linspace(0,N*Tb,length(x)); %---Time vector for n bits
subplot(3,1,1);
plot(T,x);
title('Unipolar NRZ');
axis([0 10 -0.25 1.25]);
% 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];
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]);
Lab Tasks
In-Lab Task 1:
Post-Lab Task 1:
Objective:
In this lab we learn that
We learn that biphase Manchester.
We learn that polar NZ.
Task 1:
Task 2: