Project
Project
Name ID
Power efficiency: For a given bandwidth and a specified detection error rate,
the transmission power should be as low as possible.
Transparency:
o Transparent code: for every possible sequence of data, the coded
signal is received faithfully.
P age|1
Return to zero.
Return-to-zero implies that the pulse shape used to represent the bit
always returns to the 0 volts or the neutral level before the end of the bit
(half-width pulses).
So, we will include our report comparison between Unipolar non return to zero and
Alternative Mark Inversion.
P age|2
Advantages It is simple No DC component.
A lesser bandwidth is required It is simple
Occupies less bandwidth than
unipolar and polar NRZ schemes.
Does not suffer from signal droop
(suitable for transmission over AC
coupled lines).
Possesses single error detection
capability.
Bandwidth 𝑅𝑏 𝑅𝑏
PSD at DC Non-Zero because It has an The PSD has a null at DC, which aids
impulse at 𝑓 = 0 in transformer coupling.
The PSDs of RZ polar, split phase,
and NRZ bipolar (AMI) line codes look
like this:
Power 2 𝐴2 2 𝐴2
P age|3
Representation Polar NRZ + DC 0 is represented by no signal and 1 by
either positive or negative voltage
Transparency On-off codes is not transparent. A Not Transparent
long string of 0s (or offs) causes the
absence of a signal and can lead to
errors in timing extraction.
clc;
Random_Signal = randi([0,1],[1,64]);
for i = 1:length(Random_Signal)
if Random_Signal(i)>0
d(i) = 1;
else
d(i) = 0;
end
end
i = 1;
t = 0:0.01:length(Random_Signal);
for j = 1:length(t)
if t(j) <= i
y(j) = d(i);
else
y(j) = d(i);
i = i+1;
end
end
plot(t,y,'g');
P age|4
xlabel('Time');
title('Unipolar NRZ');
P age|5
Power:
clear
clc;
Sum = 0;
h = 0;
while(h<400)
Random_Signal = randi([0,1],[1,1000]);
for i = 1:length(Random_Signal)
if Random_Signal(i)==1
d(i) = 1;
else
d(i) = 0;
end
end
i = 1;
N = ceil(length(Random_Signal)/0.01);
t = 0:0.01:(N-1)*0.01;
h=h+1;
for j = 1:length(t)
if t(j) <= i
y(j) = d(i);
else
y(j) = d(i);
i=i+1;
end
end
a = abs(fftshift(fft(y)))/N;
Sum = Sum+(a).^2;
end
fs = 1/0.01;
df = 1/length(Random_Signal);
f = -0.5*fs:df:0.5*fs-df;
plot(f,Sum/400);
xlabel('Power');
title('Unipolar NRZ');
P age|6
P age|7
Frequency Domain:
clear
clc;
Sum = 0;
h = 0;
while(h<400)
Random_Signal = randi([0,1],[1,1000]);
for i = 1:length(Random_Signal)
if Random_Signal(i)==1
d(i) = 1;
else
d(i) = 0;
end
end
i = 1;
N = ceil(length(Random_Signal)/0.01);
t = 0:0.01:(N-1)*0.01;
h=h+1;
for j = 1:length(t)
if t(j) <= i
y(j) = d(i);
else
y(j) = d(i);
i=i+1;
end
end
a = abs(fftshift(fft(y)))/N;
Sum = Sum+(a);
end
fs = 1/0.01;
df = 1/length(Random_Signal);
f = -0.5*fs:df:0.5*fs-df;
plot(f,Sum/400);
xlabel('Frequency');
title('Unipolar NRZ');
P age|8
P age|9
The program code of Alternate Mark Inversion:
Time Domain:
clc
clear
A=1;
F=randn(1,64);
for j=1:length(F)
if F(j)>0
if A==1
ll(j)=1;
A=-1;
else
ll(j)=-1;
A=1;
end
else
ll(j)=0;
end
end
Z=1;
K=0;
M=0.5;
N=ceil(length(F)/0.01);
T=0:0.01:(N-1)*0.01;
for RTZ=1:length(T)
P(RTZ)=ll(Z);
P(RTZ)=0;
else
Z=Z+1;
P a g e | 10
K=K+1;
M=M+1;
end
end
end
plot (T,P);
P a g e | 11
Power:
A=1;
R=0;
SUM=0;
while(R<100)
F=randn(1,1000);
for j=1:length(F)
if F(j)>0
if A==1
ll(j)=1;
A=-1;
else
ll(j)=-1;
A=1;
end
else
ll(j)=0;
end
end
Z=1;
K=0;
M=0.5;
N=ceil(length(F)/0.01);
T=0:0.01:(N-1)*0.01;
for RTZ=1:length(T)
if T(RTZ)>=K && T(RTZ)<=M
P(RTZ)=ll(Z);
else if T(RTZ)>M && T(RTZ)<=Z
P(RTZ)=0;
else
Z=Z+1;
K=K+1;
M=M+1;
end
end
end
ff=fft(P);
Shff=fftshift(ff);
N=abs(Shff)/N;
SUM=SUM+(N).^2;
R=R+1;
end
dt=0.01;
fm=1/dt;
df = 1/length(F);
f = (-0.5*fm) : df : (0.5*fm - df);
P a g e | 12
plot (f,SUM/100);
title('Alternate Mark Inversion');
P a g e | 13
Frequency Domain:
A=1;
R=0;
SUM=0;
while(R<100)
F=randn(1,1000);
for j=1:length(F)
if F(j)>0
if A==1
ll(j)=1;
A=-1;
else
ll(j)=-1;
A=1;
end
else
ll(j)=0;
end
end
Z=1;
K=0;
M=0.5;
N=ceil(length(F)/0.01);
T=0:0.01:(N-1)*0.01;
for RTZ=1:length(T)
if T(RTZ)>=K && T(RTZ)<=M
P(RTZ)=ll(Z);
else if T(RTZ)>M && T(RTZ)<=Z
P(RTZ)=0;
else
Z=Z+1;
K=K+1;
M=M+1;
end
end
end
ff=fft(P);
Shff=fftshift(ff);
N=abs(Shff)/N;
SUM=SUM+(N);
R=R+1;
end
dt=0.01;
fm=1/dt;
df = 1/length(F);
f = (-0.5*fm) : df : (0.5*fm - df);
P a g e | 14
plot (f,SUM/100);
title('Alternate Mark Inversion');
P a g e | 15
Bonus Part
Polar Non-return to zero
In telecommunication, a non-return-to-zero (NRZ) line code is a binary code in which
ones are represented by one significant condition, usually a positive voltage, while
zeros are represented by some other significant condition, usually a negative voltage,
with no other neutral or rest condition.
Polar NRZ
The advantages
The advantages of Polar NRZ are:
It is simple.
No low-frequency components are present.
Requires only half the baseband bandwidth required by the Manchester code
The disadvantages
The disadvantages of Polar NRZ are:
P a g e | 16
The bandwidth
The bandwidth for Polar non-return to
zero marked by the first null is halved
to 𝑅𝑏 Hz (where 𝑅𝑏 is the clock
frequency or bit rate).
clc;
Random_Signal = randi([0,1],[1,64]);
for i = 1:length(Random_Signal)
if Random_Signal(i)>0
d(i) = 1;
else
d(i) = -1;
end
end
i = 1;
t = 0:0.01:length(Random_Signal);
for j = 1:length(t)
if t(j) <= i
y(j) = d(i);
else
y(j) = d(i);
i = i+1;
end
end
plot(t,y,'g');
xlabel('Time');
title('polar NRZ');
P a g e | 17
P a g e | 18
Power:
clear
clc;
Sum = 0;
h = 0;
while(h<400)
Random_Signal = randi([0,1],[1,1000]);
for i = 1:length(Random_Signal)
if Random_Signal(i)==1
d(i) = 1;
else
d(i) = -1;
end
end
i = 1;
N = ceil(length(Random_Signal)/0.01);
t = 0:0.01:(N-1)*0.01;
h=h+1;
for j = 1:length(t)
if t(j) <= i
y(j) = d(i);
else
y(j) = d(i);
i=i+1;
end
end
a = abs(fftshift(fft(y)))/N;
Sum = Sum+(a).^2;
end
fs = 1/0.01;
df = 1/length(Random_Signal);
f = -0.5*fs:df:0.5*fs-df;
plot(f,Sum/400);
xlabel('Power');
title('polar NRZ');
P a g e | 19
P a g e | 20
Frequency Domain:
clear
clc;
Sum = 0;
h = 0;
while(h<400)
Random_Signal = randi([0,1],[1,1000]);
for i = 1:length(Random_Signal)
if Random_Signal(i)==1
d(i) = 1;
else
d(i) = -1;
end
end
i = 1;
N = ceil(length(Random_Signal)/0.01);
t = 0:0.01:(N-1)*0.01;
h=h+1;
for j = 1:length(t)
if t(j) <= i
y(j) = d(i);
else
y(j) = d(i);
i=i+1;
end
end
a = abs(fftshift(fft(y)))/N;
Sum = Sum+(a);
end
fs = 1/0.01;
df = 1/length(Random_Signal);
f = -0.5*fs:df:0.5*fs-df;
plot(f,Sum/400);
xlabel('Frequency');
title('polar NRZ');
P a g e | 21
P a g e | 22