Está en la página 1de 2

function BRZ(h)

%Example:
h=input('ingrese una secuencia de bits de la forma [1 0 ...]: \n');
%BRZ(h)
bit=[];
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-0.5)-(t==n);
else
y=-(t<n-0.5)+(t==n);
end
d=plot(t,y);
grid on;
title('Codigo de linea 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('Codigo de linea 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
%DEP
A=1;
Tb=1;
R=1/Tb;
L=2*R;
f=0:L/50:L;
del=0;
P=(A.^2*Tb)*(sinc(f*Tb)).^2.*(1-cos(2*pi*f*Tb));
g=plot(f,P);
title('Densidad espectral de potencia: BIPOLAR RZ');
xlabel('Frecuencia hz');
ylabel('Potencia Normalizada');
axis([0 L 0 1.1*Tb]);set(g,'Linewidth', 2.5);
set(gca,'XTickMode','manual','XTick', [R,2*R]);grid on;
set(gca,'YTickMode','manual','XTick', [0.5*Tb,Tb]);grid on;

comentario:

este código de línea tiene la ventaja de tener autosincronismo pero a esta ventaja se le
contrapone que requiere mayor ancho de banda pues los pulsos son de menor duración que otros
códigos de línea.

También podría gustarte