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.
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.
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.
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.
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:
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