您好,欢迎访问三七文档
%双极性归零码drzfunctiony=drz(x)grid=300;x=[111000000001100];t=0:1/grid:length(x);fori=1:length(x)if(x(i)==1)forj=1:grid/2y(grid/2*(2*i-2)+j)=1;y(grid/2*(2*i-1)+j)=0;endelseforj=1:grid/2y(grid/2*(2*i-2)+j)=-1;y(grid/2*(2*i-1)+j)=0;endendendy=[y,x(i)];M=max(y);m=min(y);plot(t,y);axis([0,i,m-0.1,M+0.1]);title('111000000001100');%序列111000000001100对应的双极性归零码波形legend('双极性归零码')xlabel('时间t/s')ylabel('幅度A')%双极性不归零码dnrzfunctiony=dnrz(x)x=[111000000001100];grid=300;t=0:1/grid:length(x);%给出相应的时间序列fori=1:length(x)%计算码元的值if(x(i)==1)%如果输入信息为1forj=1:gridy((i-1)*grid+j)=1;%该码元对应的点值取1endelseforj=1:gridy((i-1)*grid+j)=-1;end;end;end;y=[y,x(i)];M=max(y);m=min(y);plot(t,y);axis([0,i,m-0.1,M+0.1]);title('111000000001100');%序列111000000001100对应的双极性不归零码波形legend('双极性不归零码')xlabel('时间t/s')ylabel('幅度A')
本文标题:双极性归零码不归零
链接地址:https://www.777doc.com/doc-6049633 .html