Codigo Manchestes y Codificacion Diferencial

5
Sistemas de Comunicación TRABAJO #1 Tema: Código de Manchester y Codificación Diferencial Realizado por: Jorge Suasnavas Curso: 7mo “C” Fecha: 27-4-2012

Transcript of Codigo Manchestes y Codificacion Diferencial

Page 1: Codigo Manchestes y Codificacion Diferencial

Sistemas de Comunicación

TRABAJO #1

Tema: Código de Manchester y Codificación Diferencial

Realizado por:Jorge Suasnavas

Curso: 7mo “C”

Fecha: 27-4-2012

Page 2: Codigo Manchestes y Codificacion Diferencial

CÓDIGO MANCHESTER

CÓDIGO EN MATLAB:

Datos ingresados en Matlab:

Gráfica Obtenida:

function MANCHESTER(h)%Example:%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('CÓDIGO MANCHESTER'); set(d,'LineWidth',2.5); hold on; axis([0 length(h)-1 -1.5 1.5]); %disp('UNO');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('CODIGO MANCHESTER'); set(d,'LineWidth',2.5); hold on; axis([0 length(h)-1 -1.5 1.5]); %disp('CERO');endn=n+1;%pause;end

Page 3: Codigo Manchestes y Codificacion Diferencial

0 1 2 3 4 5 6 7 8-1.5

-1

-0.5

0

0.5

1

1.5CODIGO MANCHESTER

Figura 1. Resultado obtenido aplicando el código Manchester.

CODIFICACIÓN DIFERENCIAL

CÓDIGO EN MATLAB:

function DIFERENCIAL(h)clf;n=1;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)+1*(t==n);; end d=plot(t,y);grid on; title('CODIFICACION DIFERENCIAL'); set(d,'LineWidth',2.5); hold on; axis([0 length(h)-1 -1.5 1.5]); disp('CERO');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('CODIFICACION DIFERENCIAL'); set(d,'LineWidth',2.5); hold on; axis([0 length(h)-1 -1.5 1.5]); disp('UNO');endn=n+1;%pause;end

Page 4: Codigo Manchestes y Codificacion Diferencial

Datos ingresados en Matlab:

Gráfica Obtenida:

0 1 2 3 4 5 6 7 8 9 10-1.5

-1

-0.5

0

0.5

1

1.5CODIFICACION DIFERENCIAL

Figura 2. Resultado obtenido aplicando el Codificación Diferencial.

Page 5: Codigo Manchestes y Codificacion Diferencial