References

1. Oppenheim, A. V., Schafer, R. W., Digital Signal Processing, Prentice-Hall, Engle-wood Cliffs, NJ, 1975.

2. Van Nee, D. J. R., Coenen, A. J. R. M., "New fast GPS code acquisition technique using FFT," Electronics Letters, vol. 27, pp. 158-160, January 17, 1991.

3. Tomlinson, M., School of Electronic, Communication and Electrical Engineering, University of Plymouth, United Kingdom, private communication.

4. Lin, D., Tsui, J., "Acquisition schemes for software GPS receiver," ION GPS-98, pp. 317-325, Nashville, TN, September 15-18, 1998.

5. Wolfert, R., Chen, S., Kohli, S., Leimer, D., Lascody, J., "Rapid direct P(Y)-code acquisition in a hostile environment," ION GPS-98, pp. 353-360, Nashville, TN, September 15-18, 1998.

6. Spilker, J. J., "GPS signal structure and performance characteristics," Navigation, Institute of Navigation, vol. 25, no. 2, pp. 121-146, Summer 1978.

7. Tsui, J. B. Y., Digital Techniques for Wideband Receivers, Artech House, Boston, 1995.

% p7_1.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(1d: \gps\Big_data\srvy1sf1.dat' , ' r1); fseek(fid,intodat -1 , 1 bof 1); x2=fread(fid,6*n,'schar');

% ******* 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];

mfrq0(i)=sum(za5(1:5000) .* exp(j*2*pi*fr*ts*nn)); mfrq1(i)=abs(mfrq0(i)); end

[mamp mrw] = max(mfrq1); % find highest peak mfrq=cfrq+200*(mrw-2);

fr=mfrq; % medium freq

zb5=za5 .* exp(j*2*pi*fr*ts*[0:5*n-1]); % one DFT component zc5=diff(-angle(sum(reshape(zb5,n,5)))); % find difference angle zc5fix=zc5;

%******* Adjust phase and take out possible phase shift *******

if abs(zc5(i))>threshold;% for angle adjustment zc5(i)=zc5fix(i)-2*pi; if abs(zc5(i))>threshold;

zc5(i)=zc5fix(i)+2*pi; % end if abs(zc5(i))>2.2*pi\5; %for pi phase shift correction zc5(i)=zc5fix(i)-pi;

if abs(zc5(i))>threshold; zc5(i)=zc5fix(i)-3*pi; if abs(zc5(i))>threshold; zc5(i)=zc5fix(i)+pi; %end end end end end end end dfrq=mean(zc5)*1000/(2*pi); frr=fr+dfrq;% fine freq plot(abs(yy(crw,1:n)))

num2str(pt_init)])

% title(['GPS = ' num2str(svnum) ' Freq = ' num2str(frr)])

format pt_init format long e frr

% digitizg.m This prog generate the C/A code and digitize it function code2 = digitizg(n,fs,offset,svnum);

% fs - sample frequency in Hz;

% offset - delay time in second must be less than 1/fs can not shift left

% svnum - satellite number;

gold_rate = 1.023e6; %gold code clock rate in Hz.

tc=1/gold_rate;

cmd1 = codegen(svnum); % generate C/A code code_in=cmd1;

% ******* creating 16 C/A code for digitizing ******* code_a = [code_in code_in code_in code_in]; code_a=[code_a code_a]; code_a=[code_a code_a];

% ******* adjusting first data point ******* if offset>=0;

% codegen.m generate one of the 32 C/A codes written by D.Akos modified by J. Tsui function [cajjsed]=codegen(svnum);

% cajjsed : a vector containing the desired output sequence % the g2s vector holds the appropriate shift of the g2 code to generate

% the C/A code (ex. for SV#19 - use a G2 shift of g2s(19)=471)

% svnum: Satellite number g2s = [5;6;7;8;17;18;139;140;141;251;252;254;255;256;257; ... 258;469;470;471;

472;473;474;509;512;513;514;515;516;859;860;861;862];

g2shift=g2s(svnum,1);

% ******* Generate G1 code ******* % load shift register reg = -1*ones(1,10); for i = 1:1023, g1(i) = reg(10); save1 = reg(3)*reg(10); reg(1,2:10) = reg(1:1:9); reg(1) = save1;

end,

% ******* Generate G2 code ******* % load shift register reg = -1*ones(1,10); for i = 1:1023, g2(i) = reg(10);

save2 = reg(2)*reg(3)*reg(6)*reg(8)*reg(9)*reg(10); reg(1,2:10) = reg(1:1:9); reg(1) = save2;

end,

g2tmp(1,1:g2shift)=g2(1,1023-g2shift+1:1023); g2tmp(1,g2shift+1:1023)=g2(1,1:1023-g2shift); g2 = g2tmp;

% ******* Form single sample C/A code by multiplying G1 and G2

CHAPTER EIGHT

Was this article helpful?

0 0

Post a comment