使用
Matlab
生成
gold
码的源程序:
echo on
%first determine the maximal length shift register sequences
%
将移位寄存器的内容初始化为“
0000
”
connections1=[1 0 1 0 0];
connections2=[1 1 1 0 1];
sequence1=ss_mlsrs (connections1);
sequence2=ss_mlsrs (connections2);
%
将第二个序列循环移位并与第一个序列相加
L=2^length (connections1)-1;
for shift_amount=0:L-1
tempt =[sequence2(shift_amount+1:L)
sequence2(1:shift_amount)];
gold_seq(shift_amount+1,:)=(sequence1+tempt)
-floor((sequence1+ tempt)./2).*2;
end;
%
查找这些序列中互相关的最大值
max_cross_corr=0;
for i=1:L-1
for j=i+1
%
平衡各序列
c1=2* gold_seq(i,:)-1;
c2=2* gold_seq(j,:)-1;
for m=0:L-1<