Está en la página 1de 15

INSTITUTO POLITECNICO NACIONAL

ESCUELA SUPERIOR DE INGENIERÍA MECÁNICA Y


ELECTRICA

UNIDAD ZACATENCO
INGENIERÍA EN COMUNICACIONES Y ELECTRÓNICA

ALUMNO: NEGRETE TELLEZ JUAN OBRAYAND

UNIDAD DE APRENDIZAJE: COMUNICACIONES


DIGITALES

PRACTICA 4: CÓDIGOS DE LÍNEA (EXTRA)

NOMBRE DEL PROFESOR: REZENDIZ VAZQUEZ


RABINDRANATH
GRUPO: 6CV6
OBJETIVOS:

-Graficar en Matlab los resultados de los diferentes tipos de codificación


lineal

MARCO TEÓRICO:

Codificación en línea y sus técnicas

Propiedades Deseables de los códigos de Línea

RESULTADOS OBTENIDOS

Codigo en Matlab

UNRZ
function UNRZ(h)

clf;

n=1;

h=[1 0 0 1 1 0 1 0 1 0];

l=length(h);

h(l+1)=1;

while n<=length(h)-1;

t=n-1:0.001:n;

if h(n) == 0

if h(n+1)==0

y=(t>n);

else

y=(t==n);

end

d=plot(t,y);grid on;

title('Line code UNIPOLAR NRZ');

set(d,'LineWidth',2.5);
hold on;

axis([0 length(h)-1 -1.5 1.5])

disp('zero');

else

if h(n+1)==0

y=(t<n)-0*(t==n);

else

y=(t<n)+1*(t==n);

end

d=plot(t,y);grid on;

title('Line code UNIPOLAR NRZ');

set(d,'LineWidth',2.5);

hold on;

axis([0 length(h)-1 -1.5 1.5])

disp('one');

end

n=n+1;

%pause;

End
URZ
function URZ(h)

clf;

n=1;

h=[1 0 0 1 1 0 1 0 1 0];

l=length(h);

h(l+1)=1;

while n<=length(h)-1;

t=n-1:0.001:n;

%Graficación de los CEROS (0)

if h(n) == 0

if h(n+1)==0

y=(t>n);

else

y=(t==n);

end

d=plot(t,y);grid on

title('Line code UNIPOLAR RZ');

set(d,'LineWidth',2.5);

hold on;

axis([0 length(h)-1 -1.5 1.5]);

disp('zero');

%Graficación de los UNOS (1)

else

if h(n+1)==0

y=(t<n-0.5);

else
y=(t<n-0.5)+1*(t==n);

end

d=plot(t,y);grid on;

title('Line code UNIPOLAR RZ');

set(d,'LineWidth',2.5);

hold on;

axis([0 length(h)-1 -1.5 1.5]);

disp('one');

end

n=n+1;

%pause;

end

end
PNRZ

function PNRZ(h)
clf;

n=1;

h=[1 0 0 1 1 0 1 0 1 0]

l=length(h);

h(l+1)=1;

while n<=length(h)-1;

t=n-1:0.001:n;

if h(n) == 0

if h(n+1)==0

y=-(t<n)-(t==n);

else

y=-(t<n)+(t==n);

end

d=plot(t,y);grid on;

title('Line code POLAR NRZ');

set(d,'LineWidth',2.5);

hold on;

axis([0 length(h)-1 -1.5 1.5]);

disp('zero');

else

if h(n+1)==0

y=(t<n)-1*(t==n);

else

y=(t<n)+1*(t==n);

end
d=plot(t,y);grid on;

title('Line code POLAR NRZ');

set(d,'LineWidth',2.5);

hold on;

axis([0 length(h)-1 -1.5 1.5]);

disp('one');

end

n=n+1;

%pause;

End

BRZ

function BRZ(h)
clf;

n=1;

h=[1 0 0 1 1 0 1 0 1 0];

l=length(h);

h(l+1)=1;
while n<=length(h)-1;

t=n-1:0.001:n;

if h(n) == 0

if h(n+1)==0

y=-(t<n-0.5)-(t==n);

else

y=-(t<n-0.5)+(t==n);

end

d=plot(t,y);grid on;

title('Line code BIPOLAR RZ');

set(d,'LineWidth',2.5);

hold on;

axis([0 length(h)-1 -1.5 1.5]);

disp('zero');

else

if h(n+1)==0

y=(t<n-0.5)-1*(t==n);

else

y=(t<n-0.5)+1*(t==n);

end

d=plot(t,y);grid on;

title('Line code BIPOLAR RZ');

set(d,'LineWidth',2.5);

hold on;

axis([0 length(h)-1 -1.5 1.5]);

disp('one');

end

n=n+1;
%pause;

End

AMINRZ

function AMINRZ(h)
clf;

n=1;

h=[1 0 0 1 1 0 1 0 1 0];

l=length(h);

h(l+1)=1;

ami=-1;

while n<=length(h)-1;

t=n-1:0.001:n;

if h(n) == 0

if h(n+1)==0

y=(t>n);

else
if ami==1

y=-(t==n);

else

y=(t==n);

end

end

d=plot(t,y);grid on;

title('Line code AMI NRZ');

set(d,'LineWidth',2.5);

hold on;

axis([0 length(h)-1 -1.5 1.5]);

disp('zero');

else

ami=ami*-1;

if h(n+1)==0

if ami==1

y=(t<n);

else

y=-(t<n);

end

else

if ami==1

y=(t<n)-(t==n);

else

y=-(t<n)+(t==n);

end

end

d=plot(t,y);grid on;
title('Line code AMI NRZ');

set(d,'LineWidth',2.5);

hold on;

axis([0 length(h)-1 -1.5 1.5]);

disp('one');

end

n=n+1;

%pause;

End

AMIRZ

function AMIRZ(h)
h=[1 0 0 1 1 0 1 0 1 0];

clf;

n=1;

l=length(h);

h(l+1)=1;

ami=-1;
while n<=length(h)-1;

t=n-1:0.001:n;

if h(n) == 0

if h(n+1)==0

y=(t>n);

else

if ami==1

y=-(t==n);

else

y=(t==n);

end

end

d=plot(t,y);grid on;

title('Line code AMI RZ');

set(d,'LineWidth',2.5);

hold on;

axis([0 length(h)-1 -1.5 1.5]);

disp('zero');

else

ami=ami*-1;

if h(n+1)==0

if ami==1

y=(t<n-0.5);

else

y=-(t<n-0.5);

end

else

if ami==1
y=(t<n-0.5)-(t==n);

else

y=-(t<n-0.5)+(t==n);

end

end

d=plot(t,y);grid on;

title('Line code AMI RZ');

set(d,'LineWidth',2.5);

hold on;

axis([0 length(h)-1 -1.5 1.5]);

disp('one');

end

n=n+1;

%pause;

End
MANCHESTER

function MANCHESTER(h)
h=[1 0 0 1 1 0 1 0 1 0];

clf;

n=1;

h=~h;

l=length(h);

h(l+1)=1;

while n<=length(h)-1;

t=n-1:0.001:n;

if h(n) == 0

if h(n+1)==0

y=-(t<n)+2*(t<n-0.5)+1*(t==n);

else

y=-(t<n)+2*(t<n-0.5)-1*(t==n)

end

d=plot(t,y);grid on;

title('Line code MANCHESTER');

set(d,'LineWidth',2.5);

hold on;

axis([0 length(h)-1 -1.5 1.5]);

disp('one');

else

if h(n+1)==0

y=(t<n)-2*(t<n-0.5)+1*(t==n);

else

y=(t<n)-2*(t<n-0.5)-1*(t==n)
end

d=plot(t,y);grid on;

title('Line code MANCHESTER');

set(d,'LineWidth',2.5);

hold on;

axis([0 length(h)-1 -1.5 1.5]);

disp('zero');

end

n=n+1;

%pause;

End

CONCLUSIONES

La codificación de línea fue creada para satisfacer la necesidad de transmitir señales


digitales a través de variados medios de transmision. Las codificaciones de línea son una
manera útil de cuantificar la señal de manera que sea más fácil la detección de errores y
tener una señal segura. Es una manera muy simple de codificar pero no es muy ocupada
en la transmisión debido a que no posee capacidad de sincronización.

También podría gustarte