您好,欢迎访问三七文档
functionca=CAgenerate(number)%CA码的生成number=input('请输入1-32之间的一个整数:');G1=ones(1,10);G2=ones(1,10);m=ones(1,3);Code2=zeros(1,1);G2Table=[2,3,4,5,1,2,1,2,3,2,3,5,6,7,8,9,1,2,3,4,5,6,1,4,5,6,7,8,1,2,3,4;6,7,8,9,9,10,8,9,10,3,4,6,7,8,9,10,4,5,6,7,8,9,3,6,7,8,9,10,6,7,8,9];fori=1:1023R(1)=mod(G2(G2Table(1,number))+G2(G2Table(2,number)),2);rd(i)=mod(R(1)+G1(10),2);newBit1=[mod(G1(3)+G1(10),2)];G1=[newBit1G1(1:9)];newBit2=[mod(G2(2)+G2(3)+G2(6)+G2(8)+G2(9)+G2(10),2)];G2=[newBit2G2(1:9)];endcacode=repmat(rd,1,2);fori=1:2046ifcacode(i)==0cacode(i)=1;elsecacode(i)=-1;endendk=length(cacode);xk=fft(cacode,k);rm=real(ifft(conj(xk).*xk))/2046;rm=ifftshift(rm);plot(rm)set(gca,'xtick',[0:80:k-1]);xlabel('\zeta');ylabel('R(\zeta)');title('CA的自相关函数');
本文标题:CA码自相关仿真
链接地址:https://www.777doc.com/doc-5722391 .html