clear all;
g1 = [1,-1,1,-1,1,-1,1,-1,1,-1,1];
g2 = [1,-1,1,-1,1,-1,1,-1,1,-1,1];
for i=1:2046
g1s =g1(1)*g1(7)*g1(8)*g1(9)*g1(10)*g1(11);
G1(i)=g1(11);
g1=[g1s,g1(1:10)];
end
for i=1:2046
g2s =g2(1)*g2(2)*g2(3)*g2(4)*g2(5)*g2(8)*g2(9)*g2(11);
G2(i)=g2(1)*g2(10); % 1*10
g2=[g2s,g2(1:10)];
CB17(i) =G1(i)*G2(i);
end
CB1I =zeros(17,2046);
for PRN =1:17
switch PRN
case 1
for i=1:2046
g2s =g2(1)*g2(2)*g2(3)*g2(4)*g2(5)*g2(8)*g2(9)*g2(11);
G2(i)=g2(1)*g2(3); % 1*3
g2=[g2s,g2(1:10)];
CB1I(PRN,i) =G1(i)*G2(i);
end
case 2
for i=1:2046
g2s =g2(1)*g2(2)*g2(3)*g2(4)*g2(5)*g2(8)*g2(9)*g2(11);
G2(i)=g2(1)*g2(4); % 1*4
g2=[g2s,g2(1:10)];
CB1I(PRN,i) =G1(i)*G2(i);
end
case 3
for i=1:2046
g2s =g2(1)*g2(2)*g2(3)*g2(4)*g2(5)*g2(8)*g2(9)*g2(11);
G2(i)=g2(1)*g2(5); % 1*5
g2=[g2s,g2(1:10)];
CB1I(PRN,i) =G1(i)*G2(i);
end
case 4
for i=1:2046
g2s =g2(1)*g2(2)*g2(3)*g2(4)*g2(5)*g2(8)*g2(9)*g2(11);
G2(i)=g2(1)*g2(6); % 1*6
g2=[g2s,g2(1:10)];
CB1I(PRN,i) =G1(i)*G2(i);
end
case 5
for i=1:2046
g2s =g2(1)*g2(2)*g2(3)*g2(4)*g2(5)*g2(8)*g2(9)*g2(11);
G2(i)=g2(1)*g2(8); % 1*8
g2=[g2s,g2(1:10)];
CB1I(PRN,i) =G1(i)*G2(i);
end
case 6
for i=1:2046
g2s =g2(1)*g2(2)*g2(3)*g2(4)*g2(5)*g2(8)*g2(9)*g2(11);
G2(i)=g2(1)*g2(9); % 1*9
g2=[g2s,g2(1:10)];
CB1I(PRN,i) =G1(i)*G2(i);
end
case 7
for i=1:2046
g2s =g2(1)*g2(2)*g2(3)*g2(4)*g2(5)*g2(8)*g2(9)*g2(11);
G2(i)=g2(1)*g2(10); % 1*10
g2=[g2s,g2(1:10)];
CB1I(PRN,i) =G1(i)*G2(i);
end
case 8
for i=1:2046
g2s =g2(1)*g2(2)*g2(3)*g2(4)*g2(5)*g2(8)*g2(9)*g2(11);
G2(i)=g2(1)*g2(11); % 1*11
g2=[g2s,g2(1:10)];
CB1I(PRN,i) =G1(i)*G2(i);
end
case 9
for i=1:2046
g2s =g2(1)*g2(2)*g2(3)*g2(4)*g2(5)*g2(8)*g2(9)*g2(11);
G2(i)=g2(2)*g2(7); % 2*7
g2=[g2s,g2(1:10)];
CB1I(PRN,i) =G1(i)*G2(i);
end
case 10
for i=1:2046
g2s =g2(1)*g2(2)*g2(3)*g2(4)*g2(5)*g2(8)*g2(9)*g2(11);
G2(i)=g2(3)*g2(4); % 3*4
g2=[g2s,g2(1:10)];
CB1I(PRN,i) =G1(i)*G2(i);
end
case 11
for i=1:2046
g2s =g2(1)*g2(2)*g2(3)*g2(4)*g2(5)*g2(8)*g2(9)*g2(11);
G2(i)=g2(3)*g2(5); % 3*5
g2=[g2s,g2(1:10)];
CB1I(PRN,i) =G1(i)*G2(i);
end
case 12
for i=1:2046
g2s =g2(1)*g2(2)*g2(3)*g2(4)*g2(5)*g2(8)*g2(9)*g2(11);
G2(i)=g2(3)*g2(6); % 3*6
g2=[g2s,g2(1:10)];
CB1I(PRN,i) =G1(i)*G2(i);
end
case 13
for i=1:2046
g2s =g2(1)*g2(2)*g2(3)*g2(4)*g2(5)*g2(8)*g2(9)*g2(11);
G2(i)=g2(3)*g2(8); % 3*8
g2=[g2s,g2(1:10)];
CB1I(PRN,i) =G1(i)*G2(i);
end
case 14
for i=1:2046
g2s =g2(1)*g2(2)*g2(3)*g2(4)*g2(5)*g2(8)*g2(9)*g2(11);
G2(i)=g2(3)*g2(9); % 3*9
g2=[g2s,g2(1:10)];
CB1I(PRN,i) =G1(i)*G2(i);
end
case 15
for i=1:2046
g2s =g2(1)*g2(2)*g2(3)*g2(4)*g2(5)*g2(8)*g2(9)*g2(11);
G2(i)=g2(3)*g2(10); % 3*10
g2=[g2s,g2(1:10)];
CB1I(PRN,i) =G1(i)*G2(i);
end
case 16
for i=1:2046
g2s =g2(1)*g2(2)*g2(3)*g2(4)*g2(5)*g2(8)*g2(9)*g2(11);
G2(i)=g2(3)*g2(11); % 3*11
g2=[g2s,g2(1:10)];
CB1I(PRN,i) =G1(i)*G2(i);
end
case 17
for i=1:2046
g2s =g2(1)*g2(2)*g2(3)*g2(4)*g2(5)*g2(8)*g2(9)*g2(11);
G2(i)=g2(4)*g2(5); % 4*5
g2=[g2s,g2(1:10)];
CB1I(PRN,i) =G1(i)*G2(i);
end
otherwise
disp('ERROR');
end
end
save('CB1I.mat','CB1I');