0% found this document useful (0 votes)
28 views3 pages

Experiment-1 - : AIM Software Used Program Code

The document describes an experiment in MATLAB to study and encode/decode various line codes. Random data is generated and different line codes (NRZ-Unipolar, NRZ-Bipolar, RZ-Unipolar, etc.) are applied. The encoded data for each line code is then plotted in different subplots to visualize and compare the line codes. The aim was to understand various line coding techniques and the conclusion states that various line codes were studied and plotted.

Uploaded by

RavinderSingh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views3 pages

Experiment-1 - : AIM Software Used Program Code

The document describes an experiment in MATLAB to study and encode/decode various line codes. Random data is generated and different line codes (NRZ-Unipolar, NRZ-Bipolar, RZ-Unipolar, etc.) are applied. The encoded data for each line code is then plotted in different subplots to visualize and compare the line codes. The aim was to understand various line coding techniques and the conclusion states that various line codes were studied and plotted.

Uploaded by

RavinderSingh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

EXPERIMENT-1

AIM- To study encoding and decoding of various line codes.


SOFTWARE USED-MATLABR2019a
PROGRAM CODE-
r=round(rand(1,10));
sgn=1;
for i=1:10
t=i:0.001:i+1-0.001;
if r(i)==1
nrz_unipolar=square(2*pi*t,100);
nrz_bipolar=square(2*pi*t,100);
rz_unipolar=(1+square(2*pi*t))/2;
rz_bipolar=(1+square(2*pi*t))/2;
ami_nrz=sgn+square(2*pi*t);
manchester=square(2*pi*t,50);
else
nrz_unipolar=0;
nrz_bipolar=-square(2*pi*t,100);
rz_unipolar=0
rz_bipolar=-(1+square(2*pi*t))/2;
ami_nrz=0;
manchester=-(square(2*pi*t,50));
end
subplot(6,6,1);
plot(t,nrz_unipolar,'red');
axis([1 11 -1.5 1.5])
xlabel('time')
ylabel('amplitude')
title('nrz_unipolar')
hold on;
grid on;
subplot(6,1,2)
axis([1 11 -1.5 1.5])
plot(t,nrz_bipolar,'blue');
ylabel('amplitude')
title('nrz_unipolar')

xlabel('time')

1
NIKKI(20113202817)
ylabel('amplitude')
title('nrz_unipolar')
hold on;
grid on;
subplot(6,1,3)
plot(t,rz_unipolar,'red');
axis([1 11 -1.5 1.5])
xlabel('time')
ylabel('amplitude')
title('rz_unipolar')
hold on;
grid on;
subplot(6,1,4)
plot(t,rz_bipolar,'blue');
axis([1 11 -1.5 1.5])
xlabel('time')
ylabel('amplitude')
title('rz_bipolar')
hold on;
grid on;
subplot(6,1,5)
plot(t,ami_nrz,'blue');
axis([1 11 -1.5 1.5])
xlabel('time')
ylabel('amplitude')
title('ami_rz')
hold on;
grid on;
subplot(6,1,6)
plot(t,manchester,'red');
axis([1 11 -1.5 1.5])
xlabel('time')
ylabel('amplitude')
title('nrz_unipolar')
hold on;
grid on;
end

2
NIKKI(20113202817)
OUTPUT-

CONCLUSION-
Various line codes have been studied and plotted

3
NIKKI(20113202817)

You might also like