MATLAB program for plotting the power spectral densities of NRZ unipolar, NRZ polar, NRZ bipolar and Manchester polar line coding schemes.
MATLAB Program:
%Code:
f=-1:0.01:1;
Tb=2;
a=4;
x1=(sinc(f*Tb)).^2;
x2=x1*Tb*((a^2)/4);
x=x1*Tb*(a^2);
z=(f==0);
z1=((a^2)/4)*z;
x_2=x2+z1;
v=(sin(pi*f*Tb).^2);
x_3=x.*v;
vm=(sinc(f*Tb/2)).^2;
vm1=(sin(pi*f*Tb/2).^2);
x_4=(a^2)*Tb*vm.*vm1;
plot(f,x,'r',f,x_2,'g',f,x_3,'b',f,x_4,'c');
legend('NRZ-Polar','NRZ-Unipolar','NRZBipolar','Manchester
polar');
Outputs:
No comments