



Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity
Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium
Esta página no es visible en la vista previa
¡No te pierdas las partes importantes!




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)== 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)== 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
h=[1 0 0 1 1 0 1 0 1 0]; clf; n=1; 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)== 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)== 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
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)== 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)== 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