?? ca_codes.m
字號:
clear all
% ***** Generates C/A codes *****
PRN_1 = generateCAcode(1); % SVN 1
PRN_2 = generateCAcode(2); % SVN 2
PRN1 = [PRN_1';PRN_1'];
PRN2 = [PRN_2';PRN_2'];
% ***** Calculate auto- and cross-correlation *****
for n=1:1023
Corr11(n) = PRN1(1:1023)'*PRN1(n:1022+n);
Corr12(n) = PRN1(1:1023)'*PRN2(n:1022+n);
end
figure(1)
subplot(121)
plot(Corr11);
axis([-50 1100 -100 1100]);
%title('Autocorrelation of a PRN sequence');
set(gca,'Fontsize',16)
ylabel('\itr_{kk}','Fontsize',16)
xlabel('Lag','Fontsize',16)
box off
subplot(122)
plot(Corr12);
axis([-50 1100 -100 1100]);
%title('Cross-correlation between two PRN sequences');
set(gca,'Fontsize',16)
ylabel('\itr_{ik}','Fontsize',16)
xlabel('Lag','Fontsize',16)
box off
print -deps2 ca-code-correlation
%%%%%%%%%%%%%%%% end ca_codes.m %%%%%%%%%%%%%%%
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -