Sie sind auf Seite 1von 4

Practice No.

1
Códigos de Línea
J. C. Prieto, cod. 1161298, Student, UFPS

frecuencia de la señal y la respuesta en frecuencia del canal de
transmisión.
I. INTRODUCCIÓN
Ancho de banda: contenido suficiente de señal de
temporización que permita identificar el tiempo
L a transmisión de datos en forma digital implica una cierta
codificación. A la forma de transmisión donde no se usa
portadora se la conoce como transmisión en banda base.
correspondiente a un bit.

Transparencia: independencia de las características del código


en relación a la secuencia de unos y ceros que transmita.
Los códigos de línea son usados para este tipo de transmisión.
Existen varios tipos de códigos, entre ellos unipolar NRZ,
polar NRZ, unipolar RZ, bipolar RZ (AMI), Manchester, CMI, Codigos
etc. Algunos de estos codigos se muestran en la figura 1.
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
II. DESARROLLO DE LA PRÁCTICA         y=(t<n)+1*(t==n);
    end
Autosincronización: contenido suficiente de señal de     d=plot(t,y);grid on;
temporización (reloj) que permita identificar el tiempo     title('Line code UNIPOLAR NRZ');
correspondiente a un bit.     set(d,'LineWidth',2.5);
    hold on;
Capacidad de detección de errores: la definición del código     axis([0 length(h)-1 -1.5 1.5]);
    disp('one');
incluye el poder de detectar un error.
end
Inmunidad al ruido: capacidad de detectar adecuadamente el
n=n+1;
valor de la señal ante la presencia de ruido (baja probabilidad
%pause;
de error).
End
Densidad espectral de potencia: igualación entre el espectro de
FUNCIÓN URZ(h)

function URZ(h)     end
    d=plot(t,y);grid on;
h=[1 0 0 1 1 0 1 0 1 0];     title('Line code POLAR NRZ');
%URZ(h)     set(d,'LineWidth',2.5);
clf;     hold on;
n=1;     axis([0 length(h)-1 -1.5 1.5]);
l=length(h);     disp('zero');
h(l+1)=1; else
while n<=length(h)-1;     if h(n+1)==0
    t=n-1:0.001:n;         y=(t<n)-1*(t==n);
%Graficación de los CEROS (0)     else
    if h(n) == 0         y=(t<n)+1*(t==n);
        if h(n+1)==0      end
            y=(t>n);     d=plot(t,y);grid on;
        else     title('Line code POLAR NRZ');
            y=(t==n);     set(d,'LineWidth',2.5);
        end     hold on;
    d=plot(t,y);grid on     axis([0 length(h)-1 -1.5 1.5]);
    title('Line code UNIPOLAR RZ');     disp('one');
    set(d,'LineWidth',2.5); end
    hold on; n=n+1;
    axis([0 length(h)-1 -1.5 1.5]); %pause;
    disp('zero'); end
%Graficación de los UNOS (1)
    else FUNCIÓN BRZ(h)
    if h(n+1)==0
        y=(t<n-0.5); function BRZ(h)
    else
        y=(t<n-0.5)+1*(t==n); %h=[1 0 0 1 1 0 1 0 1 0];
    end %BRZ(h)
    d=plot(t,y);grid on;  
    title('Line code UNIPOLAR RZ'); clf;
    set(d,'LineWidth',2.5); n=1;
    hold on; l=length(h);
    axis([0 length(h)-1 -1.5 1.5]); h(l+1)=1;
    disp('one'); while n<=length(h)-1;
end     t=n-1:0.001:n;
n=n+1; if h(n) == 0
%pause;     if h(n+1)==0 
end         y=-(t<n-0.5)-(t==n);
end     else
        y=-(t<n-0.5)+(t==n);
    end
    d=plot(t,y);grid on;
FUNCIÓN PNRZ(h)
    title('Line code BIPOLAR RZ');
function PNRZ(h)     set(d,'LineWidth',2.5);
    hold on;
    axis([0 length(h)-1 -1.5 1.5]);
%h=[1 0 0 1 1 0 1 0 1 0];     disp('zero');
%PNRZ(h) else
clf;     if h(n+1)==0
n=1;         y=(t<n-0.5)-1*(t==n);
l=length(h);     else
h(l+1)=1;         y=(t<n-0.5)+1*(t==n);
while n<=length(h)-1;     end
    t=n-1:0.001:n;     d=plot(t,y);grid on;
if h(n) == 0      title('Line code BIPOLAR RZ');
    if h(n+1)==0      set(d,'LineWidth',2.5);
        y=-(t<n)-(t==n);     hold on;
    else     axis([0 length(h)-1 -1.5 1.5]);
        y=-(t<n)+(t==n);
    disp('one'); %pause;
end end
n=n+1;
%pause; FUNCIÓN AMIRZ(h)
end
function AMIRZ(h)

FUNCIÓN AMINRZ(h) %h=[1 0 0 1 1 0 1 0 1 0];


%AMIRZ(h)
function AMINRZ(h)  
clf;
%h=[1 0 0 1 1 0 1 0 1 0]; n=1;
%AMINRZ(h) l=length(h);
clf; h(l+1)=1;
n=1; ami=-1;
l=length(h); while n<=length(h)-1;
h(l+1)=1;     t=n-1:0.001:n;
ami=-1; if h(n) == 0
while n<=length(h)-1;     if h(n+1)==0 
    t=n-1:0.001:n;         y=(t>n);
if h(n) == 0     else
    if h(n+1)==0          if ami==1
        y=(t>n);             y=-(t==n);
    else         else
        if ami==1             y=(t==n);
            y=-(t==n);         end
        else     end
            y=(t==n);     d=plot(t,y);grid on;
        end      title('Line code AMI RZ');
    end     set(d,'LineWidth',2.5);
    d=plot(t,y);grid on;     hold on;
    title('Line code AMI NRZ');     axis([0 length(h)-1 -1.5 1.5]);
    set(d,'LineWidth',2.5);     disp('zero');
    hold on; else
    axis([0 length(h)-1 -1.5 1.5]);     ami=ami*-1;
    disp('zero');     if h(n+1)==0
else         if ami==1
    ami=ami*-1;             y=(t<n-0.5);
    if h(n+1)==0         else
        if ami==1             y=-(t<n-0.5);
            y=(t<n);         end
        else     else
            y=-(t<n);         if ami==1
        end             y=(t<n-0.5)-(t==n);
    else         else
        if ami==1             y=-(t<n-0.5)+(t==n);
            y=(t<n)-(t==n);         end
        else        
            y=-(t<n)+(t==n);     end
        end     d=plot(t,y);grid on;
            title('Line code AMI RZ');
    end     set(d,'LineWidth',2.5);
    d=plot(t,y);grid on;     hold on;
    title('Line code AMI NRZ');     axis([0 length(h)-1 -1.5 1.5]);
    set(d,'LineWidth',2.5);     disp('one');
    hold on; end
    axis([0 length(h)-1 -1.5 1.5]); n=n+1;
    disp('one'); %pause;
end end
n=n+1;
FUNCIÓN MANCHESTER(h)

function MANCHESTER(h)

%h=[1 0 0 1 1 0 1 0 1 0];
%MANCHESTER(h)
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

Das könnte Ihnen auch gefallen