Global Positioning System Reference
In-Depth Information
%p71.m performs acquisition on collected data
clear
% ******* initial condition *******
svnum=input('enter satellite number = ');
intodat=10001; %input('enter initial pt into data (multiple
of n) = ');
fs=5e6; % *** sampling freq
ts=1/fs; % *** sampling time
n=fs/1000; % *** data pt in 1 ms
nn=[0:n-1]; % *** total no. of pts
fc=1.25e6; % *** center freq without Doppler
nsat=length(svnum); % *** total number of satellites to be
processed
% ******* input data file *********
fid=fopen('d: \ gps \ Big data \ srvy1sf1.dat','r');
fseek(fid,intodat-1,'bof');
x2=fread(fid,6*n,'schar');
yy = zeros(21,n);
% ******* start acquisition *******
code=digitizg(n,fs,0,svnum); % digitize C/A code
xf = fft(x2(1:n)');
for i = [1:21]; %**** find coarse freq 1 kHz resolution
fr=fc-10000+(i-1)*1000;
lc=code.* exp(j*2*pi*fr*ts*nn); % generate local code
lcf=fft(lc);
yy(i,:)=ifft(xf .* conj(lcf)); % circular correlation
end
[amp crw]=max(max(abs(yy'))); % find highest peak
[amp ccn]=max(max(abs(yy)));
pt init=ccn; % initial point
cfrq=fc+1000*(crw-11); % coarse freq
% ******* gerenate 5 ms data by stripping C/A code *******
z5=x2(pt init:pt init+5*n-1); % take 5 ms data starting with
C/A code
za5=z5' .* [code code code code code];% create cw from 5 sets
of data
% ******* find medium freq resolution 400 kHz apart *******
for i = [1:3];
fr=cfrq-400+(i-1)*400;
mfrq0(i)=sum(za5(1:5000) .* exp(j*2*pi*fr*ts*nn));
mfrq1(i)=abs(mfrq0(i));
end
Search WWH ::




Custom Search