test5.m

来自「Galileo BOC 码产生捕获相关仿真结果」· M 代码 · 共 53 行

M
53
字号

svnum=1;
Svnum = 1;
Doppler = 2.25e+3;
%DownCvt_FreqPara = 50;
% Doppler(i)=-6.9e3+(i-1)*100;
gpsdata = MySglGen(Svnum, Doppler);
lpfdata=gpsdata;
% **************initial parameters****************
fs=4.8e+6;  % the sampling frq;
ts=1/fs;
fc=30e+3;   % the center frq without the Doppler;
Rc=1.023e+6;

AccumPara=1;    % the parameter that divides the 1ms; 16 or 8 or 4
AccumTime=1e-3/AccumPara;   % the accumulation time interval;
CorrelationLength=AccumTime*fs;  % the correlation length for one time;

intodat=2531;   % the initial phase 
% svnum=1;    % the PRN number;

AcquireTime=1;  % the total acquisition time for one time, united by 1ms;


% **** start the acquisiton ******************
% ******* the circular correlation method ***************

%*** input the GPS data that have passed through the down convert****
GPSdata=zeros(1,CorrelationLength);
GPSdata=lpfdata(intodat:intodat+CorrelationLength-1);   % get CorrelationLength points out of the data stream coming from the LPF, 
                                                        %   started at the point of intodat;
% GPSdata = conj(GPSdata);
gf = fft(GPSdata);
gf = conj(gf);
FreqValue = zeros(21, CorrelationLength);
for i=1:21
    fri = fc - 10000 + (i-1)*1000;
    lsi = LocalCarrierCodeGen(svnum, CorrelationLength, fri, 0, 0);
    lf = fft(lsi);
    FreqValue(i,:) = ifft(lf .* gf);
    plot(abs(FreqValue(i,:)))
end

[amp crw] = max(max(abs(FreqValue')));
[amp ccn] = max(max(abs(FreqValue)));
pt_init=ccn; % initial point
cfrq = fc - 10000 + (crw-1)*1000;

plot(abs(FreqValue(crw,:)))
amp
ccn
slew=mod(floor(ccn*Rc/fs),1023*2)
cfrq

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?