Professional Documents
Culture Documents
EXPERIMENT-1
Aim: Simulate NRZ, RZ, half-sinusoid and raised cosine pulses and generate eye
diagram for binary polar signaling.
Theory : Data as well as signals that represents data can either be digital or analog. Line
coding is the process of converting digital data to digital signals. By this technique we converts
a sequence of bits to a digital signal. At the sender side digital data are encoded into a digital
signal and at the receiver side the digital data are recreated by decoding the digital signal.
In this type of unipolar signaling, a High in data is represented by a positive pulse called as Mark,
which has a duration T0 equal to the symbol bit duration. A Low in data input has no pulse.
The following figure clearly depicts this.
Advantages
The advantages of Unipolar NRZ are −
It is simple.
A lesser bandwidth is required.
Disadvantages
The disadvantages of Unipolar NRZ are −
No error correction done.
Presence of low frequency components may cause the signal droop.
No clock is present.
Loss of synchronization is likely to occur (especially for long strings of 1s and 0s).
In this type of unipolar 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.
It is clearly understood with the help of the following figure.
Advantages
The advantages of Unipolar RZ are −
It is simple.
The spectral line present at the symbol rate can be used as a clock.
Disadvantages
The disadvantages of Unipolar RZ are −
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.
Polar Signaling
There are two methods of Polar Signaling. They are −
Polar NRZ
Polar RZ
1. 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
The advantages of Polar NRZ are −
It is simple.
No low-frequency components are present.
Disadvantages
The disadvantages of Polar NRZ are −
No error correction.
No clock is present.
The signal droop is caused at the places where the signal is non-zero at 0 Hz.
2. 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
The advantages of Polar RZ are −
It is simple.
No low-frequency components are present.
Disadvantages
The disadvantages of Polar RZ are −
No error correction.
No clock is present.
Occupies twice the bandwidth of Polar NRZ.
The signal droop is caused at places where the signal is non-zero at 0 Hz.
MATLAB Code:
1. NRZ(Polar and Unipolar):
repeat = ones(1,timeperiod);
NRZP = NRZP.';
NRZP = NRZP(:)';
%Unipolar
NRZU = NRZP;
figure(1)
subplot(2,2,1)
plot(time,NRZU);axis([0,10*timeperiod,-1.5,1.5]);
title('NRZ Unipolar')
xlabel('Time(s)')
ylabel('Voltage(V)')
%Polar
subplot(2,2,2)
plot(time,NRZP);axis([0,10*timeperiod,-1.5,1.5]);
title('NRZ Polar')
xlabel('Time(s)')
ylabel('Voltage(V)')
intermediate = ones(1,length(bitstream)*2);
intermediate(2:2:length(intermediate)) = 0;
intermediate = intermediate.';
intermediate = intermediate(:)';
%Unipolar
subplot(2,2,3)
plot(time,RZU);axis([0,10*timeperiod,-1.5,1.5]);
title('RZ Unipolar')
xlabel('Time(s)')
ylabel('Voltage(V)')
%Polar
subplot(2,2,4)
plot(time,RZP);axis([0,10*timeperiod,-1.5,1.5]);
title('RZ Polar')
xlabel('Time(s)')
ylabel('Voltage(V)')
Result: Line coding NRZ and RZ has been simulated using MATLAB.
The raised-cosine filter is a filter frequently used for pulse-shaping in digital modulation due to
its ability to minimise intersymbol interference (ISI). Its name stems from the fact that the non-
zero portion of the frequency spectrum of its simplest form ( 𝛽 = 1)is a cosine function, 'raised'
up to sit above the 𝑓 (horizontal) axis.It is a filter whose frequency-domain shape is 1 at DC and
extends out flat for some distance, then transitions to zero, where the transition takes the shape of
a raised cosine, and the transition is centered at the symbol rate. The width of the transition is
variable, and is controlled by a parameter𝛽. This sort of filter is used by many communication
standards.
(a) (b)
Fig.1 (a) Time response of raised-cosine filter with various roll-off factors (b)Frequency
response of raised-cosine filter with various roll-off factors
Matlab Code for raised cosine pulse with its eye pattern.
clc;
clear all;
close all;
bk = rand(1,100)>0.5;
x = bk'*h;
x = x';
x = x(:)';
t = 0:1/100:98+99/100;
subplot(211);plot(t,x); axis([0,10,-1,1]);
X = abs(fftshift(fft(x)));
X = X/max(X);
f = linspace(-50,50,length(X));
subplot(212);plot(f,X);axis([-5,5,0,1]);
bk = 2*bk-1;
x = bk'*h;
x = x';
x = x(:)';
t = 0:1/100:98+99/100;
figure();
subplot(211);plot(t,x); axis([0,10,-1,1]);
X = abs(fftshift(fft(x)));
X = X/max(X);
f = linspace(-50,50,length(X));
subplot(212);plot(f,X);axis([-5,5,0,1]);
eyediagram(x,99)
%% Unipolar Half-sinusoid
bk = rand(1,100)>0.5;
x = bk'*sin(2*pi/200*[0:99]);
x = x';
x = x(:)';
t = 0:1/100:100-1/100;
subplot(211);plot(t,x);axis([0,10,-1,1]);
X = abs(fftshift(fft(x)));
X = X/max(X);
f = linspace(-50,50,length(X));
subplot(212);plot(f,X);axis([-5,5,0,1]);
bk = 2*bk-1;
x = bk'*sin(2*pi/200*[0:99]);
x = x';
x = x(:)';
t = 0:1/100:100-1/100;
figure();
subplot(211);plot(t,x);axis([0,10,-1,1]);
X = abs(fftshift(fft(x)));
X = X/max(X);
f = linspace(-50,50,length(X));
subplot(212);plot(f,X);axis([-5,5,0,1]);
eyediagram(x,100)