0% found this document useful (0 votes)
55 views8 pages

LR 3 Digicoms Ece151

This document contains the responses of Jovan Avery S. Dalluay to questions about line coding techniques. It includes the commands used and script code to generate outputs for various line codes, such as UNRZ, PNRZ, URZ, PRZ, Manchester coding, and B8SZ. It also includes references at the end.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views8 pages

LR 3 Digicoms Ece151

This document contains the responses of Jovan Avery S. Dalluay to questions about line coding techniques. It includes the commands used and script code to generate outputs for various line codes, such as UNRZ, PNRZ, URZ, PRZ, Manchester coding, and B8SZ. It also includes references at the end.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Dalluay, Jovan Avery S.

/ ECE151
Name/Section Rating

Date performed February 18, 2019


Date submitted February 20, 2019

LINE CODE INSPECTRA


Activity 3

DALLUAY, JOVAN AVERY S. / FDIGICOMM / ECE151 Page 1 of 8


Question 1:Unipolar Non-Return to Zero (UNRZ).
Answer:
UNRZ

The commands used to generate the output:


>> bits = [1,0,1,1,0,1,1,0,0,1];
>> bitrate = 10;
>> [t,x] = unrz (bits,bitrate);
>> plot(t,x)
>> title ('UNRZ');
>> n =length(x);
>> fs = 2001;
>> f = (0:n-1)*(fs/n);
>> y = fft(x);
>> power = abs(y).^2/n;
>> figure(2);plot (f,power);
>> title('UNRZ');
>> xlabel('Frequency');ylabel('Power');

The script code:


function [t,x] = unrz(bits, bitrate)
T = length(bits)/bitrate;
n = 200;
N = n*length(bits);
dt = T/N;
t = 0:dt:T;
x = zeros(1,length(t));
for i = 0:length(bits)-1
if bits(i+1) == 1
x(i*n+1:(i+1)*n) = 5;
else
x(i*n+1:(i+1)*n) = 0;
end
end

DALLUAY, JOVAN AVERY S. / FDIGICOMM / ECE151 Page 2 of 8


Question 2:Polar Non-Return to Zero (PNRZ).
Answer:
PNRZ

The commands used to generate the output:


>> bits = [1,0,1,1,0,1,1,0,0,1];
>> bitrate = 10;
>> [t,x] = pnrz (bits,bitrate);
>> plot(t,x)
>> title ('PNRZ');
>> n =length(x);
>> fs = 2001;
>> f = (0:n-1)*(fs/n);
>> y = fft(x);
>> power = abs(y).^2/n;
>> figure(2);plot (f,power);
>> title('PNRZ');
>> xlabel('Frequency');ylabel('Power');

The script code:


function [t,x] = unrz(bits, bitrate)
T = length(bits)/bitrate;
n = 200;
N = n*length(bits);
dt = T/N;
t = 0:dt:T;
x = zeros(1,length(t));
for i = 0:length(bits)-1
if bits(i+1) == 1
x(i*n+1:(i+1)*n) = 5;
else
x(i*n+1:(i+1)*n) = -5;
end
end

DALLUAY, JOVAN AVERY S. / FDIGICOMM / ECE151 Page 3 of 8


Question 3:Unipolar Return to Zero (URZ).
Answer:
URZ

The commands used to generate the output:


>> bits = [1,0,1,1,0,1,1,0,0,1];
>> bitrate = 10;
>> [t,x] = urz (bits,bitrate);
>> plot(t,x)
>> title ('URZ');
>> n =length(x);
>> fs = 2001;
>> f = (0:n-1)*(fs/n);
>> y = fft(x);
>> power = abs(y).^2/n;
>> figure(2);plot (f,power);
>> title('URZ');
>> xlabel('Frequency');ylabel('Power');

The script code:


for i = 0:length(bits)-1
if bits(i+1) == 1
x(i*n+1:(i+0.5)*n) = 5;
x((i+0.5)*n+1:(i+1)*n) = 0;
else
x(i*n+1:(i+1)*n) = 0;
end
end

DALLUAY, JOVAN AVERY S. / FDIGICOMM / ECE151 Page 4 of 8


Question 4:Polar Return to Zero (PRZ).
Answer:
PRZ

The commands used to generate the output:


>> bits = [1,0,1,1,0,1,1,0,0,1];
>> bitrate = 10;
>> [t,x] = prz(bits,bitrate);
>> plot(t,x)
>> title ('PRZ');
>> grid on;
>> n =length(x);
>> fs = 2001;
>> f = (0:n-1)*(fs/n);
>> y = fft(x);
>> power = abs(y).^2/n;
>> figure(2);plot (f,power);
>> title('PRZ');
>> xlabel('Frequency');ylabel('Power');
>> grid on;

The script code:


for i = 0:length(bits)-1
if bits(i+1) == 1
x(i*n+1:(i+0.5)*n) = 5;
x((i+0.5)*n+1:(i+1)*n) = 0;
else
x(i*n+1:(i+0.5)*n) = -5;
x((i+0.5)*n+1:(i+1)*n) = 0;
end
end

DALLUAY, JOVAN AVERY S. / FDIGICOMM / ECE151 Page 5 of 8


Question 5: Manchester Coding
Answer:
Manchester

The commands used to generate the output:


>> bits = [1,0,1,1,0,1,1,0,0,1];
>> bitrate = 10;
>> [t,x] = manchester(bits,bitrate);
>> plot(t,x)
>> title ('Manchester');
>> grid on;
>> n =length(x);
>> fs = 2001;
>> f = (0:n-1)*(fs/n);
>> y = fft(x);
>> power = abs(y).^2/n;
>> figure(2);plot (f,power);
>> title('Manchester');
>> xlabel('Frequency');ylabel('Power');
>> grid on;

The script code:


for i = 0:length(bits)-1
if bits(i+1) == 1
x(i*n+1:(i+0.5)*n) = 5;
x((i+0.5)*n+1:(i+1)*n) = -5;
else
x(i*n+1:(i+0.5)*n) = -5;
x((i+0.5)*n+1:(i+1)*n) = 5;
end
end

DALLUAY, JOVAN AVERY S. / FDIGICOMM / ECE151 Page 6 of 8


Question 6: Bipolar 8 zero substitution (B8SZ)
Answer:

The commands used to generate the output:


>> bits = [1,0,1,0,0,1,1,0,0,1];
>> bitrate = 10;
>> [t,x] = manchester(bits,bitrate);
>> plot(t,x)
>> title ('Manchester');
>> grid on;
>> n =length(x);
>> fs = 2001;
>> f = (0:n-1)*(fs/n);
>> y = fft(x);
>> power = abs(y).^2/n;
>> figure(2);plot (f,power);
>> title('Frequency-domain Representation UNRZ');
>> xlabel('Frequency');ylabel('Power');
>> grid on;

The script code:


for i = 0:length(bits)-1
if bits(i+1) == 1
x(i*n+1:(i+0.5)*n) = 5;
x((i+0.5)*n+1:(i+1)*n) = -5;
else
x(i*n+1:(i+0.5)*n) = -5;
x((i+0.5)*n+1:(i+1)*n) = 5;
end
end

DALLUAY, JOVAN AVERY S. / FDIGICOMM / ECE151 Page 7 of 8


References

DALLUAY, JOVAN AVERY S. / FDIGICOMM / ECE151 Page 8 of 8

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy