Upload
jorge-suasnavas
View
750
Download
8
Embed Size (px)
Citation preview
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
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
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
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.