Professional Documents
Culture Documents
GPS
GPS
Mounchili Mama
School of Engineering
Blekinge Institute of Technology
SE - 371 79 Karlskrona
Sweden
This thesis is submitted to the School of Engineering at Blekinge Institute
of Technology in partial fulfillment of the requirements for the degree of
Master of Science in Mathematical Modeling and Simulation. The thesis is
15 credit (15 ECTS ) equivalent to ten weeks of full time studies.
Contact Information
School of Engineering
Blekinge Institute of Technology
SE - 371 79 Karlskrona
Sweden
Internet : http://www.bth.se/tek/master
Sincere thanks to my Parents and
Siblings who always stood by me whenever needed, without whom I couldnt
be a complete person. Finally to my wife Fatimatou Zahra embellishing my
life, by caring so much about me. I love you Zahra.
Abstract
Recently, there has been increasing interest within the potential user com-
munity of Global Positioning System (GPS) for high precision navigation
problems such as aircraft non precision approach, river and harbor navi-
gation, real-time or kinematic surveying. In view of more and more GPS
applications, the reliability of GPS is at this issue.
The work in this thesis will mainly focuss on how to model a Mathematical
expression for tracking GPS Signal using Phase Locked Loop filter receiver.
Mathematical formulation of the filter are of two types: the first order
and the second order loops are tested successively in order to find out a
compromised on which one best provide a zero steady state error that will
likely minimize noise bandwidth to tracks frequency modulated signal and
returns the phase comparator characteristic to the null point. Then the
Z-transform is used to build a phase-locked loop in software for digitized
data. Finally, a Numerical Methods approach is developed using either
MATLAB or Mathematica containing the package for Gaussian elimination
to provide the exact location or the tracking of a GPS in the space for a
given a coarse/acquisition (C/A) code.
i
Acknowledgements
iii
Contents
Contents iv
List of Figures vi
1 Introduction 1
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 GPS Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.3 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 Scope and Objective . . . . . . . . . . . . . . . . . . . . . . 3
1.5 Thesis Structure . . . . . . . . . . . . . . . . . . . . . . . . . 3
iv
v
Bibliography 33
vi
Chapter 1
Introduction
1.1 Introduction
The Global Positioning System (GPS) is a satellite-based navigation system
[1], that was developed by the U.S. Department of Defense (DoD) in the
early 1970s. Primarily, GPS was developed as a military system to fulfill
U.S. military needs. However, it was later made available to civilians, and
is now a dual-use system that can be accessed by both military and civilian
users [2]. GPS provides continuous positioning and timing information,
anywhere in the world under any weather conditions. Because it serves an
unlimited number of users as well as being used for security reasons, GPS
is a one-way-ranging (passive) system [4]. That is, users can only receive
the satellite signals.
1
2 CHAPTER 1. INTRODUCTION
The user segment consists of the GPS receiver equipment, which re-
ceives the signals from the GPS satellites and uses the transmitted in-
formation to calculate the users three-dimensional position and time.
1.3 Motivation
GPS satellites provide service to civilian and military users [8]. The civilian
service is freely available to all users on a continuous, worldwide basis. The
military service is available to governments and allied armed forces as well
as other Government agencies.
A variety of GPS augmentation systems and techniques are accessible
to improve system performance to meet specific user requirements. The
improved signal availability, accuracy, and integrity, allows even better per-
formance than is possible using the basic GPS civilian service.
1.4. SCOPE AND OBJECTIVE 3
The outstanding performance of GPS over many years has earned the
confidence of millions of civil users worldwide. It has proven its dependabil-
ity in the past and promises to be of benefit to users, all over the world, far
into the future.
The main objective in this chapter is to determine how GPS signal can
be processed by using acquisition and tracking algorithms to extract the
navigation information bits from the raw data. The navigation data bits
provide all the necessary information to compute the pseudo-range between
the receiver and the visible satellites.
5
6 CHAPTER 2. MODELING OF GPS TRACKING SIGNALS
Figure 2.2: Schematic showing the generation of L1 band GPS signal. The
equation is the mathematical representation of C/A code in L1 band
2.2. BASIC PHASE-LOCKED LOOPS 7
resented by the equation shown in the figure for C/A code. In conventional
hardware-based GPS receiver, the lower three blocks in Fig.2.2 are imple-
mented in an IC chip and hence the user cannot access the algorithms
built inside the chips. In software-based receiver, these blocks are fully
implemented using high level programming languages granting the user a
complete control over the algorithms. Hence the main difference between
the software-based GPS receiver and a conventional hardware receiver.
In the case of phase shifts in the carrier due to the C/A code, as in a GPS
signal, the code has to be stripped off first. The tracking process will follow
the signal and acquire the information of the navigation data. In case a
GPS receiver is stationary, the desired frequency variation is very slow due
to satellite motion. Given this condition, the frequency variation of the
locally generated signal is also slow; consequently, the update rate of the
tracking loop can be low. Therefore, to track a GPS signal two tracking
loops are needed: a loop to track the carrier frequency referred as carrier
loop and the other one to track the C/A code known as the code loop.
Figure 2.3a shows the time domain configuration and Figure 2.3b shows the
s-domain configuration, which is obtained from the Laplace transform. The
input signal is i (t) and the output from the voltage-controlled oscillator
(VCO) is f (t). The phase comparator measures the phase difference
of these two signals. The amplifier k0 represents the gain of the phase
comparator and the low-pass filter limits the noise in the loop. The input
8 CHAPTER 2. MODELING OF GPS TRACKING SIGNALS
voltage Vo to the VCO controls its output frequency, which can be expressed
as:
k1
f (s) = V0 (s) (2.7)
s
Hence result the following:
Vc (s) V0 (s) sf (s)
(t) = i (s) f (s) = = = or
k0 k0 F (s) k0 k1 F (s)
2.2. BASIC PHASE-LOCKED LOOPS 9
s
i (s) = f (s) 1 + (2.8)
k0 k1 F (s)
Where (s) is the error function. The transfer function H(s) of the loop is
defined as:
f (s) k0 k1 F (s)
H(s) = (2.9)
i (s) s + k0 k1 F (s)
The error transfer function can be defined as:
(s) i (s) f (s) s
He (s) = = = 1 H(s) = (2.10)
i (s) i (s) s + k0 k1 F (s)
1
i (t) = u(t) or i (s) = (2.12)
s
The second type is a frequency-modulated signal
i (t) = (t) or i (s) = (2.13)
s2
F (s) = 1 (2.14)
k0 k1
H(s) = (2.15)
s + k0 k1
Then the noise bandwidth can be expressed as:
Z
(k0 k1 )2 (k0 k1 )2
Z
d
Bn = 2 2
df =
0 + (k0 k1 ) 2 0 + (k0 k1 )2
2
(k0 k1 )2
k0 k1
Bn = tan1 = (2.16)
2k0 k1 k0 k1 0 4
Given the input signal i (s) = 1/s, the error function can be found from
Equation (2.10) as:
1
(s) = i (s)He (s) (2.17)
s + k0 k1
The steady-state error can be found from the final value theorem [7] of the
Laplace transform as follow:
It follows from this relation, the final value of (t) can be found as:
s
lim (t) = lim s(s) = lim =0 (2.19)
t s0 s0 s + k0 k1
Given the input signal i (s) = /s2 , the error function becomes:
1
(s) = i (s)He (s) (2.20)
s s + k0 k1
Then the steady state error becomes:
lim (t) = lim s(s) = lim = (2.21)
t0 s0 s0 s + k0 k1 k0 k1
It results that the steady-state phase error is not equal to zero. Therefore
for a large value of k0 k1 makes the error small. However, from Equation
(2.15) the 3 dB bandwidth occurs at s = k0 k1 . Thus a small value of (t)
also means large bandwidth, that is likely to contain more noise.
k0 k1 2 n 2
2n =
or = (2.25)
1 2
Therefore the noise bandwidth can be found as:
2
Z
n
Z 1+ 2 n
Bn = |H(j)|2 df = 2 2 2 dw
2
0 0
1 n
+ 2 n
or
2
n
Z 1 + 4 2 n n
1
= 4 2 dw = + (2.26)
2 2 4
0
n
+ 2(2 2 1) n
+1
This integration can be found in the appendix of [6]. Therefore the error
transfer function can be obtained from Equation (2.10) as:
s2
He (s) = 1 H(s) = (2.27)
s2 + 2n s + n2
And whenever i (s) = 1/s, the error function becomes:
s2
(s) = (2.28)
s2 + 2n s + n2
At steady state the error is given by:
Unlike the first-order loop, the steady-state error is zero for the frequency
modulated signal. Meaning that, the second-order loop tracks a frequency-
modulated signal and returns the phase comparator characteristic to the
null point. Therefore, the conventional phase-locked loop in a GPS receiver
is usually a second-order one.
2 1 z 1
s= (2.30)
ts 1 + z 1
where ts is the sampling interval. Substituting this relation in Equation
(2.22) the filter is transformed to:
C2 (C1 + C2) C1 z 1
F (z) = C1 + = (2.31)
1 z 1 1 z 1
where:
22 ts ts
C1 = and C2 = (2.32)
21 1
This filter is shown in Figure 2.4. The VCO in the phase-locked loop is
replaced by a direct digital frequency synthesizer and its transfer function
N (z) can be used to replace the result in Equation (2.7) with:
2.4. CARRIER AND CODE TRACKING 13
f (z) k1 z 1
N (z) = (2.33)
V0 (z) 1 z 1
Using the same approach as Equation (2.8), the transfer function H(z) can
be written as:
f (z) k0 F (z)N (z)
H(z) = = (2.34)
i (z) 1 + k0 F (z)N (z)
The substituting the results of Equations (2.33) and (2.35) into the above
equation, yields:
k0 k1 (C1 + C2 )z 1 k0 k1 C1 z 2
H(z) = (2.35)
1 + [k0 k1 (C1 + C2 ) 2]z 1 + (1 k0 k1 C1 )z 2
By using the bilinear transform in Equation (2.32) to Equation (2.23), the
result can be written as:
1 8n ts
C1 =
k0 k1 4 + 4n ts + (n ts )2
1 4n ts
C2 = (2.37)
k0 k1 4 + 4n ts + (n ts )2
The filter here is implemented in digital format and the result can be used for
phase-locked loop designs, but it is not the part of this thesis scope since we
are only concerned with mathematical expression. Where the desired noise
bandwidth signal from the Equation (2.26) can is expressed as:
n 1
Bn = +
2 4
as from the motion of the GPS receiver. In order to track the GPS signal,
the C/A code information have to be removed. Consequently, it requires
two phase-locked loops to track a GPS signal. One loop is to track the C/
A code and the other one is to track the carrier frequency. These two loops
must be coupled together are depicted in Figure 3.3.
In Figure 2.3, the C/A code loop generates three outputs: an early
code, a late code, and a prompt code. The prompt code is applied to the
digitized input signal and strips the C/A code from the input signal. Strip-
ping the C/A code means to multiply the C/A code to the input signal
with the proper phase. The output will be a continuous wave (cw) signal
with phase transition caused only by the navigation data. This signal is
applied to the input of the carrier loop. The output from the carrier loop
is a cw with the carrier frequency of the input signal. This signal is used
to strip the carrier from the digitized input signal, which means using this
signal to multiply the input signal. The output is a signal with only a C/A
code and no carrier frequency, which is applied to the input of the code loop.
Every output passes through a moving average filter and the output of
the filter is squared. The two squared outputs are compared to generate a
2.5. GPS TARCKING LOOP SIGNALS 15
control signal to adjust the rate of the locally generated C/A code to match
the C/A code of the input signal. The locally generated C/A code is the
prompt C/A code and this signal is used to strip the C/A code from the
digitized input signal.
1. Set the bandwidths and the gain of the code and carrier loops. The
loop gain includes the gains of the phase detector and the VCO. The
bandwidth of the code loop is narrower than the carrier loop because
it tracks the signal for a longer period of time. Select the noise band-
16 CHAPTER 2. MODELING OF GPS TRACKING SIGNALS
4. Select the code loop gain (k0 k1 ) to be 50 and the carrier loop gain to
be 4100. These values are also one set of several possible selections.
The constants C1 and C2 of the filter can be found from Equation
(2.39).
The above four steps provide the necessary information for the two loops.
Once the constants of the loops are known, the phase of the code loop and
the phase of the carrier frequency can be adjusted to follow the input signals.
2.6 Conclusion
Hence the completed the algorithms for acquisition and tracking. The goal
of these algorithms has to be tested on various data sets in different envi-
ronment using different type of antenna including left hand and right hand
polarized antenna. I have found that, it is necessary to tune the parameters
of the tracking algorithm and threshold values of acquisition either dynam-
ically or based on some rule for successful acquisition and tracking of GPS
signal in standard environment. In some cases, we have found that tracking
could not be done for satellites though acquisition is perfect. In this case,
a change of parameter values of the Phase Lock Loop manually makes the
tracking successful. This type of manual setting shall be automated in the
future. The future work consists of extracting the navigation message from
the tracking output and to compute the position of the receiver. It is also
necessary to make the processing as fast as possible.
Chapter 3
The idea behind GPS is rather simple. If the distances from a point on
the Earth (a GPS receiver) to three GPS satellites are known along with
the satellite locations, then the location of the point (or receiver) can be
determined by simply applying the well-known concept of resection [5]. Now
arises a question on how we can get the distances to the satellites as well as
the satellite locations?
3.1 Introduction
As mentioned before, each GPS satellite continuously transmits a microwave
radio signal composed of two carriers, two codes, and a navigation message.
When a GPS receiver is switched on, it will pick up the GPS signal through
the receiver antenna. Once the receiver acquires the GPS signal, it will
process it using its built-in software. The partial outcome of the signal pro-
cessing consists of the distances to the GPS satellites through the digital
codes (known as the pseudo ranges) and the satellite coordinates through
the navigation message.
17
18 CHAPTER 3. NUMERICAL METHOD OF GPS TRACKING SIGNAL
[3].
(x x1 )2 + (y y1 )2 + (z z1 )2 = r12
(x x2 )2 + (y y2 )2 + (z z2 )2 = r22
(x x3 )2 + (y y3 )2 + (z z3 )2 = r32
(x x4 )2 + (y y4 )2 + (z z4 )2 = r42
Where xi , yi , zi are the known coordinates of the satellites in the space and
x, y, z are the unknown coordinate of the observer on the earth as shown
on the Figure 3.2. We now subtract the first of these equations from each
of the three. This eliminates quadratic terms in x, y, z and leads to the
following set of nonhomogeneous linear equation in x, y, z:
3.2. NUMERICAL EXPRESSION OF THE COORDINATES 19
2 2 2 2
2(x2 x1 )x + 2(y2 y1 )y + 2(z2 z1 )z = r1 x1 r2 + x2
(S) 2(x3 x1 )x + 2(y3 y1 )y + 2(z3 z1 )z = r12 x21 r32 + x23
2(x4 x1 )x + 2(y4 y1 )y + 2(z4 z1 )z = r12 x21 r42 + x24
Suppose that in addition the distances registered by the GPS devices are
20 CHAPTER 3. NUMERICAL METHOD OF GPS TRACKING SIGNAL
given by:
r1 = 23, 204, 698.51
r2 = 21, 585, 835, 37
r3 = 31, 364, 260.01
r4 = 24, 966, 798.73
Using the Gaussian Elimination to solve the system (S), the following results
are obtained:
x = 3.0168 106 m
y = 7231.03m
z = 3.13188 107 m
These are the coordinates of the observer with respect to a fixed known
origin on earth. Hence we have here the application of simple expressions
drawn from the analytical geometry of sphere and the elementary use of
Gaussian elimination to arrive at the solution of a problem of some so-
phistication. The practical implementation of the GPS had to await the
deployment of geosynchronous satellite and the hardware needed to pro-
duce compact GPS devices, which can now be installed in automobiles.
It is worth mentioning here that three equation (i.e., the use of only three
satellites in our case given that many can be involved) would have been suffi-
cient to calculate the coordinates x, y, z of the observer. In practice problem
when many satellites come into play. Hence the need to develop computer
algorithm that could be used to solve the problem in such situation.
GPS
The 3-dimensional coordinates of each satellite are the following:
x1 := 2088202.299
y1 := -11757191.370
z1 := 25391471.881
x2 := 11092568.240
y2 := -14198201.090
z2 := 21471165.950
3.3. NUMERICAL SOLUTION USING MATHEMATICA 21
x3 := 35606984.591
y3 := -4447027.239
z3 := 9101378.572
x4 := 3966929.048
y4 := 7362851.831
z4 := 26388447.172
r1 := 23204698.51
r2 := 21585835.37
r3 := 31364260.01
r4 := 24966798.73
The striking feature in this output is the terseness of the statement imple-
menting the solution. The bulk of the output is taken up with the descrip-
tion of the system to be solved and listing of the numerical coefficients of
the equations involved. Implementation takes only two lines and is obtained
with the command In[721], where Solve is the code for the Gaussian elim-
ination routine and the Out[721] is the result of its application.
GPS has found his way into many applications, mainly as result of its ac-
curacy, global availability, and cost-effectiveness.
4.1 Introduction
GPS has been available for civil and military use for more than two decades.
That period of time has witnessed the creation of numerous new GPS ap-
plications. Because it provides high-accuracy positioning in a cost effective
manner, GPS has found its way into many industrial applications, replacing
conventional methods in most cases. For example, with GPS, machineries
can be automatically guided and controlled. This is especially useful in
hazardous areas, where human lives are endangered. Even some species of
birds are benefiting from GPS technology, as they are being monitored with
GPS during their immigration season. This way, help can be presented as
needed. This chapter describes how GPS is being used in land, marine, and
airborne applications.
23
24 CHAPTER 4. GLOBAL POSITION SYSTEMS APPLICATIONS
such as gas lines can be accurately collected, along with their attributes
(such as their conditions and whether or not a repair is needed). The col-
lected information can then be used by a GIS system to create updated
utility maps.
In road construction and Earth moving, GPS, combined with wireless com-
munication and computer systems, is installed onboard the Earthmoving
machine [11]. Designed surface information, in a digital format, is uploaded
into the system. With the help of the computer display and the real-time
GPS position information, the operator can view whether the correct grade
has been reached (see Figure 4.2). In situations in which millimeter-level
elevation is needed, GPS can be integrated with rotated beam lasers [12].
GPS is also used to track the location and usage of equipment at differ-
ent sites. By sending this information to a central location, GPS enables
contractors to deploy their equipment more efficiently. Moreover, vehicle
operators can be efficiently guided to their destinations
It is clear that unless the positions of the energy source and the geophones
are known with sufficient accuracy, the very expensive seismic data becomes
useless. GPS is used to provide the positioning information in a standard
4.5. GPS FOR MARINE SEISMIC SURVEYING 27
Different methods are used iJ1 marine seismic surveys depending on the
water depth. In deep waters, seismic vessels tow seismic cables, known
as streamers, which contain devices called hydrophones used for detecting
reflected energy. A single vessel will normally tow four to eight parallel
streamers; each has a length of several kilometers [14]. The low-frequency
acoustic energy is generated using a number of air guns towed behind the
vessel at about 6m below the surface. In shallow waters, both the land
and the marine methods are used. Ocean bottom cable (OBC) survey is a
relatively new technology that has been used recently for water depth of up
to about 200m. In this method, hydrophones and geophones are combined
in a single receiver to avoid water column reverberation (Figure 4.4).
To obtain meaningful results, the positions of the energy source and the
hydrophones must be known with sufficient accuracy. This can be eas-
ily achieved, at lower cost, with GPS. As the operation of marine seismic
surveys is very expensive, the issue of quality control (QC) is essential. To
maintain QC, the seismic industry has suggested the use of two independent
positioning systems, with GPS being the primary one [14].
4.6. GPS FOR VEHICLE NAVIGATION 29
The driver usually gets turn-by-turn instructions, with audio and/or visual
indications, to the destination. If the driver misses a turn, the system
30 CHAPTER 4. GLOBAL POSITION SYSTEMS APPLICATIONS
displays a warning message and finds an alternative best route based on the
current location of the vehicle. Some manufacturers add cellular systems
to provide weather and traffic information and to locate the vehicles in
case of emergency. Recent advances in wireless communication technology
even make it possible for drivers to remotely access the Internet from their
vehicles [17].
Unfortunately, both the odometer and the compass drift over time, which
causes significant error in the estimated position. Signposts, in contrast,
are radio beacon transmitters that are placed at known locations along the
bus routes [19]. Each beacon transmits a low-power microwave signal, which
is detected by a receiver on the bus, to account for the odometers drift error.
The integrated positioning system not only helps the transit authorities to
locate their fleet of buses on a digital base map in real time, but also helps
in performing other advanced functions (see Figure 4.6). For example, if the
bus locations are available in real time, the bus arrival times at the bus stops
can be computed reliably, thus minimizing the waiting time at the bus stops.
This is a very important feature, especially under severe weather conditions.
In addition, the availability of the real-time bus location information enables
the transit authorities to dynamically design more efficient bus scheduling,
thus improving bus efficiency and customer service. This information can
be accessed through the Internet, greatly enhancing customer satisfaction
[18].
Bibliography
[1] Dinesh M., Yongcheol S., Ryosuke S., Technical Repport of IEICE. GPS
Signal Acquisition and Tracking. The Institute of Electronics, Information
and Communication Engineers. [cited at p. 1]
[4] Langley, R.B, Why is The GPS signal so Complex?, GPS World, Vol. 1,
No. 3 May/June 1990, pp. 5659. [cited at p. 1]
[5] Langley, R.B, The mathematic of GPS, GPS World, Vol. 2, No. 7
July/August 1991, pp. 4550. [cited at p. 17]
[6] Peyton Z., Peebles, JR. Tata eds. 2001. Probability, Random Variables and
Random Signal principles. Tata McGraw-Hill Publishing Company Limited.
New Delhi. [cited at p. 8, 9, 11]
[11] Smith, B. S., GPS Grade Control for Construction, Smith, B. S., "GPS
Grade Control for Construction," Proc. ION GPS 2000, 13th Intl. Techni-
33
34 BIBLIOGRAPHY
cal Meeting, Satellite Division, Institute of Navigation, Salt Lake City, UT,
September 19-22, 2000, pp. 10341037. [cited at p. 25]
[12] Elfick, M., et al., Elementary Surveying, 8th Edition, Newy York: Harper-
Collins, 1994. [cited at p. 25]
[14] Jensen, M.H Quality Control for Differential GPS on Offshore Oil and
Gaz Exploration, GPS World, Vol. 3, No. 8 September 1992, pp. 3648.
[cited at p. 26, 28]
[16] Zhao, Y., Vehicle Location and Navigation Systems, Nonvood, MA: Artech
House, 1997. [cited at p. 29]
[17] Hada, H., et al., The Internet, Cars, and DGPS: Bringing Mobile Sensors
and Global Correction Services On Line, GPS World, Vol. 11, No.5, May
2000, pp. 3843. [cited at p. 30]
35
Appendix A
37
% p7 1.m performs acquisition on collected data
clear
yy c zeros(21,n);
for i c [1:3];
frccfrq-400+(i-1)*400;
mfrq0(i)csum(za5(1:5000) .* exp(j*2*pi*fr*ts*nn));
mfrq1(i)cabs(mfrq0(i));
end
[mamp mrw] c max(mfrq1); % find highest peak
mfrqccfrq+200*(mrw-2);
frcmfrq; % medium freq
% ***** Adjust phase and take out possible phase shift *****
thresholdc2.3*pi/5;
for ic1:4;
if abs(zc5(i))>threshold;% for angle adjustment
zc5(i)czc5fix(i)-2*pi;
if abs(zc5(i))>threshold;
zc5(i)czc5fix(i)+2*pi; % end
if abs(zc5(i))>2.2*pi/5; % for pi phase shift correction
zc5(i)czc5fix(i)-pi;
if abs(zc5(i))>threshold;
zc5(i)czc5fix(i) - 3*pi;
if abs(zc5(i))>threshold;
zc5(i)czc5fix(i)+pi; %end
end
end
end
end
end
end
dfrqcmean(zc5)*1000/(2*pi);
frrcfr+dfrq;% fine freq
plot(abs(yy(crw,1:n)))
title([GPS c num2str(svnum) max at num2str(pt init)])
figure
plot(abs(yy):,ccn)), *)
% title([GPS c num2str(svnum) Freq c num2str(frr)])
format
pt init
format long e
frr
b c [1:n];
c c ceil((ts*b+offset)/tc);
code c code a(c);
if offset>c0;
code2c[code(1) code(1:n-1)];
else
code2c[code(n) code(1:n-1)];
end
function [ca used]ccodegen(svnum);
gs2 c [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];
g2shiftcg2s(svnum,1);
ss ca c g1.*g2;
ca usedc-ss ca;