Professional Documents
Culture Documents
Assisted-GPS in Java™
DISCLAIMER OF WARRANTY
The technical descriptions, procedures, and computer programs in this book have
been developed with the greatest of care and they have been useful to the author in a
broad range of applications; however, they are provided as is, without warranty of
any kind. Artech House, Inc. and the author and editors of the book titled
Server-Side GPS and Assisted-GPS in Java™ make no warranties, expressed or
implied, that the equations, programs, and procedures in this book or its associated
software are free of error, or are consistent with any particular standard of mer-
chantability, or will meet your requirements for any particular application. They
should not be relied upon for solving a problem whose incorrect solution could
result in injury to a person or loss of property. Any use of the programs or proce-
dures in such a manner is at the user’s own risk. The editors, author, and publisher
disclaim all liability for direct, incidental, or consequent damages resulting from use
of the programs or procedures in this book or the associated software.
Neil Harper
artechhouse.com
Library of Congress Cataloging-in-Publication Data
A catalog record for this book is available from the U. S. Library of Congress.
Disclaimer:
This eBook does not include the ancillary media that was
packaged with the original printed version of the book.
ISBN-13: 978-1-60783-985-9
Trademarks
Sun, Sun Microsystems, the Sun Logo, and Java are trademarks or registered trademarks of
Sun Microsystems, Inc. in the United States and other countries.
All rights reserved. Printed and bound in the United States of America. No part of this book
may be reproduced or utilized in any form or by any means, electronic or mechanical, includ-
ing photocopying, recording, or by any information storage and retrieval system, without
permission in writing from the publisher.
All terms mentioned in this book that are known to be trademarks or service marks have
been appropriately capitalized. Artech House cannot attest to the accuracy of this informa-
tion. Use of a term in this book should not be regarded as affecting the validity of any trade-
mark or service mark.
10 9 8 7 6 5 4 3 2 1
To my wife, Tracey,
our children, Kate, Emma, and Adam,
and my parents, Barry and Brigit,
who have made this, and everything else, possible.
Contents
Preface xiii
Acknowledgments xvii
CHAPTER 1
Introduction 1
1.1 Overview 1
1.2 Terminology 2
1.3 Global Navigation Satellites Systems (GNSS) 2
1.4 GNSS Augmentations 3
1.5 GPS from a High Level 3
1.6 Assisted-GNSS from a High Level 5
1.7 A-GNSS Protocols and Standards 9
1.8 Why Is an Accurate Location Required? 10
1.9 Location Market 11
1.9.1 E9-1-1 11
1.9.2 Location-Based Services 11
1.9.3 Lawful Intercept Services 12
1.10 Java and Software Design for A-GNSS Applications 12
1.10.1 Coding in Java 13
1.11 Organization of This Book 14
References 14
CHAPTER 2
Coding for GNSS and the Coordinate Reference Frame 17
2.1 Coordinate Reference Frame 17
2.2 World Geodetic System 1984 18
2.3 Source Code Structure and Management 22
2.4 WGS 84 Implementation 23
2.5 Unit Testing 27
2.6 Debugging 29
2.7 Performance Testing and Benchmarking 29
2.8 Code Coverage Analysis 30
2.9 Configuration Management 32
References 32
vii
viii Contents
CHAPTER 3
GPS 35
3.1 GPS Constellation and Segments 35
3.2 GPS Services 36
3.3 Satellites 36
3.4 Ranging Codes 36
3.5 PRN Codes 37
3.6 GPS C/A Code 37
3.7 GPS L1 Signal 38
3.8 GPS L2 Signal 38
3.9 GPS Time 39
3.10 Broadcast Information Navigation Message Structure (NAV) 39
3.11 Decoding and Storing the Navigation Model 46
3.11.1 Storing the Raw NAV Data 46
3.11.2 Running the Classes to Store the Raw Data 47
3.11.3 Other Sources of Raw NAV Data 49
3.11.4 Decoding the NAV Data into Useful Information 49
3.11.5 RINEX as a Data Source for the Navigation Message 50
3.11.6 Implementation of Methods Using the NAV Model 51
3.12 GPS Signal Acquisition 54
3.13 Receiver Positioning 54
3.13.1 Uncertainty and Confidence 56
3.14 Factors Affecting Location Accuracy 58
3.15 Geometry and Dilution of Precision 59
3.16 Differential-GPS 59
3.17 Software Projects 60
References 62
CHAPTER 4
Assisted-GPS and Assistance Data 63
4.1 The Assistance Model 63
4.2 GNSS Reference Server (GRS) 65
4.2.1 GPS Reference Receiver Configuration for a GRS 66
4.2.2 GRS Interface 69
4.2.3 Open Source GNSS Reference Server (OSGRS) 70
4.3 Location Server (LS) 72
4.4 Location-Based Application (LBA) 73
4.5 Emergency Services Messaging Entity 75
4.6 The Handset 76
4.7 Assistance Data Types 76
4.7.1 Reference Time 77
4.7.2 Reference Location 79
4.7.3 Navigation Model 79
4.7.4 Ionosphere Model 79
4.7.5 UTC Model 80
4.7.6 Acquisition Assistance 81
4.7.7 Real-Time Integrity 86
Contents ix
4.7.8 Almanac 86
4.7.9 DGPS Corrections 86
4.8 Assistance Data Type Sizes 87
References 88
CHAPTER 5
Assisted-GPS Location Within a Network 91
5.1 Location Architectures 91
5.2 A-GPS Protocols and Messaging 92
5.3 RRLP 92
5.3.1 RRLP Procedures 93
5.3.2 RRLP Messages 94
5.3.3 RRLP Encoding and ASN.1 Packed Encoding Rules 95
5.3.4 RRLP Implementation 104
5.3.5 Testing the RRLP Classes 110
5.3.6 Communication Across Sockets with RRLP 110
5.4 PCAP and RRC 114
5.4.1 PCAP Procedures 115
5.4.2 PCAP Messages and Encoding 117
5.5 Software Projects 117
References 118
CHAPTER 6
Position Calculation 121
6.1 Position Calculation and Handset-Assisted A-GPS 121
6.2 The Accuracy and Yield Trade-Off 122
6.3 Positioning Using GPS Code Phase Measurements 123
6.3.1 Data Preparation 126
6.3.2 Worked Example 127
6.3.3 Satellite Health 129
6.3.4 Calculate the Location of Each Satellite 130
6.3.5 Satellite Clock Correction 130
6.3.6 Group Delay Differential 132
6.3.7 Geometric Range Correction 132
6.3.8 Substituting in a Pseudomeasurement 134
6.3.9 Pruning Bad Satellite Measurements 134
6.3.10 Pruning Low Elevation Satellites 134
6.3.11 Pruning Weak Measurements 136
6.3.12 Ionosphere Correction 136
6.3.13 Troposphere Correction 137
6.3.14 Position Calculation 138
6.3.15 Uncertainty 143
6.3.16 Quality Measures 145
6.4 Doppler-Based Position Calculation 146
6.5 Hybrid Position Calculation 149
6.6 Software Projects 149
References 150
x Contents
CHAPTER 7
GPS Position Calculation with Time Recovery 153
7.1 The Time Determination Problem 153
7.2 Iterative Time Recovery 156
7.2.1 Iterative Time Recovery: Accuracy 160
7.2.2 Iterative Time Recovery: Performance 160
7.3 Integrated Time Recovery 163
7.3.1 Integrated Time Recovery: Accuracy 165
7.3.2 Integrated Time Recovery: Performance 165
7.4 Software Project 166
References 166
CHAPTER 8
Hybrid Location 167
8.1 Hybrid Positioning Overview 167
8.2 Hybrid Position Calculation 168
8.3 Hybrid Position Calculation Implementation 170
8.4 Hybrid Position Calculation Accuracy 172
8.4.1 Simulation Background 172
8.4.2 Location Calculation in Difficult Situations 174
8.4.3 Hybrid Location with Ideal Ranges 175
8.4.4 Hybrid Location with Ranges Using Error-Corrupted Ranges 177
8.5 Software Projects 180
References 182
CHAPTER 9
Other Server-Side Improvements and Controls 183
9.1 Improved Error Modeling 183
9.1.1 Orbit Modeling 183
9.1.2 Troposphere Modeling 184
9.1.3 Ionosphere Modeling 184
9.2 Location Integrity 185
9.2.1 Location Assurance 185
9.2.2 Antispoofing 186
9.3 Software Projects 189
References 190
CHAPTER 10
Assisted-GNSS 193
10.1 Assisted-GNSS 193
10.1.1 GLONASS 194
10.1.2 Galileo 194
10.1.3 Compass 195
10.1.4 QZSS 195
10.1.5 WAAS 196
10.1.6 EGNOS 196
Contents xi
Appendix A
Relevant Standards and Documents 203
Appendix B
Accompanying Source Code 207
Appendix C
Source Code Object Model 211
Appendix D
Sample RRLP Messages 215
D.1 Measure Position Request (with Acquisition Assistance) 215
D.2 Measure Position Response (GPS Measurements) 217
D.3 Assistance Data (Reference Location and Navigation Model) 218
D.4 Measure Position Response (Location) 221
xiii
xiv Preface
points and allow the interested person to modify and run the code. The user is
encouraged to run, modify, and dissect the code in order to get a thorough under-
standing. UML class and sequence diagrams are provided where they are helpful for
explanation.
Chapter 1 introduces the field of Assisted-GNSS and A-GPS and its primary
advantages over autonomous GPS. It discusses the main application areas and con-
tains an introduction to the software design and Java that is covered in this book.
Chapter 2 introduces the Java source code that accompanies this book and
works through some of the classes. This is done in the context of the GPS coordinate
reference frame and WGS 84 coordinates. The coordinate system is introduced and
the equations for converting between the Cartesian and the geodetic representations
are given. The project mode of the source code and how to modify and build the
source code are discussed.
Chapter 3 introduces the key operations of GPS. This includes the GPS signals,
GPS time, satellite broadcast information and models, and key calculations such as
calculating the location of the satellites at a specific time. It also introduces GPS sig-
nal acquisition and receiver positioning. Factors affecting the accuracy of a GPS fix
are discussed as well as geometry and dilution of precision (DOP).
Chapter 4 describes the Assisted-GPS model and the assistance data. It discusses
the architecture in detail and each component in the network including the GNSS
Reference Server (GRS), the location server (LS), the location-based application
(LBA), the Emergency Services Messaging Entity (ESME), and the handset. Each
assistance data type is introduced, the methods to calculate it are explained, and its
use is outlined.
Chapter 5 discusses the standards-based architectures and protocols used for
A-GPS in a network. It discusses how the LS fits into the location services architec-
tures and the specific protocols used for A-GPS such as RRLP, PCAP, RRC, and
TIA-801. The RRLP protocol is discussed in detail with an explanation of ASN.1
and PER encoding as well as message examples and the Java code for encoding and
decoding RRLP messages.
Chapter 6 discusses the position calculation with a particular reference to it
being performed on the server. It introduces the mathematical theory at a high level
and the models used for the calculations. It also discusses the implementation with
the source code and object model. It is done from the perspective of a walkthrough
of the Java code that accompanies this book with an example position calculation.
Chapter 7 introduces GPS time recovery as a way that the GPS time can be
determined as part of the position calculation solution. Time recovery is introduced
and two different algorithms are discussed: iterative time recovery and integrated
time recovery. Results of the two different methods are compared, accuracy and
performance of both methods are reported, and the implementation of iterative
time recovery is outlined.
Chapter 8 discusses hybrid GPS and ranging measurements in order to calculate
a location where one would not otherwise be able to be calculated. It discusses the
algorithm and steps through the implementation. It then outlines a series of experi-
ments and results that use simulated range measurements to calculate a location.
Chapter 9 introduces some of the techniques available to the LS for improving
the accuracy and yield of location calculations by using improved error models. It
Preface xv
also introduces location integrity and the mechanism for location assurance. There
is also a brief introduction location spoofing.
Chapter 10 generalizes the previous work in the book to A-GNSS and discusses
some of the issues associated with an A-GNSS server compared to an A-GPS server.
This chapter discusses the differences in the protocols and how the server can make
use of measurements from more than one GNSS.
Source code and updates are available at http://www.artechhouse.com/static/
reslib/harper/harper1.html.
Acknowledgments
Writing this book was not an individual effort, but did require the support of many
people during the time I wrote it and the years preceding the writing of this book.
First, I would like to thank the Andrew Corporation managers who have supported
my work over the years: Martin Dawson, David Evans, and Stewart Needham. I
also thank my colleague Peter Nicholson for many in-depth brainstorming sessions
and time spent working through problems in the early days of developing our MLC
product. I also thank Martin Thomson and Khiem Tran for their more recent input.
Darren Pawson helped me to put my suggestions for the book cover together and
gave me many insights into the nuances of RRLP encoding over the years. Peter
Rhodes helped me with some of the code.
I would also like to acknowledge all of my colleagues at Andrew Corporation in
both the Wollongong and Ashburn labs for contributing to my practical knowledge.
In addition, I thank the various handset manufacturers with whom I have interacted
and experienced interoperability testing with over the years; I have gained valuable
insights from them.
I am deeply grateful to Chris Rizos from UNSW for all of his invaluable assis-
tance over the last eight years and for the GPS course that he ran here in the lab that
started me on this journey. I thank the other individuals at UNSW who have con-
tributed to this path, including Peter Mumford, Andrew Dempster, and Binghao Li.
I thank my father for reviewing all of the chapters as I wrote them and for pro-
viding a lot of encouragement throughout the process. I would also like to thank the
technical reviewers who provided a lot of valuable feedback and Lindsey Gendall
from Artech House for helping to keep things on track.
I have relied on the encouragement from many of my friends while writing this
book including Phillip, David, Andrew, and the rest of the gang from The Friday
Group. I also thank my running friends Heidi and Glenn, who have regularly
encouraged me and inquired about progress, quite often when we have been out
running on bush tracks or down to the beach. I thank my good friend Lusi, who
reviewed some of the early chapters and helped with some of the MLP and RRLP
messages, but, more significantly, provided ongoing encouragement and enthusi-
asm for this project.
Finally, and most importantly, I would like to thank my wife, Tracey, and our
children, Kate, Emma, and Adam, for their love, support, and encouragement. The
credit goes to the Lord Jesus Christ through whom all things are created.
xvii
CHAPTER 1
Introduction
The basic task of a Global Navigation Satellite System (GNSS) assistance data
server is to provide assistance data to a GNSS-enabled handset in order to improve
the time to first fix (TTFF) and the yield. In addition, it often provides the position
calculation functionality in order to conserve battery power in the handset, reduce
the amount of assistance data that needs to be sent over the network, and allow inte-
gration with other measurements available in the network.
This book is a practical introduction to understanding, designing, and imple-
menting Assisted-GNSS (A-GNSS) server-side software with examples in the Java
programming language. Most of the practical worked examples use the Global
Positioning System (GPS) GNSS since that is presently fully operational and widely
used. Existing protocols for GNSS and GPS are introduced and discussed in detail.
Note that this book provides the practical details of server-side A-GPS implementa-
tion. For the detailed background theory and mathematics, the reader should con-
sult a general GPS book such as [1–3].
1.1 Overview
The two significant modes of Assisted-GNSS are handset-based (where the handset
performs the position calculation) and handset-assisted (where the server performs
the position calculation). In both modes, the server provides assistance data to the
handset that is specific to its approximate location. In handset-based A-GPS, the
handset uses this information to lock onto the satellites and perform a position cal-
culation. For handset-assisted A-GPS, the handset locks onto the satellites and
returns the measurements to the server.
When the calculation is performed on the server, much less assistance data
needs to be transferred to the handset. This is because the handset only has to lock
onto the satellites and return the measurements to the server, where the calculation
is made. The server can also make use of additional information and perform a
hybrid calculation. This includes improved error models and measurements from
sources other than those that can be made by the handset.
This book is focused on single-frequency, single point positioning (SPP). Mea-
surements are considered for a single time and are considered in isolation to other
measurements. This is the cold-start case where the handset has no prior informa-
tion about the GNSS constellation.
In this chapter, the field of GNSS is introduced and Assisted-GNSS is described
from a high level. Location accuracy is discussed with requirements and different
applications are considered. The software that accompanies the book is introduced
1
2 Introduction
along with some discussion about the choice of programming language and soft-
ware development issues in general.
1.2 Terminology
The GPS consists of three segments: the control segment, the space segment, and the
user segment [2]. The GPS constellation consists of a minimum of 24 satellites that
orbit the Earth in just under 12 hours.
The GPS satellites continuously transmit signals on several different frequen-
cies. The primary civilian frequency is GPS L1, which is transmitted at 1,575.42
MHz. Each satellite transmits at the same frequency using a spread-spectrum
code-division multiple-access (CDMA) technique, and the handset distinguishes
4 Introduction
Subframe 2 – Ephemeris
Subframe 4 – Alamac, Special messages, Ionosphere and UTC model Pages 1-25
S 2 (x, y, z)
S 3 (x, y, z)
ρ2
ρ3 S 4 (x, y, z)
ρ4
S1(x, y, z) ρ1
r1
GPS handset
x, y, z, t T1 (x, y, z)
may have been calculated using another location technology, or it may come from a
previously stored location in the handset.
The assistance data helps the handset lock onto satellites quickly in several
ways. It eliminates the need for the handset to demodulate and reconstruct the
broadcast navigation model. This is a significant saving because it takes 30 seconds
to decode the ephemeris for each satellite or longer when there are data bit errors or
weak signals. In addition, it may be impossible to demodulate the navigation model
from weak signals. Since the server provides information about the specific satellites
that are in view from the approximate location, the handset can constrain its satel-
lite search space. This constrained search space means that the handset can spend
more time detecting weaker signals from the satellites.
The handset uses the assistance data to lock onto the satellite signals and per-
form the position calculation (handset-based) or optionally returns the measure-
ments to the server to perform the calculation (handset-assisted). When the
calculation is performed on the server, it can make use of additional measurements
in order to improve both the accuracy and the yield of the location. Additional
range measurements may come from the wireless network such as uplink time dif-
ference of arrival (UTDOA) measurements, round-trip timing (RTT) measurements
in a UMTS network, timing advance (TA) measurements in a GSM network, digital
TV measurements (DTV), or measurements from any other terrestrial transmitters.
These additional measurements are particularly helpful in low signal environments
when there are not enough GPS satellite measurements.
Assisted Global Navigation Satellite System (A-GNSS) extends the concept to
other satellite navigation systems beside GPS. There may be a large number of
GNSS satellites orbiting the Earth within 10 years, all transmitting a variety of sig-
nals. This will give a receiver access to many more satellites and improve both accu-
racy and yield. More satellites means that position accuracy is less susceptible to
satellite geometry problems and provides greater redundancy when performing the
position calculation.
The simplified A-GNSS architecture is shown in Figure 1.3. A GNSS Reference
Server (GRS) collates information from the satellite broadcasts. It then provides this
information on request to an A-GNSS server so that it is available for the A-GNSS
handset. The time server provides accurate time to the A-GNSS server. This will
normally be done using Network Time Protocol (NTP).
The GRS is connected to a sparse network of GNSS receivers that are placed
geographically over the coverage area of the wireless network, and the central
server collates all of the information. The receivers are placed such that they can
receive information from each satellite that is in view of any of the handsets in the
network. This is because the ephemeris information is transmitted by each satellite
but is specific to the satellite that is transmitting it. A GRS that is covering continen-
tal United States, for example, may need receivers at each “corner” of the country to
receive the broadcast message from rising and setting satellites, but will generally
have more than that for redundancy. Note that in order to provide differen-
tial-GNSS (DGNSS) corrections, the receiver network would need to be much
denser than one designed to provide assistance data alone.
The A-GNSS server is a node in a wireless network that collates the data from
the GRS and exchanges data with the A-GNSS handset in order to calculate a
1.6 Assisted-GNSS from a High Level 7
GNSS Reference
Server (GRS)
A-GNSS handset
Time server
A-GNSS Server Initial uncertainty area
(NTP)
timely, accurate location. The protocol between the server and the handset is nor-
mally standards-based but may be proprietary. The A-GNSS server will establish a
connection to the GRS and periodically cache the data in order to serve it up to a
handset in whatever protocol is required to be compatible with the handset.
When an A-GNSS user in a cellular network makes an emergency call, or a ser-
vice is invoked that requires location, a message is sent to the A-GNSS server. The
A-GNSS server calculates the GNSS assistance data required using the location of
the radio access tower as the approximate location and provides it to the handset.
The handset locks onto as many satellites as it can within the time limit specified by
the server and calculates the location or optionally provides the measurements to
the A-GNSS server to calculate the location of the handset.
An example of messaging between an A-GNSS server and a handset is shown in
the scenario in Figure 1.4. Note that this is only an indicative message flow as the
standards support other mechanisms. The scenario could be initiated from
messaging through the cellular network, for example, if the A-GNSS user makes an
emergency call, or from an entity within the network. The entity within the network
A mobile location center (MLC) is a node that runs in various networks and can act
as a serving mobile location center (SMLC) [7], gateway mobile location center
(GMLC) [7], stand-alone SMLC (SAS) [7], SUPL location platform (SLP) [8], or
location information server (LIS) [9].
There are several different standards for the A-GNSS messaging between the
server and the handset. RRLP [10] is used by the SMLC and SLP, PCAP [11], and
RRC [12] in UMTS networks and TIA-801 [13] in CDMA networks. These proto-
cols are different ways of encoding the same basic information, but are specific to
the radio access technology.
10 Introduction
The secure user plane location (SUPL) architecture [8] is defined by the Open
Mobile Alliance (OMA) and allows the bypass of many of the traditional telecom-
munication elements by relying on SUPL functionality within the target device. This
makes network interoperability simpler. The SUPL-enabled terminal (SET) makes a
secure TCP/IP connection directly with the SUPL location platform (SLP). The SET
and the SLP exchange messages using the UserPlane Location Protocol (ULP) [14],
which is the transport for the underlying assistance data messaging. ULP supports
RRLP and optionally RRC and the TIA-801 [13]. Many operators have deployed
SLPs and many different SETs are available.
The assistance data standards (RRLP, PCAP, RRC, TIA-801) have had support
for GPS L1 C/A code assistance data for quite some time. Recently, support has
been added for the modernized GPS and other GNSS signals. This has been termed
Galileo and Additional Navigation Satellite Systems (GANSS). The SUPL specifica-
tion also facilitates Assisted-GNSS (A-GNSS).
The GANSS components allow an A-GNSS server to provide assistance data to
different types of handsets (for example, a Galileo handset-assisted-Galileo) and
handsets that have receivers capable of detecting satellites from multiple GNSSs (for
example, a combined GPS and Galileo receiver).
Standards are also being developed for providing location in Voice over Internet
Protocol (VoIP) networks. VoIP allows users to make telephone calls over the IP
network instead of the switched circuit network. Some VoIP providers presently do
not even provide access to emergency services such as 911 in the United States. The
National Emergency Number Association (NENA) and Internet Engineering Task
Force (IETF) are developing the architecture and standards for delivery of the loca-
tion within VoIP. It is likely that the handset will talk to the LIS using a protocol
that will encapsulate RRLP or some derivative messaging at its deepest layer.
inferior to A-GNSS and the user is expecting A-GNSS technology, then expectations
will not be met.
The primary need to determine an accurate location is for emergency services
when the location of injured people is required to a high accuracy in order to dis-
patch aid to them. Another example of an application that requires high accuracy is
a navigation application that provides walking directions from the user’s current
location to the nearest service, such as the local doughnut shop.
It is important to note that A-GNSS is not the only high-accuracy location tech-
nology and that there are areas where the accuracy of the location that it provides is
poor. This includes indoors and areas with obstructions of the view of the sky, such
as in urban canyons.
As devices have become more mobile and contain more features, users are expecting
them to be location-aware in order to maximize their utility. Many devices are
available today that already support A-GPS [16], and applications available for the
user are increasing on a daily basis. At the time of this writing, three out of four
smartphones support GPS and it is predicted that in only a few years, 9 out of 10
smartphones will have this capability [17].
1.9.1 E9-1-1
The deployment of A-GPS for cellular phone location has taken off in the United
States as a result of the Federal Communications Commissions (FCC) Enhanced
9-1-1 mandate (E9-1-1). This mandate requires for network-based solutions a
100-meter accuracy for 67% of calls, a 300-meter accuracy for 95% of calls and for
handset-based solutions, a 50-meter accuracy for 67% of calls and a 150-meter
accuracy for 95% of calls [18].
When an emergency call is initiated, a request for location for a particular hand-
set is received on the MLC. The required messaging is initiated and the resulting
location is cached on the platform. In the United States, the emergency services
coordination center, the public safety answering point (PSAP), will query the loca-
tion from the cache and may request updated locations. The location information
available to the PSAP operator allows the dispatch of the emergency services
response to the correct place.
tion-based gaming is also becoming popular where the location of the user is a com-
ponent of the game.
Knowing a location also facilitates location-based charging and billing or
restrictions where a particular service may be restricted in certain regions. For
example, the digital television broadcast of a football match may be restricted from
users within a certain range of the stadium, for example, 50 kilometers, in order to
encourage them to attend the game. Alternatively, the users within the vicinity of
the stadium may be required to pay a premium to receive the broadcast.
Location-based messaging is an application where messages are triggered based
on the user’s proximity. For example, targeted advertising can be triggered. A sub-
scriber to a certain retail outlet approaches the vicinity of the outlet and is provided
with a voucher to entice him or her into the store. Another example is when a mes-
sage is received, alerting the user to the proximity of one of the user’s preconfigured
friends.
Tracking applications for both commercial and security applications are
another area where A-GPS has penetration. Knowing the location of goods or a
child is a service that can generate revenue.
The Java programming language is a high-level language that has significant advan-
tages for implementing A-GNSS software. Its primary advantage is its simplicity,
which also leads to maintainability. Java contains the power of an object-oriented
language that can be implemented in a multithreaded nature and has high perfor-
mance. The automatic garbage collection is a useful feature. It is also portable, so
the hardware platform is flexible, and it facilitates rapid development and
prototyping, which result in the early testing of concepts and ultimately a better
product.
Java is very intuitive and comes with a library of preexisting code. There are
many tools available for Java development, including powerful (and free) integrated
development environments (IDEs). There were concerns about speed with earlier
versions of Java, but that is no longer an issue, as the speed has improved signifi-
cantly over recent releases [19].
All of these factors make Java a good basis on which to develop A-GNSS soft-
ware and to demonstrate the concepts explained in this book.
Java code fragments are shown to illustrate key points and algorithms through-
out the text. This book contains class and sequence diagrams in Unified Modeling
Language (UML) where they are helpful for explanation. The accompanying soft-
1.10 Java and Software Design for A-GNSS Applications 13
ware contains complete example code and applications that can be used to enhance
learning.
This book assumes that you are familiar with object-oriented (OO) design and
Java programming but have not developed software for A-GPS (or A-GNSS). It uses
standard OO conventions. A class is a collection of fields and methods and an
instance of the class represents an object. Objects interact to form an application.
Standard UML is used for class and sequence diagrams [20].
Online resources including updates will be available from [21]. The code was
developed for this book using Java SE 1.6, which can be downloaded [22]. It is also
a good idea to download the documentation. The code is compiled using Maven
[23], which is a tool to simplify the build process for software projects and is used to
build the source code and jar files. The Eclipse IDE [24] has been used throughout
development, but there is no requirement to use it.
Code and data files are organized in the Maven project into packages. An expla-
nation of each class and package and how to run them will be provided within the
Javadoc (Java’s documentation tool).
Table 1.3 Java Bit Manipulation Operations Used Regularly for A-GPS
Operator Description Example Explanation of Example
> Shift the specified byte result = toc > 5 Shifts the bits in toc, 5 to the right,
toc = 1111 1000
number of bits to result = 0000 0111 and puts 0s in the MSBs.
the right.
< Shift the specified byte result = toe < 5 Shifts the bits in toe, 5 to the left,
toe = 0011 1111
number of bits to result = 1110 0000 and puts 0s in the LSBs.
the left.
| Bitwise OR. byte result = cus | crs The cus and the crs are combined
cus = 1010 1010
crs = 1001 1000 in a bitwise OR.
result = 1011 1010
& Bitwise AND. byte result = crc & mask The crc and the mask are combined
crc = 0110 0101
mask = 0000 1111 in a bitwise AND.
result = 0000 0101
data types can hold special values such as NaN (not a number), positive infinity,
and negative infinity. These are explained further in the Java SE Javadoc.
Bit manipulation is also an area of Java that is used heavily for A-GPS. This is
generally for encoding and decoding messages that are being sent to and from other
entities in the network. The bitwise AND, bitwise OR, and bit shifting operations
are an area where particular care is needed. The bit manipulation commands used
regularly while encoding and decoding messages are shown in Table 1.3 with some
examples. The most significant bits (MSB) are the higher bits (towards the left of the
bit string), while the least significant bits (LSB) are the lower bits (towards the right
of the bit string).
The rest of the chapters of this book contain a practical exploration of A-GNSS with
a particular focus on A-GPS. Some theoretical background is provided, but the text
is more focused on the design and implementation of an A-GPS server. Source code
is provided that illustrates the key algorithms involved in the provision of assistance
data and the calculation of the location. The location protocols are discussed in
detail, including the support for all of the GNSSs and not just GPS.
References
[1] Parkinson, B., et al., Global Positioning System: Theory and Applications, Vol. 1, Washing-
ton, D.C.: American Institute of Aeronautics and Astronautics, Inc., 1996.
[2] Kaplan, E. D., and C. J. Hegarty, (eds.), Understanding GPS: Principles and Applications,
2nd ed., Norwood, MA: Artech House, 2006.
[3] Misra, P., and P. Enge, Global Positioning System: Signals, Measurements, and Perfor-
mance, 2nd ed., Lincoln, MA: Ganga-Jamuna Press, 2006.
[4] Conley, R., et al., “Performance of Stand-Alone GPS,” in Understanding GPS: Principles
and Applications, 2nd ed., E. D. Kaplan and C. J. Hegarty, (eds.), Norwood, MA: Artech
House, 2006.
1.11 Organization of This Book 15
[5] GPS Navstar Joint Program Office, Navstar GPS Space Segment/Navigation User Inter-
faces, Interface Specification, IS-GPS-200, Navstar GPS Joint Program Office, El Segundo,
CA, 2004.
[6] GPS Navstar Joint Program Office, Global Positioning System Standard Positioning Service
Signal Specification, 4th ed., December 2008.
[7] 3GPP TS 23.271 Third Generation Partnership Project; Technical Specification Group Ser-
vices and System Aspects; Functional stage 2 description of Location Services (LCS), 2009.
[8] Secure User Plane Location Architecture, Open Mobile Alliance, OMA-AD-SUPL, 2009.
[9] Dawson, M., J. Winterbottom, and M. Thomson, IP Location, New York: McGraw-Hill/
Osborne Media, 2006.
[10] 3GPP TS 44.031 Third Generation Partnership Project; Technical Specification Group
GSM/EDGE Radio Access Network; Location Services (LCS); Mobile Station (MS) - Serv-
ing Mobile Location Centre (SMLC) Radio Resource LCS Protocol (RRLP), 2009.
[11] 3GPP TS 25.453 Third Generation Partnership Project; Technical Specification Group
Radio Access Network; UTRAN Iupc interface Positioning Calculation Application Part
(PCAP) signaling, 2009.
[12] 3GPP TS 25.331 Third Generation Partnership Project; Technical Specification Group
Radio Access Network; Radio Resource Control (RRC); Protocol Specification, 2009.
[13] 3GPP2 C.S0022 Position Determination Service Standard for Dual Mode Spread Spectrum
Systems, 2004.
[14] UserPlane Location Protocol, Open Mobile Alliance, OMA-TS-ULP, 2009.
[15] Colwell, S., “Flying Off the Shelves: A White-Hot Market for Consumer GPS,” GPS World,
April 1, 2007.
[16] ABI Research, GPS-Enabled Handsets, Market, Technology and Business Factors Driving
the Growth of GPS, A-GPS and Hybrid Positioning for Mobile Handset Location, January
20, 2009.
[17] 3GPP TS 23.032 Third Generation Partnership Project; Technical Specification Group Ser-
vices and System Aspects; Universal Geographical Area Description (GAD), 2008.
[18] Federal Communications Commission (FCC) OET Bulletin 71, Guidelines for Testing and
Verifying the Accuracy of Wireless E911 Location Systems, April 12, 2000.
[19] Java Performance Tuning, http://www.javaperformancetuning.com
[20] Fowler, M., UML Distilled, 3rd ed., Reading, MA: Addison-Wesley, 2004.
[21] Artech House, http://artechhouse.com/static/reslib/harper/harper1.html.
[22] Java SE Overview, http://java.sun.com/javase/.
[23] Maven software project management and comprehension tool, http://maven.apache.org/
index.html.
[24] Eclipse IDE, http://www.eclipse.org/.
[25] IEEE Standard for Binary Floating-Point Arithmetic, ANSI/IEEE Standard 754-1985, IEEE,
New York, 1985.
CHAPTER 2
Coordinates are a set of numbers that define position in relation to an origin. The
coordinate reference frame (CRF) or coordinate reference system (CRS) is the origin
and axes and a set of transformations that define the location. The CRF includes
both a coordinate system and a reference frame. There are many different coordi-
nate systems and reference frames. This section introduces the reference frames that
are used throughout this book. They are the Cartesian coordinate system, the spher-
ical coordinate system, and the ellipsoidal coordinate system. The ellipsoidal
coordinate system is often called a geodetic system.
A Cartesian coordinate system is a linear system with the origin at a certain
fixed point with three axes defined that are perpendicular to each other. A point in
space in the Cartesian coordinate system is defined relative to the origin and is in the
form of (x, y, z). The Cartesian coordinates make it easy to understand and calcu-
late geometric quantities. The Cartesian coordinate system is illustrated in Figure
2.1. The point P is shown at coordinates (x, y, z) in the Cartesian coordinate system.
Spherical coordinates are also called spherical polar coordinates and are used
for defining positions on a sphere. As shown in Figure 2.2, the point P(r, θ, φ) is
defined by the distance r from the origin, θ is the azimuth angle in the x-y plane, and
φ is the altitude angle from the x-y plane.
The relationship between the point P in the Cartesian coordinate system and the
spherical coordinate system is given by
x = r cos φ cos θ
y = r cos φ sin θ (2.1)
z = r sin φ
17
18 Coding for GNSS and the Coordinate Reference Frame
z-axis
P (x,y,z)
y-axis
x
x-axis
Figure 2.1 Cartesian coordinate system.
z-axis
P(r, θ, φ)
θ y-axis
x-axis
Figure 2.2 Spherical coordinate system.
r= x 2 + y2 + z 2
⎛ z ⎞
φ = sin −1 ⎜ ⎟ (2.2)
⎜ x 2 + y2 + z 2 ⎟
⎝ ⎠
⎛ y⎞
θ = tan −1 ⎜ ⎟
⎝ x⎠
The World Geodetic System 1984 [1] is a standard coordinate frame and reference
surface that is used for GPS. The origin of the coordinate frame (0, 0, 0) is at the
2.2 World Geodetic System 1984 19
Earth’s center of mass. The reference frame consists of Cartesian and ellipsoidal
coordinates.
GPS calculations are generally performed in the Earth-centered Earth-fixed
(ECEF) Cartesian coordinate system shown in Figure 2.3. This Cartesian reference
frame is a reference frame that rotates as the Earth rotates. The x and y axes are
coplanar with the equator, with x pointing in the direction of where the prime
meridian intersects the equator and z being normal to the x-y plane in the direction
of the geographic North Pole. The scale along the axes is in meters. Most of the cal-
culations described in this book are performed in the ECEF Cartesian coordinate
system, but are often transformed into ellipsoidal coordinates for presentation to
the user or end application (latitude, longitude, and altitude). The latitude is a mea-
sure from the equator in degrees from 0 at the equator to 90 at the North Pole; it is a
negative value towards the South Pole, so the range is −90 to +90. The longitude is
similarly measured in degrees around the z-axis from −180 to +180. The end user or
application is normally responsible for converting the data from the WGS 84 refer-
ence frame to the local reference frame.
In order to represent a location as coordinates on an ellipsoid, a model of the
ellipsoid is needed. There have been many models used and improved over time but
the GPS system uses the World Geodetic System 1984 (WGS 84) [1]. The model of
the ellipsoid is shown in Figure 2.4. The longer axis of the ellipsoid is from the
Earth’s center through the equator, and the smaller one is through the pole.
The ellipsoid uses the parameters in [1] as the basis for the WGS 84 model.
WGS 84 constants that are used in calculations shown in this book and the accom-
panying source code are shown in Table 2.1.
z-axis
P (x, y, z)
Prime
meridian
Equator y-axis
x-axis
Pole
Semiminor axis
Semimajor axis
Equator
Figure 2.5 shows how latitude, longitude, and height are represented on the
ellipsoid as geodetic coordinates. The longitude λ is the angle between the user and
the x-axis, measured in the xy-plane. It is normally specified in degrees and ranges
from −180° to +180° where 0 represents the prime meridian. The latitude ϕ is the
angle between the xy-plane and the projection of the normal to the ellipsoid. The
height h, or altitude, is the minimum distance between P and the reference ellipsoid.
Note that h is the height from the reference ellipsoid and not sea level.
The widely used method to convert from ECEF to geodetic coordinates is a
method described by Bowring [2] and the equations are shown in (2.3). It is a
noniterative solution and provides centimeter accuracy for heights less than 1,000
kilometers. An iterative version of the calculation is provided in [3]; the noniterative
version is based on the fact that the single first approximation of θ is very accurate.
In (2.3), x, y, z are the WGS 84 ECEF coordinates and ϕ, λ, h is the WGS 84 latitude,
longitude, and height (or altitude) above the ellipsoid. a is the semimajor axis and b
is the semiminor axis. e′2 is the second eccentricity squared, N(ϕ) is the radius of
curvature in prime vertical, e2 is the eccentricity squared, and f is the flattening.
2.2 World Geodetic System 1984 21
z-axis
P (x, y, z)
h
Normal to ellipsoid
ϕ (latitude)
y-axis
Equator λ (longitude)
x-axis
Figure 2.5 Geodetic coordinates.
⎛ z + e' 2 b sin 3 ζ ⎞
ϕ = a tan ⎜ ⎟
⎝ p − e 2 a cos 3 ζ ⎠
λ = a tan( y, x )
p
h= − N( ϕ)
cos ϕ
where
p= x 2 + y2
⎛ za ⎞ (2.3)
θ = a tan ⎜ ⎟
⎝ pb ⎠
a2 − b2
e' 2 =
b2
a
N( ϕ) =
1 − e sin 2 ϕ
2
e 2 = 2f − f
a−b
f =
a
The Java code accompanying this book is built into a project using Maven [4].
Maven is described in Appendix B and has been designed for ease of use. It has a few
simple commands described next that will allow you to make use of the source code.
It is also a very powerful tool for managing larger projects, but for this project, we
are only using its basic functionality. Before using it, you will need to download it
and do the necessary installation by following the installation instructions. In addi-
tion, you will need to have the Java SE SDK installed.
The source is organized using a standard project structure. This is so that a
developer familiar with one project will immediately feel at home when moving to a
new project. The project directory structure for the accompanying source code
including the WGS 84 classes is shown in Figure 2.6. Throughout this book, the
accompanying software is referred to as the project.
At the highest level, the directories are split between src, which contains the
source code, target, which includes the files that are the results of the build, and
batch, which contains some batch files to invoke the targets. The source code is split
between the main classes and the test classes. The main source code classes are in
project directories under the ServerAgps directory. Figure 2.6 only shows the WGS
84 classes, but there are many more directories under ServerAgps. The target direc-
tory contains the project’s jar file, the classes directory, which contains the classes
that have been built, and the test-classes, which contain the classes built from the
test directory. The reports directory contains the reports of the unit test results and
the apidocs contains the Javadoc.
To build the code, you will need to use the command line interface of your
machine. Note that Maven is integrated into the major IDEs and can be invoked
from there depending on which one you are using, but is discussed in terms of the
command line interface in this book. To build the Maven project, use the following
command from the highest level in the archive, that is, the serverAgps directory:
mvn package
This command will build all of the source code in the project, run all of the tests
defined in the test classes, and build the jar file. The tests in the test classes are writ-
ten using the JUnit [5] unit testing framework.
Once built, the classes are run directly from the jar file. There are some batch
files in the batch directory that run certain classes that are discussed later in this
book.
The first line of code creates an instance of the class (instantiates it), and the sec-
ond line sets its value to the specified x, y, and z by invoking its setEcef() method. The
algorithm for the setEcef() method was shown in (2.3) and the code is shown here.
1. /**
2. *Settor for wgs84 instance passed Cartesian ECEF coordinates. This method is
3. *passed the WGS 84 ECEF x, y and z. It saves the coordinates in ECEF Cartesian
4. *format and also as Geodetic coordinates. To do that it needs to convert the
5. *coordinates and it does that using the non-iterative solution described in: <br>
6. *Bowring, B., July 1976, “Transformation from spatial to geographical coordinates”,
7. *Survey Review, XIII, 181, July 1976, pg 323-327.
8. *
9. *@param _x the x coordinate.
10. *@param _y the y coordinate.
11. *@param _z the z coordinate.
12. */
13. public void setEcef(double _x, double _y, double _z)
14. {
15. this.x = _x;
16. this.y = _y;
17. this.z = _z;
18.
19. // If it is one of the poles then set it straight away and return
20. if ((this.x == 0) && (this.y == 0))
21. {
22. this.longitude = 0;
23. if (this.z > 0)
24. {
24 Coding for GNSS and the Coordinate Reference Frame
The first thing you will notice is that the method is documented using Javadoc
(lines 1–12) [6]. Javadoc is a method for documenting source code and a tool for
generating source code documentation in HTML. Javadoc is used for documenting
the code at the package level, class level, and method level and is considered to be a
good practice by Java developers. The Javadoc is delimited by the special string
“/**”. The method comment shown includes a free-form description of what it does
and a description of each variable with the @param keyword. To generate the
Javadoc in the Java API form from your source code, use the Maven command:
mvn javadoc:javadoc
defined as protected so that it can be used by other classes in the same package, as
static so that there is only ever one instance of this variable no matter how many
instances of the class are instantiated, and as final so that it cannot be changed once
it is defined. The name is prefixed with a B since the semiminor axis is often referred
to as b in equations, for example, in (2.3). Its definition is:
/** The semi-minor axis of the ellipsoid as defined by WGS 84. */
protected static final double B_SEMI_MINOR = 6356752.3142;
*This method calculates N. It is an intermediate variable that is used to translate between ECEF
*Cartesian coordinates and Geodetic coordinates. It is the radius of curvature in prime vertical.
*
*@param _latitude the latitude in degrees.
*
* @return the calculated value of N.
*/
private double calculateN(double _latitude)
{
double N = A_SEMI_MAJOR/Math.sqrt(1 - (E_SQUARED * Math.pow(Math.sin(Math.toRadians
(_latitude)),2)));
return N;
}
26 Coding for GNSS and the Coordinate Reference Frame
The calculateN() method returns the value of N and that is indicated in the
Javadoc with the @return keyword and a description of what is returned. The
method is private since it is only used within this class. This method calculates N
using some of the methods from the Math class and returns the result.
The other significant piece of functionality in the Wgs84Coordinate class is the
procedure to create a location using a latitude, a longitude, and an altitude. This is
done using the setGeodetic() method as shown next. Note that the setGeodetic()
method returns a Java primitive type called a Boolean which will be true if the coor-
dinate was created successfully, so it needs to be checked by the calling class.
Wgs84Coordinate coord = new Wgs84Coordinate();
boolean success = coord.setGeodetic(33.61041480,-114.71485132, 85.9185);
if(success)
{
//coordinate is ok
}
The algorithm for the setGeodetic() method was shown previously in (2.4) and
the Java code is shown here:
1. /**
2. *Settor for wgs84 instance passed Geodetic coordinates. This method is passed the latitude,
longitude and
3. *altitude in WGS 84 geodetic coordinates. It does some range checking and stores the coor-
dinates locally. It
4. *also saves the coordinates in ECEF Cartesian format. To do that it needs to convert the
coordinates.
5. *
6. * @param _latitude the latitude in degrees.
7. * @param _longitude the longitude in degrees.
8. * @param _altitude the altitude in meters.
9. *
10. * @return true if the coordinate is successfully set.
11. */
12.public boolean setGeodetic(double _latitude, double _longitude, double _altitude)
13. {
14. //Do some range checking to determine whether the inputs are valid.
15. if(_latitude < -90 || _latitude > 90 || _longitude < -180 || _longitude > 180)
16. {
17. //There is a problem with one of the parameters
18. return false;
19. }
20.
21. //Set the values
22. this.latitude = _latitude;
23. this.longitude = _longitude;
24. this.altitude = _altitude;
25.
26. //Call a method to perform this intermediate calculation
27. double N = this.calculateN(_latitude);
28.
29. //Calculate x,y and z using the non-iterative method
30. this.x = (N + _altitude) * Math.cos(Math.toRadians (_latitude)) *
Math.cos(Math.toRadians(_longitude));
31. this.y = (N + _altitude) * Math.cos(Math.toRadians (_latitude)) *
Math.sin(Math.toRadians(_longitude));
32. this.z = ((N * (1 - E_SQUARED)) + _altitude) * Math.sin(Math.toRadians(_latitude));
33.
34. return true;
35.}
This method first checks to see if the latitude and longitude are within the valid
limits of their range (line 15). The latitude range is from 0 at the equator to +90 at
the North Pole and −90 in the other direction at the South Pole. The longitude range
starts at 0 at the prime meridian and goes to +180 in the easterly direction or −180
in the westerly direction from the meridian. The method returns false to indicate
2.5 Unit Testing 27
that the coordinate was not set up correctly (line 18). If the latitude and longitude
are in range, the remaining code is executed and the method returns true (line 34).
The implementation described does not provide much information to the calling
class and relies on the calling class checking the result. Another way to implement
this method would be by using Java exception handling. To do this, the
setGeodetic() method declares that it can throw a specific exception, and it throws
that exception if the latitude or longitude is invalid and the exception must be
caught and processed by the calling method. The advantage of that method is that
more information can be provided in the exception about which input value is
incorrect and the onus is on the calling method to implement the code to catch the
exception.
The rest of the method steps through and calculates the conversion to ECEF
coordinates. It is worth noting that when a calculation is performed in Java, the
result will be of the same precision as the operand with the greatest precision. For
example, when calculating z, there is an expression 1 – E_SQUARED. The defini-
tion of E_SQUARED is:
/** The eccentricity squared derived from flattening WGS 84. */
private static final double E_SQUARED = (2 * FLATTENING) - (FLATTENING * FLATTENING);
Unit testing is the process of testing each individual unit of software that makes up
an application. A unit is the smallest testable part of an application. This is normally
method level testing and the aim is to test each type of input for each method in
order to determine whether (or confirm that) the code successfully handles the
input. The goal of unit testing is to test that each individual component of the soft-
ware is correct so that when it is combined with other software, it is more likely to
work. Unit tests are also useful for developers to see how the code works by provid-
ing examples of how to use the class.
When writing the unit test cases, you do not need to write a test case for every
possible input, but for each case that needs to be handled.
The aim is to test successful cases as well as the error conditions. For example,
when testing the Wgs84Coordinate class, you would probably want to test the fol-
lowing things:
• Verify that the class will not accept invalid values or latitude.
• Verify that the class will not accept invalid values for longitude.
There are significant advantages to automating the test cases so that they can be
run on a regular basis in order to detect any problems that may have been inadver-
tently been introduced by changes in the code.
Maven is integrated with the open source JUnit framework [5], which handles
the administration of the automated testing, which leaves us to concentrate on
developing the test cases. When the source code is built, the test cases are run and a
report is produced that contains the success or failure of each test.
The Wgs84CoordinateTest class contains a set of tests that validate the correct oper-
ation of the Wgs84Coordinate class. The Wgs84CoordinateTest class is in the wgs84
directory within the test source code of the project. The full path name to the source code
is: serverAgps/src/test/java/com/ServerAgps/wgs84/Wgs84CoordinateTest.java.
The Wgs84CoordinateTest class extends JUnit’s TestCase class. Each test case
is in its own separate method and it uses the assert method to indicate success or fail-
ure of the test. For example, here is the method with the test case to test conversion
of a known ECEF location into a geodetic location:
1. /**
2. * Tests a known conversion from ECEF to Geodetic.
3. * Fire Camp 9, Sylmar, Los Angeles, California, USA
4. * Geodetic coordinates:
5. * 34.35317990 -118.41142498 1137.9958
6. * Cartesian ECEF coordinates:
7. * -2508506.07 -4637174.91 3579499.9
8. */
9. public void testConversionForKnownLocationEcefToGeodetic()
10. {
11. Wgs84Coordinate coord = new Wgs84Coordinate();
12. coord.setEcef(-2508506.07, -4637174.91, 3579499.9);
13.
14. assertTrue(“Conversion from ECEF to Geodetic for known location”,
15. matchDouble(coord.getLatitude(),34.35317990,PRECISION_5_DEC) &&
16. matchDouble(coord.getLongitude(),-118.41142498,PRECISION_5_DEC) &&
17. matchDouble(coord.getAltitude(),1137.9958,PRECISION_1_DEC));
18. }
The test method checks the conversion of the coordinates at Sylmar, LA. The
method constructs an instance of the Wgs84Coordinate class and then calls its
setEcef() method with the ECEF coordinates (line 12). The assertTrue() method is
part of the JUnit framework and is passed a string that labels the test case and the
conditions under which to pass the test case. The matchDouble() is a private
method that determines whether the values match to the given precision. In this
case, we are checking the latitude and longitude to 5 decimal places and the altitude
to 1 decimal place. The latitude, longitude, and altitude are retrieved from the WGS
84 object using its accessors.
If the values match, then success is passed as the second parameter to the assert()
and the test case passes. If the test case fails, the unsuccessful result is written to the
report and standard output with the string provided to the assert().
The test class contains a set of other test cases that are run each time that the
package is built and cover most of the tests listed earlier. It is worth browsing
through the test cases.
2.6 Debugging 29
2.6 Debugging
When unit tests fail or something goes wrong when running the software, a
debugger is the software developer’s best friend. A full-screen symbolic debugger is
standard with most IDEs and is very helpful when diagnosing problems with soft-
ware. Typical functionality of a good debugger includes the facilities to run code
step by step, setting certain points for the code to stop (break-points), allowing
access to variables, and even changing variables on the fly. The debugger is one of
the most powerful tools that a developer can use.
In addition, Java also provides many tools to aid debugging such as the Java
heap analysis tool, Java monitoring and management console, Java memory map,
and the JVM statistical monitoring tool.
report on the results (lines 26–27). Inside the iteration loop for the WGS 84 bench-
mark test are calls to the methods to set the different types of coordinates (lines
16–21). The set methods both convert to the other type of coordinate format so that
the benchmark test is running all of the key code.
1. /**
2. * This is the main method of the test class and is being used to run a benchmarking
3. * test for performance
4. *
5. * @param args the command line arguments.
6. */
7. public static void main(String[] args)
8. {
9. Wgs84Coordinate coord = new Wgs84Coordinate();
10. System.out.println(“WGS 84 benchmarking tests starting...”);
11.
12. int numberOfIterations = Wgs84CoordinateTest.NO_ITS_PERFORMANCE_TEST;
13. long startTimeMs = System.currentTimeMillis();
14. for(int i = 0; i < numberOfIterations; i++)
15. {
16. coord.setGeodetic(-34.4, 150.1, 32);
17. coord.setGeodetic(-34.4, -30, 32);
18. coord.setGeodetic(34.4, -30, 32);
19. coord.setGeodetic(34.4, 150.1, 32);
20. coord.setEcef(-2508506.07, -4637174.91, 3579499.9);
21. coord.setEcef(-2223206.72, -4830299.8, 3510587.59);
22. }
23. long endTimeMs = System.currentTimeMillis();
24. double transactionsPerSecond = numberOfIterations/((endTimeMs - startTimeMs)/1000.0);
25.
26. System.out.println(“Total time for test : ” + ((endTimeMs -startTimeMs)/1000.0) +
“ seconds”);
27. System.out.println(“TPS: ” + transactionsPerSecond);
28.}
This benchmark test can be run from the batch job wgs84test.bat in the batch
directory of the project.
that have not been executed. To run code coverage on the project, the following
Maven command is used:
mvn emma:emma
This command runs the unit tests while the code coverage tool measures the
lines of code that are executed. The results are stored in the emma directory (refer to
the project structure in Figure 2.6). The report is formatted so that it provides the
overall code coverage figures and allows you to browse down to the code coverage
of individual classes within the project.
The code coverage report for the Wgs84Coordinate class is shown in Figure 2.7.
It shows that 12 of the 13 methods in the class have been invoked (or 92% of the
methods). It also shows that 99% of code blocks have been executed and 95% of
the lines of code have been executed. The listing of methods shows that the main
method is two lines long, but has not been invoked by the unit tests. The code cover-
age tool allows you to select the name of the method and the code is displayed with
the lines that have not been executed as highlighted.
The code coverage tool raises awareness to the developer of areas that may be a
potential problem. Once you are aware of the issue, it is then up to you to make a
decision on whether and how to address the problem.
Generally, code that has not been executed by the test suite will result in one of
the following actions:
• A test case is added to test the condition highlighted by the test case.
• The code may be removed if it is not being used.
• No action taken if the code is considered trivial enough not to test or is too
hard to test and the effort of testing it is not worth the benefit achieved in test-
ing it.
In the case of the Wgs84Coordinate class, the code coverage tool is indicating
that the main method is not being invoked by the unit tests. Inspection of the code
reveals that it is not doing anything useful so it can be removed.
References
[1] National Imagery and Mapping Agency, Technical Report TR8350 Department of Defense
World Geodetic System 1984: Its Definition and Relationships with Local Geodetic Sys-
tems, Third Edition, Amendment 1 January 2000, NIMA Bethesda, MD.
[2] Bowring, B., “Transformation from Spatial to Geographical Coordinates,” Survey Review,
XIII, 181, July 1976, pp. 323–327.
[3] Kaplan, E. D., et al., “Fundamentals of Satellite Navigation,” in Understanding GPS: Prin-
ciples and Applications, 2nd ed., E. D. Kaplan and C. J. Hegarty, (eds.), Norwood, MA:
Artech House, 2006.
[4] Maven software project management and comprehension tool, http://maven.apache.org/
index.html.
2.9 Configuration Management 33
GPS
The GPS is a space-based radionavigation system that is owned by the U.S. govern-
ment and operated by the U.S. Air Force (USAF). It reached initial operation capa-
bility in 1993 [1] and is widely used today by both the military and civilians. The
satellites transmit information that allows a handset to determine its location, its
velocity, and the precise time. This chapter introduces the key operations of GPS via
an exploration of the navigation message, including the satellite broadcast informa-
tion and models, GPS time, and factors affecting the accuracy of a GPS fix.
The fundamental technique of the GPS is the use of one-way ranging from the
GPS satellites to measure the distance to each satellite and calculate the location of
each satellite and, from that, the location of the handset.
This chapter introduces the key operations of GPS, including the GPS signals,
GPS time, satellite broadcast information and models, and key calculations such as
calculating the location of the satellites at a specific time. This chapter also intro-
duces GPS signal acquisition and receiver positioning. Factors affecting the accu-
racy of a GPS fix are discussed, as well as geometry and dilution of precision (DOP).
Historically, the GPS system consisted of three segments: the space segment (SS), the
control segment (CS), and the user segment (US) [2, 3].
The space segment consists of a minimum of 24 operational satellites that trans-
mit on several frequencies. Each satellite transmits a radio frequency (RF) ranging
code and a navigation message.
The control segment consists of a network of monitor stations that track and
monitor the satellites, the master control station (MCS) that gets the information
from each of the monitor stations and determines the data to upload to the satellites,
and the ground antennas that transmit the information to the satellites. Some other
responsibilities of the MCS are satellite status monitoring, maintenance, and
detection of service failures.
The user segment consists of handsets (radio receivers) that are specifically
designed to receive and process the signals from the space segment. The user hand-
sets come in many different forms and can be embedded in various types of devices.
The U.S. government owns the control and space segments that are operated by
the USAF. There are millions of receivers in use today in the user segment, including
more than 300 million receivers in cell phones. The user segment is no longer part of
the GPS since the development of the receivers is no longer under the control of the
35
36 GPS
GPS Joint Program Office (JPO) [1]. The GPS provides the GPS IS [4], which is the
interface between the space and the user segments.
Ranging codes are transmitted by the satellites, which allow the handset to
determine the time of flight (TOF) between the satellite and the receiver and hence
calculate the range. The navigation data message allows the handset to calculate the
position of the satellite at the time that the code was transmitted. The location of the
handset is calculated using this information by solving the point of intersection of
spheres.
Since GPS met initial operational capability, it has continuously met and
exceeded the minimum accuracy performance levels specified in the Standard Posi-
tioning Service Performance Standard (GPS SPS PS) [1]. GPS receivers have been
achieving a horizontal accuracy of 3 meters or better and a vertical accuracy of 5
meters or better 95% of the time [1] in open sky conditions.
There are two levels of service enabled by the GPS. The Precise Positioning Service
(PPS) is a precise service that is intended for military purposes. Access to the PPS is
controlled using cryptography and is not covered in detail in this book.
The GPS Standard Positioning Service (SPS) is intended for civilian use; this ser-
vice is presently available via the GPS L1 signal. The GPS SPS is described in the GPS
SPS Signal Specification (GPS SPS SS) [2] and the GPS SPS PS [1].
3.3 Satellites
The GPS satellites are organized into six geometrically spaced orbital planes with at
least four satellites in each plane. There is a minimum of four satellites, but there are
often more for redundancy. The satellites have an average altitude of approximately
20,180 kilometers above the Earth and orbit the Earth in approximately 11 hours
and 58 minutes.
The satellites are positioned in the orbital plane so that four satellites are visible
from every point of the Earth with a good geometric separation. The satellites trans-
mit towards the Earth with a beamwidth of 27.8°. The beam covers 38% of the
Earth’s surface.
The GPS signals and standard codes are summarized in Table 3.1. The satellites
transmit several ranging codes: the precision code (P-code), the Y-code, which is
used instead of the P-code under the antispoofing (encrypted) mode, and the
coarse/acquisition (C/A) code, which is used to acquire the P-code or Y-code and
also as a civil ranging signal. The P-code is often referred to as the P(Y) code.
The L2 civil-moderate (L2 CM) and L2 civil-long (L2 CL) codes are presently
being commissioned and are intended for civil use. The L2 civil (L2C) codes have
3.5 PRN Codes 37
better cross-correlation performance, which means that the reception of weak GPS
signals is much less affected by simultaneously received strong GPS signals. L2 will
allow a civilian dual-frequency receiver to completely account for ionosphere
errors, hence improving the accuracy, and is defined in GPS IS 800 [5]. GPS L5 is
also being commissioned and is intended for civilian safety-of-life applications and
is defined in GPS IS 705 [6]. New codes and frequencies are coming online through-
out the GPS modernization program [7].
The P-code is 7 days long and is transmitted at 10.23 MHz. It is used by military
grade receivers. The C/A code is 1 millisecond in length at a chipping rate of 1.023
MHz. The L2 CM code is 20 milliseconds in length at a chipping rate of 511.5 Kbps,
while the L2 CL is 1.5 seconds in length with a chipping rate of 511.5 Kbps.
Note that in the case of a problem with a satellite’s hardware, it may also trans-
mit an “incorrect” version of each of the codes in order to protect the handset from
receiving incorrect data. The nonstandard codes are not shown in Table 3.1.
Each satellite has a unique pseudorandom noise (PRN) signal number that is trans-
mitted by the satellite. For GPS L1, for example, it is 1,023 bits in length and pro-
vides the method to identify each individual satellite. Each sequence is a 1,023-bit
gold code and is described in [4].
PRNs are numbered from 1 to 37. PRNs 1 to 32 are used to identify satellites.
PRNs 33 to 37 are reserved for other uses, such as ground-based transmitters. PRNs
34 and 37 share the same PRN code.
The C/A code consists of the satellite’s PRN modulated with a navigation message.
It is 1,023 bits long and repeats each millisecond. This short code length enables the
receiver to acquire the satellite signals very quickly.
Code-division-multiplexing techniques allow the handset to differentiate
between the satellites even though they transmit on the same frequency. The C/A
code is the PRN with the Modulo-2 addition of the navigation data bits, which are
included in the sequence at 50 bps. There is normally a bit transition every 20 milli-
seconds. The navigation message is described in detail in subsequent sections.
GPS Link 1 (L1) is used for civilian applications and is the only civil signal that has
reached full operational capability (FOC) and hence is the primary signal consid-
ered in this book. It is transmitted at 1,575.42 MHz as right-hand circularly polar-
ized (RHCP) and is biphase shift key (BPSK) modulated with the C/A signal. The
C/A signal (described in Section 3.6) is the PRN sequence with a Modulo-2 addition
of the 50-Hz navigation message.
On L1, each satellite has a unique PRN coarse/acquisition (C/A) code sequence,
which is 1,023 bits in length and provides the method to identify each individual
satellite. The satellite generates a navigation message (NAV) that is determined
from data that is periodically uploaded from the control segment. The navigation
message is added to the 1.023-MHz PRN C/A sequence at 50 bits per second (bps),
and the satellite modulates the resulting code sequence onto the L1 carrier to create
the spread spectrum ranging signal. The spread spectrum ranging signal is continu-
ously transmitted by each satellite.
Figure 3.1 shows the model of GPS L1. The PRN code is added to the NAV data
to generate the C/A code. The C/A code is then modulated onto the L1 carrier and
transmitted.
On L2, there are two ranging codes transmitted: L2 civil-moderate (L2 CM) and L2
civil-long (L2 CL) codes. These codes have the civil navigation (CNAV) signal mod-
ulated on them. Similar to L1, the L2 signal is BPSK modulated by one of the two bit
trains (L2 CM or L2 CL), depending on what is selected by ground command. It is
also possible that L2 may not have a broadcast signal modulated on it at all.
GPS L1
PRN –1.023 MHz x
C/A code
+
Modulo 2
NAV data –50 Hz
GPS time is controlled by the control segment and is the time reference for all GPS
operations. It is referenced to UTC time and commenced at midnight on January 5,
1980 (the morning of January 6, 1980). GPS time is specified with a week number and
the number of seconds in the week. In the 10-bit representation used by the navigation
message, the GPS week ranges from 0 to 1,023; at the expiration of week 1,023, the
week number rolls over to 0. The number of seconds in each GPS week is 604,800.
GPS time differs from UTC time because it is a continuous time scale. UTC time,
on the other hand, has leap seconds introduced to it as a periodic correction. Each
time that a leap second is added to UTC, the GPS time goes ahead another second.
There is also a drift between the GPS and UTC time scales, which is controlled to be
within 1 microsecond of UTC [4]. The relationship between GPS and UTC time can
be determined using the information in the navigation message described in the next
section.
Each satellite provides data to the handset to facilitate the position determination
process. On L1, this information is known as the NAV message. The navigation
message includes the GPS time information, satellite accuracy and health, satellite
clock correction terms, ephemeris, almanac, ionosphere model, and the UTC
model. It allows the handset to determine the status of the constellation, the satel-
lite’s time of transmission, its health, its clock correction, its position, and the time
conversion from GPS to UTC. The NAV message is part of the C/A code and the P-
and Y-codes. It may also be transmitted on L2 under certain circumstances.
Once the handset calculates the location of the satellites, it can then use that in
conjunction with range measurements that it makes in order to calculate the loca-
tion of the handset. The navigation message structure repeated from Chapter 1 is
shown in Figure 3.2.
Figure 3.2 shows that each frame of data (1,500 bits) is transmitted as five
subframes, each of which is 300 bits in length. Subframes 1 to 3 are transmitted in
each frame, while subframes 4 and 5 are split across 25 frames using “paging.”
The 25 versions of subframes 4 and 5 are known as pages. To get the complete
almanac information, the receiver needs to decode all 25 frames of the navigation mes-
sage. At the data rate of 50 bps, each 300-bit subframe takes 6 seconds to transmit,
which leads to 30 seconds for an entire frame. In order for the receiver to get the com-
plete almanac information, it will need to wait for 25 × 30 seconds, or 12.5 minutes.
The complete specification of the message content can be found in the GPS IS
[4], and some key information is included here. The subframes are made up of spe-
cific data and some parity information. There is also a default navigation data trans-
40 GPS
Subframe 2 – Ephemeris
Subframe 4 – Alamac, Special messages, Ionosphere and UTC model Pages 1-25
mission where words 3 through 10 contain a pattern of alternating 1s and 0s. Note
that the satellite does not need to transmit its satellite identifier in the NAV model
because the satellite is differentiated based on its PRN.
Each subframe begins with a header that contains the telemetry (TLM) word
and a handover word (HOW). The TLM contains the preamble, which is set to
0×8B, some reserved bits, and parity. The HOW contains the time of week (TOW)
count, the subframe ID (1 – 5), some flags, and parity bits. The significant fields are
shown in Table 3.2. The parameters have the specified number of bits and start at
the specified bit within the 300-bit frame. The bits are numbered increasing from
the MSB.
Table 3.2 contains a column that specifies where the field starts within an 8-bit
byte and the bit offset within that byte. This information about the byte and bit
number is very useful when we are decoding the bit string in code in the next section.
The bytes are numbered from 1 as the most significant byte and increasing in num-
ber. For example, the subframe ID starts at bit 50 within the 300 bits, which is bit
number 2 within byte number 7. The methods to calculate the byte and bit offsets
are shown in (3.1).
⎛ startingBitNumber − 1⎞
byteNumber = trunc ⎜ ⎟ +1
⎝ 8 ⎠ (3.1)
bitNumber = startingBitNumber − ((byteNumber − 1) * 8)
Under a normal operation, subframe 1 contains the satellite clock and health
data; this is shown in Table 3.3. The satellite health data indicates the health of the
satellite. If the MSB is set to 1, then some or all navigation data is bad, and the rest
of the bits indicate the problem that can be determined from a look-up table speci-
fied in [4]. TGD is the estimated group delay differential. It is a term used to account
for the satellite group delay differential. TGD is applied to the measured code phase
to calculate an updated satellite time difference. The issue of data, clock (IODC)
indicates the issue number of the data set. This allows detection of a change of trans-
mitted parameters and will be unique within a 7-day period. The satellite clock cor-
rection terms toc, af2, af1, and af0 allow the user to correct for the satellite clock errors.
Depending on the type, age, and condition of the clock in the satellite, it will have
a specific drift from true GPS time. The clock is regularly monitored by the MCS,
which regularly updates the satellite clock correction parameters for each clock.
The time of transmission of the signal from the satellite is corrected using (3.2).
Note that the first two equations are coupled, but the GPS time, t, can be substituted
with tsv in the second equation. af0, af1, af2, and toc are parameters from subframe 1, F
is a constant, and e, A, and Ek are orbit parameters that are calculated from the
ephemeris; these are defined in Table 3.4 and (3.3).
t = t SV − Δt SV
where
Δt SV = a f 0 + a f 1 (t − t oc ) + a f 2 (t − t oc ) + Δt r
2
(3.2)
Δt r = Fe A sin E k
−2 μ
F = = −4.442807633 × 10 −10
c2
Ephemeris is the name given to a set of parameters that give the position of an
object in the sky at a given time. The GPS ephemeris provides the information about
the position of GPS satellites using terminology typical of Keplerian orbital parame-
ters. The parameters allow the best trajectory fit in ECEF coordinates. Subframes 2
and 3 contain the satellite ephemeris data. Once the ephemeris parameters are
decoded, they can be provided to a set of equations that are used to calculate the
location of the satellites in ECEF coordinates. Table 3.4 shows the parameters of
subframe 2 and Table 3.5 shows the parameters of subframe 3. The issue of data,
ephemeris (IODE) is an 8-bit number that is the 8 LSBs of the issue of data, clock
(IODC) from subframe 1 and it appears in both subframes 2 and 3. The user can
compare the IODE with the 8 LSBs of the IODC, and if it is different, then a naviga-
tion data cutover has occurred and the user should ensure that the same issue of
navigation data is being used by recollecting the navigation message.
To calculate the location of the satellite in WGS 84 ECEF coordinates, the ele-
ments of (3.4) are used. It is simply a matter of plugging in the ephemeris parameters
for a particular satellite in order to determine x, y, and z. In (3.4), t is the GPS time at
transmission and μ is the WGS 84 value of the Earth’s gravitational parameter as
discussed in Chapter 2.
( A)
2
A=
μ
n0 =
A3
t k = t − t oe
n = n 0 + Δn
M k = M 0 + nt k
M k = E k − e sin E k
⎛ e + cos v k ⎞
E k = cos −1 ⎜ ⎟
⎝ 1 + e cos v k ⎠
Φk = vk + ω
δu k = c us sin 2Φ k + C uc cos 2Φ k
δrk = c rc cos 2Φ k + C rs sin 2Φ k (3.4)
δi k = c ic cos 2Φ k + C is sin 2Φ k
u k = Φ k + δu k
rk = A(1 − e cos E k ) + δrk
i k = i 0 + δi k + ( IDOT )t k
x k′ = rk cos u k
y k′ = rk sin u k
Ω k = Ω 0 + ( Ω − Ω e )t k − Ω e t oe
x = x k′ cos Ω k − y k′ cos i k sin Ω k
y = x k′ sin Ω k + y k′ cos i k cos Ω k
z = y k′ sin i k
44 GPS
Subframes 4 and 5 are split across 25 frames as numbered pages. The contents
of subframes 4 and 5 have different formats depending on the page numbers.
Subframes 4 and 5 have the page number encoded as 8 bits at an offset of 63 (byte 8,
bit 7). The pages contain almanac and other information.
The almanac is a coarse, longer-term model of the satellite orbits, which allows
a handset to calculate the location of a satellite with low precision. The ephemeris
information is useful for a few hours, but the almanac is useful over a longer
period—approximately 1 month. The almanac is helpful for the case in which a
handset is switched on after being off for some time. In this case, the handset has no
current ephemeris information. In order to determine for which satellites to search,
the handset can then use the almanac to determine the satellites that should be in
view from the last stored location.
⎧ ⎡ ⎛ x2 x 4 ⎞⎤ ⎫
⎪ ⎢
F * 5.0 * 10 −9
+ ( AMP ) ⎜1 − + ⎟ ⎥, x < 157
. ⎪
Tiono =⎨ ⎣ ⎝ 2 24 ⎠ ⎦ ⎬
⎪ ⎪
⎩ ( −9
)
F * 5.0 * 10 , x ≥ 157 .
⎭
where
⎧ 3 ⎫
AMP = ⎨ n∑
⎪ α n φ m , AMP ≥ 0 ⎪
n
=0 ⎬
⎪ if AMP < 0, AMP = 0⎪
⎩ ⎭
2 π(t − 50,400)
x =
PER
⎧ 3 ⎫
⎪ ∑ β n φ m , PER ≥ 72,000
n
⎪
PER = ⎨ n = 0 ⎬
⎪ if PER < 72,000, PER = 72,000⎪
⎩ ⎭
. (053
. − E)
3
F = 1 + 160
φ m = φ l + 0064
. cos( λ l − 1.617 ) (3.5)
ψ sin A
λl = λu +
cos φ l
⎧ φ u + ψ cos A, φ l ≤ 0.416 ⎫
⎪ ⎪
φ l = ⎨ if φ l > 0.416, then φ l = 0.416 ⎬
⎪ if φ < −0.416, then φ = −0.416⎪
⎩ l l ⎭
0.00137
ψ= − 0022
.
E + 011.
t = 432
. * 10 4 λ l + GPStime
t = t − 86,400 if t ≥ 86,400
Subframe 4, page 18, also contains the information to convert the time between
GPS time and UTC time. When the time indicated by WNLSF and the DN is not in
the past, and the present time does not fall in the time span, which starts at DN + 3/4
and ends at DN + 5/4, then (3.7) is used to convert GPS time to UTC time. Equation
(3.7) determines the UTC time in seconds in the current week where t is the GPS
time in seconds, WN is the current week number, and the other fields are from
subframe 4, page 18.
When the time span falls between DN + 3/4 and DN + 5/4, then (3.8) is used:
When the time is in the past, (3.7) is used, except that the value of ΔtLSF is substi-
tuted for ΔtLS.
NavMessage
-satellites[] : SatelliteNavMessage
+getSatellite(in prn : int) : SatelliteNavMessage
+newData(in prn : int, in data : byte[])
1
SatelliteNavMessage
Subframe
-prn : int
-data : byte[]
-subframes[] : Subframe
+newData(in data : byte[])
+newData(in data : Subframe)
0..* 1 0..3 +getSubframeId() : int
+getSubframe() : Subframe
+getPageId() : int
+getPage() : SatNavMessagePage
1
0..25
SatNavMessagePage Subframe
-pageNumber : int -data : byte[]
-subframes[] : Subframe +newData(in data : byte[])
+getSubFrame() : Subframe 1 0..2 +getSubframeId() : int
+newData(in data : Subframe) +getPageId() : int
number, allocates the subframe, and adds it to the appropriate page. The dashed
lines in the sequence diagram indicate the return of control to the calling object.
As shown in Table 3.2, the subframe ID is in bit 50 and is of length 3, or byte 7,
bit 2. Since arrays are indexed from 0 in Java, byte 7 becomes array index 6. The
code to extract the subframe ID from the Subframe class is shown here:
/**
* This method extracts the Subframe Id from the subframe byte buffer
*
* @param subFrame the 300 bit, byte array that contains the subframe.
* @return the subframe id. This will be 1,2,3,4 or 5.
*/
private int getSubframeId(byte[] subFrame)
{
int subFrameId = (subFrame[6] & 0x70) >> 4;
return subFrameId;
}
A bit mask is used to mask out the bits of interest (bits 2, 3, and 4 when num-
bered from the MSB). Once the bits are masked out, the result is right shifted so that
the subframe ID has the correct magnitude. This is illustrated further in Figure 3.5.
An example of the bits in byte 7 of a subframe are shown in Figure 3.5(a); the bit
mask shown in Figure 3.5(b) aims to isolate bit numbers 2, 3, and 4. When a bitwise
and is invoked with the example in Figure 3.5(a), the masked out bits shown in Fig-
ure 3.5(c) are the result. The bits in Figure 3.5(c) are then right shifted by 4 to give
the result shown in Figure 3.5(d).
2.: newData(data)
3.: newData(data)
Subframe ID
>> 4
Subframe ID = 3
Figure 3.5 (a–d) Bit manipulation used in the getSubframeId() method.
ous section. The test classes are in the broadcast directory of the test directory.
As with the unit test classes described in Chapter 2, the classes are named the same
as the class that they are trying to test with the suffix of test. Thus, the
classes are NavMessageTest, SatelliteMessageTest, SatNavMessagePageTest, and
SubframeTest.
3.11 Decoding and Storing the Navigation Model 49
There is also an application class that can be run to invoke the NavMessage
class. It is in the app package and is called serverAgps.app.Ch3NavMessage. There
is a batch file that can be used to invoke it in the batch directory of the project
(ch3Navessage.bat).
The Ch3NavMessage class has a hardcoded array of raw NAV data as strings
with their corresponding PRN. When the class is run, it creates an instance of the
NavMessage and repeatedly calls its newData method with each item of NAV data.
Once it has loaded up the class, then it calls the toString method of the NavMessage
class in order to display the information in a human readable format.
The format of the logs is described in the NovAtel log specification [9]. The log
files contain various different logs in text format. The novatel package contains sev-
eral classes to process data from these logs. The NovatelLogParser class reads
through the file and calls the appropriate class to parse each type of log. For exam-
ple, if the log is a raw navigation message log, then it invokes the
NovatelRawEphemeris class to parse the subframe data out of the log.
The Ch3NavMessageFromLog class in the app package reads its navigation
message from the log file using the classes from the novatel package to get the infor-
mation for the log.
SatelliteInfoHandler
-sateInfoCollection
1
Utc
0..* -utcParameters
+getUtcTime(in gpsTime : double) : double
SatelliteInformation
-satellites[] : Satellite
+getSatellite() : Satellite
IonosphereModel
1
-ionosphereParameters
0..* +getCorrection(in location : Wgs84Coordinate) : double
Satellite
-clockCorrectionParameters
-Ephemeris
+Satellite(in navMessage : SatelliteNavMessage)
+calculateLocation() : Wgs84Coordinate
+calculateVelocity()
Instances of these classes are populated from RINEX files (see Section 3.11.5).
The SatelliteInfoHandler class contains a collection of SatelliteInformation objects.
The SatelliteInformation instances hold the Satellite instances for all of the satellites
at a particular time, while the SatelliteInfoHandler contains a collection of
SatelliteInformation objects for different times. One application of the
SatelliteInfoHandler class is to store a whole day’s worth of ephemeris information.
This method is passed the time of the GPS week in seconds (line 9) and returns
an instance of a Wgs84Coordinate as the result (line 50). The method is written to
illustrate the steps in (3.4) and has no optimizations or error checking. The code
simply steps through the lines in (3.4) to calculate the location of a satellite at a
given time. The only step of the process that is not sequential is the method to calcu-
late Ek (the eccentric anomaly) that is called on line 15. It is calculated iteratively by
the calculateEccentricAnomaly() method as shown here:
1. /**
2. * This method determines Ek through iteration. Ek is the eccentric
3. * anomaly and is defined in the GPS SS and the GPS IS as one of the
4. * calculations used for calculating the location of the satellite.
5. * It normally converges in 5 to 8 iterations.
6. *
7. * @param mk this is the mean anomaly.
8. *
9. * @return the calculated eccentric anomaly.
10. */
11. private double calculateEccentricAnomaly(double mk)
12. {
13. double ek = mk;
14. double oldEk;
15.
16. //This loop normally converges within 8 iterations but we have a counter in the loop to
17. //guard it from getting into an endless loop.
18. int numberOfIterations = 0;
19. do
20. {
21. oldEk = ek;
22. ek = mk + this.e * Math.sin(ek);
23. numberOfIterations++;
24. }
25. while(Math.abs(ek - oldEk) >= Satellite.SMALL_DIFFERENCE_IN_ESTIMATE &&
26. numberOfIterations < Satellite.MAX_NUM_ITERATIONS_CALCULATING_EK);
27.
28. //We should check to make sure that the iteration converged
29. if(numberOfIterations == Satellite.MAX_NUM_ITERATIONS_CALCULATING_EK)
30. {
31. System.out.println(“calculateEccentricAnomaly ek did not converge”);
32. //Do something here to indicate that there is a problem.
33. //Throwing an exception might be the best thing to do.
34. }
35. return ek;
36. }
A typical tracking sequence begins with the receiver determining which satellites to
track [14]. It normally does this by using its previously stored location, the almanac,
and the time from a real-time clock. The almanac is used to determine the approxi-
mate position of the satellites. The handset then determines the satellites that are in
view from the previously stored location by calculating which satellites are above
some predetermined elevation mask, for example, 5°. If the handset has no informa-
tion about which satellites for which to search, it engages in an open sky search
where it searches all PRN codes. Once each satellite is tracked, the handset immedi-
ately attempts to demodulate the navigation message data. Once it demodulates the
navigation message, it is stored so that it can be used to calculate the location of the
satellite.
One method for satellite signal acquisition is to use code correlation. An inter-
nal replica of the transmitted signal is used (the predefined PRN code) and aligned
with the received signal. The receiver shifts its generated signal until it aligns with
the received signal. The delay in the receiver-generated code is a measure of the time
of flight between the satellite and the handset, and hence the range between the sat-
ellite and the handset.
This section introduces receiver positioning at a geometric level. The position calcu-
lation is discussed in more detail in Chapter 6.
GPS is a time-synchronized system that uses the time of arrival (TOA) of signals
from several transmitters in order to determine the location of the handset. Since the
time of transmission (TOT) can be determined, the propagation time can be con-
verted into a range measurement. Note, however, that the handset is not precisely
synchronized to GPS time, so the range measurements are really pseudorange
measurements.
Consider the two-dimensional system shown in Figure 3.7. An often-used
example of TOA-based positioning is that of a vessel determining its position based
on hearing the sound of a foghorn being blown [15]. The vessel and the foghorn
have accurately synchronized clocks and the foghorn, at a known location, is
sounded on the minute mark. The captain notes the time from the minute mark until
it is heard onboard the vessel. The time of flight (TOF) is the propagation time from
when the tone leaves the horn until it is received on the vessel and it can be con-
verted to a distance (or a range to the vessel) by multiplying it by the speed of sound.
This can be considered as a range from a single transmitter. Consider only one
transmitter (Tx1) in Figure 3.7. If r1 is the only measurement available, the vessel
could be anywhere around the circle that is range r1 from Tx1. Consider the situa-
tion of two foghorns (or two transmitters) Tx1 and Tx2 and the range from them to
the vessel. The possible vessel locations have been significantly narrowed to the two
intersection points of the circles, which are shown as x and y. In two dimensions, a
unique solution cannot be established unless there is a third measurement, such as
3.13 Receiver Positioning 55
r3
Tx 3
Tx 1
x
r1
r2 Tx 2
that from Tx3. The intersection of all three circles is the location of the vessel at the
point x.
Consider the situation where there is some uncertainty in the measurement. An
example could be that the clock of the vessel is not perfectly synchronized to the
time used by the foghorns or there is some error inherent in each measured range.
This is shown in Figure 3.8. Each range measurement is shown with an associated
error band. The location of the vessel is no longer at a point, but is somewhere
within the area of intersecting arc bands. This is the uncertainty area.
GPS employs TOA for user position determination however instead of a fog-
horn; each satellite transmits a characteristic ranging signal, which travels at the
speed of light. The range can be determined by multiplying the TOF with the speed
of light. In addition, since the transmitters are not in the same plane as the user, the
problem is moved into three dimensions instead of two. This means that the solu-
tion of the user location is now the intersection of spheres and not circles. The inter-
section of three spheres result in two intersection points, but normally, one of them
will not be near the Earth so it can be eliminated. Note that in practice the location
is not calculated as a linear intersection of spheres but as an adjustment of an a pri-
ori position as described in Chapter 6. In addition, the GPS location calculation is
56 GPS
r3
Tx 3
Tx 1
x
r1
r2 Tx 2
slightly more complicated because the user’s clock is not synchronized to GPS, so an
additional satellite measurement is required to solve for the handset clock error.
North
Orientation
Semimajor axis
Lat, long, alt
(a) Aerial view
Semiminor axis
Altitude uncertainty
(b) Plane view
Figure 3.9 Uncertainty ellipsoid: (a) aerial view and (b) plane view.
transmitters from which the measurements are taken. Accuracy can only be deter-
mined if the ground truth of the handset is known.
Confidence is the measure of how certain we can be that the location is inside a
given area. A location specified at a higher confidence will have a higher uncertainty
(a larger uncertainty ellipsoid) than one specified at a lower confidence. Confidence
is a statistical measure of the size of the uncertainty and is based on a normal proba-
bility distribution [16]. The position calculation is discussed in more detail in Chap-
ter 6 but you will see that the least squares process calculates the uncertainty ellipse
at a specific confidence. This ellipse is then scaled using a Gaussian scaling in order
for its size to reflect the desired confidence.
The Gaussian scaling is performed using the inverse error function [17] and the
scaled uncertainty is given by
58 GPS
⎛ 1
⎞
erfinv⎜⎜ desiredConfidence n ⎟⎟
⎝ ⎠
scaledUncert = initialUncert × (3.9)
⎛ 1
⎞
erfinv⎜⎜Confidence n ⎟⎟
⎝ ⎠
The major sources of error when calculating a GPS-based location are shown in
Table 3.7.
The ionosphere is the uppermost part of the atmosphere and stretches from a
height of about 50 kilometers to more than 1,000 kilometers. As the GPS signal is
transmitted through the ionosphere, it is dispersed by the free electrons that are in
the ionosphere. The ionosphere varies significantly from day to day, and also within
a day as a result of solar conditions [18]. The typical global average ionosphere
delay errors for L1 vary from 9.8-meter 95% for benign ionospheric conditions, to
19.6-meter 95% for disturbed ionospheric conditions [1]. The errors can be as large
as 100 meters in some solar conditions. The largest errors are seen during solar
storms.
The GPS ionosphere model will typically remove about half of the ionosphere
error from the measurement [2]. The effect of the ionosphere is more significant for
the satellites lower to the horizon. One way to reduce the impact is to apply a mask
angle so that satellites below a certain angle are removed from the position
calculation.
The troposphere is the region that exists from the surface of the Earth to an alti-
tude of about 50 kilometers. GPS signals traveling through the troposphere will be
affected by a tropospheric refraction delay. The bias can be up to 20 meters for sig-
nals from satellites that are low on the horizon. Dry atmospheric effects are easily
modeled and account for 90% of the troposphere [18]. The wet atmosphere is
highly variable and difficult to model. The tropospheric delay is a function of tem-
perature, pressure and relative humidity. A troposphere model is a model that pre-
dicts the delay in the signal reaching the handset from the satellite due to the
troposphere. The delay is calculated according to the slant path from the satellite to
the point on the ground. An example is a seasonal based model, which models tem-
perature, pressure, and humidity at different times of the year.
Other errors that contribute to the overall error in the calculated location
include ephemeris error, satellite clock error, multipath, and measurement error.
Ephemeris error is inaccuracy in the predicted model. Satellite clock error is due to
errors in the satellite clock even after the satellite clock correction is applied.
Multipath is also known as nonline-of-sight error (NLOS) and occurs when a signal
does not take a direct path to the receiver, but reflects off one of more objects.
NLOS errors are common among built-up areas.
One of the major factors in the accuracy of a location is the geometry of the trans-
mitters. When the transmitters are very close together, the area of overlap of the sig-
nals is larger and hence the area of uncertainty is larger. Consider Figure 3.10,
where signals from two transmitters are shown, each with the corresponding con-
stant range error. When the transmitters are spread such as they are in Figure
3.10(a), the area of uncertainty is relatively small. Figure 3.10(b) shows the situa-
tion where the errors in the range measurements are the same as Figure 3.10(a);
however, because the transmitters are relatively close together, the area of
uncertainty has become much larger.
A measure of the spread of the transmitters is called the dilution of precision
(DOP). It is a measure that can be calculated to determine how uncertain the result-
ing location will be. The smaller the number, the smaller the uncertainty area;
hence, a more accurate location. Details of calculating the DOP are shown in Chap-
ter 6. Figure 3.11 shows an example of good DOP and poor DOP. In general, the
more spread that the transmitters (satellites) are, the better the resulting location.
3.16 Differential-GPS
Tx 1
Tx 1 Tx 2
1. What is the unit test case code coverage for the broadcast package?
3.17 Software Projects 61
Corrections
GPS handset
GPS reference x, y, z, t
receiver
R 1 (x, y, z)
Figure 3.12 Differential-GPS architecture.
2. Consider the classes in the novatel package. Access the specification for a
different receiver and download some logs from one. Write the code to
process the navigation data into a NavMessage object. Try to achieve 100%
code coverage.
3. Write an application to see when the NAV message changes and report on
the changes by satellite throughout a day.
4. Write code to report on unhealthy satellites throughout a day.
5. Write some code to calculate the current UTC offset.
6. The satellite location calculation method is tested using some hardcoded
data extracted from an SP3 file that calculates the locations of the
satellites at one instant in time. Enhance the code so that it reads a real
62 GPS
SP3 file and, for each set of satellite locations, calls the Satellite class to
calculate the location of the satellite. The test class then compares the
calculated locations and fails the test if the locations are further than the
configured distance apart.
References
[1] GPS Navstar Joint Program Office, Global Positioning System Standard Positioning Service
Performance Standard, 4th ed., September 2008.
[2] GPS Navstar Joint Program Office, Global Positioning System Standard Positioning Service
Signal Specification, 2nd ed., June 2005.
[3] Parkinson, B. W., “Introduction and Heritage of NAVSTAR, the Global Positioning Sys-
tem,” in Global Positioning System: Theory and Applications, Vol. 1, Washington, D.C.:
American Institute of Aeronautics and Astronautics, Inc., 1996.
[4] GPS Navstar Joint Program Office, Navstar GPS Space Segment/Navigation User Inter-
faces, Interface Specification, IS-GPS-200, Revision D, Navstar GPS Joint Program Office,
El Segundo, CA, 2004.
[5] GPS Navstar Joint Program Office, Navstar GPS Space Segment/User Segment L1C Inter-
faces, IS-GPS-800, Space and Missile Systems Center, Navstar GPS Joint Program Office, El
Segundo, CA, 2006.
[6] GPS Navstar Joint Program Office, Navstar GPS Space Segment/User Segment L5 Inter-
faces, IS-GPS-705, Space and Missile Systems Center, Navstar GPS Joint Program Office, El
Segundo, CA, 2005.
[7] International Committee on Global Navigation Satellite Systems (ICG),
http://www.oosa.unvienna.org/oosa/SAP/gnss/icg.html.
[8] Klobuchar, J. A., “Ionospheric Effects on GPS,” in Global Positioning System: Theory and
Applications, Vol. 1, Washington, D.C.: American Institute of Aeronautics and Astronau-
tics, Inc., 1996.
[9] The NovAtel log format specification, http://www.novatel.com/.
[10] Gurtner, W., RINEX: The Receiver Independent Exchange Format, Version 2.10, Astro-
nomical Institute, University of Berne, June 8, 2001.
[11] SOPAC, Scripps Orbit and Permanent Array Center, http://sopac.ucsd.edu/.
[12] The International GNSS Service, http://igscb.jpl.nasa.gov/.
[13] Hilla, S., The Extended Standard Product 3 Orbit Format (SP3-c), National Geodetic Sur-
vey, National Ocean Service, NOAA, Silver Spring, MD, 2007.
[14] GPS Navstar Joint Program Office, Navstar GPS User Equipment Introduction, September
1996.
[15] GPS Navstar Joint Program Office, Global Positioning System User’s Overview,
YEE-82-009D, GPS JPO, El Segundo, CA, March 1991.
[16] Weisstein, E. W., “Confidence Interval,” in MathWorld: A Wolfram Web Resource,
http://mathworld.wolfram.com/ConfidenceInterval.html, 2009.
[17] Weisstein, E. W. “Inverse Erf,” in MathWorld: A Wolfram Web Resource,
http://mathworld.wolfram.com/InverseErf.html, 2009.
[18] Spilker, J. J., and B. W. Parkinson, “Overview of GPS Operation and Design,” in Global
Positioning System: Theory and Applications, Vol. 1, Washington, D.C.: American Insti-
tute of Aeronautics and Astronautics, Inc., 1996.
CHAPTER 4
63
64 Assisted-GPS and Assistance Data
GNSS Reference
Server (GRS)
GPS receiver
A-GPS handset
Serving cell
Network
Time server
Location Server (LS) Initial uncertainty area
(NTP)
Emergency Services
Location-based
Messaging Entity
application (LBA)
(ESME)
model, and some subframe header information. The protocol between the LS and
the GRS is proprietary, but often consists of an HTTP wrapper with either raw
binary data or a standards-based encoding such as RRLP [3].
When a request is received from a handset for assistance data, the LS uses the
approximate location and uncertainty of the handset to package up assistance data
that is relevant for that location. The approximate location generally comes from
the location of the cell in a cellular network. The handset uses the provided assis-
tance data to lock on to the satellites and either calculate its own location or pass the
measurements back to the LS to perform the position calculation.
The protocol between the LS and the handset is standards-based and generally
depends on the radio access network type. For example, for GERAN, the protocol is
RRLP [3] and for UTRAN the protocol is PCAP [4]. The LS is discussed in more
detail in Section 4.3. Note that in a UTRAN network, the LS is a stand-alone SMLC
(SAS) and uses PCAP to talk to an intermediate node called the radio network con-
troller (RNC). The RNC does some manipulation of the data and uses Radio
Resource Control (RRC) Protocol [5] to interact with the handset.
The time server is a component that provides accurate time to the LS. This
allows the LS to provide the most accurate time possible when it is providing time to
the handset in the reference time data type. The time server will normally be in the
same local network as the LS. The interface between the time server and the LS is via
the Network Time Protocol (NTP) [6]. NTP is a protocol for synchronizing clocks
over a variable latency, packet-switched network, which can achieve accuracies of
200 microseconds in local area networks.
The location-based application (LBA) is an entity that connects to the LS in
order to request the location of a handset in the network. The LBA is normally sub-
ject to strict privacy controls and uses the Mobile Location Protocol (MLP) [7] to
4.2 GNSS Reference Server (GRS) 65
interact with the LS. MLP is an XML-based protocol that allows the LBA to request
the location of a specific handset and receive the result. The result is a location with
a given uncertainty at a specific confidence and it is subject to the quality of position
(QoP) parameters provided in the request.
In the United States, the North American Emergency Services (NAES) model is
used to deliver the location to the Public Safety Answering Point (PSAP) via an
Emergency Services Messaging Entity (ESME) using the National Emergency Num-
ber Association’s (NENA) E2 interface [8]. The E2 interface is applicable to the
GMLC or MPC and is defined with a binary protocol. The ESME connects to the
MLC over the E2 interface and requests the location of specific handsets. Note that
the emergency services architecture is different in other parts of the world, which
means that the LBAs outside the United States will normally be sending in both
emergency and nonemergency requests over the MLP interface.
The GRS caches data from GPS receivers and makes it available to the LS on a client
interface. The architecture of a global coverage GRS is shown in Figure 4.2.
Figure 4.2 shows an example network of GPS reference receivers that are
sparsely distributed around the Earth, with a connection from the GRS to each fixed
receiver. The receivers are considered as part of the GRS and are likely to be con-
nected to the GRS using TCP/IP, but may use any appropriate protocol. If TCP/IP is
used, each receiver may have its own terminal server or may directly support
TCP/IP.
The receivers are likely to have their own proprietary data format for supplying
the GPS data back to the GRS. Some GPS receivers may use a proprietary version of
a well-known format such as RINEX [9]. The GPS receivers may be configured to
continually stream the data to the GRS, or they may work using a request/response
model where the GRS requests the data it requires. The important thing is that the
information is provided back to the GRS in near real time. This means that the data
in the GRS is fresh and some of the more time-critical information, such as the
subframe header information, is available to the LS, and hence the handset, very
quickly.
Figure 4.2 shows that all of the receivers are connected back to the GRS via
some sort of network. The task of the GRS is to collate the most up-to-date informa-
tion from all of the GPS receivers and make that information available over a client
interface.
Each GPS receiver in the network receives per-satellite information from all of
the satellites that are visible to it. The per-satellite information includes subframe
headers, satellite accuracy and health information, satellite clock correction fields,
and the ephemeris. If there is any overlap in the field of view of the receivers, the
GRS will receive multiple copies of the ephemeris for each satellite. The GRS needs
to check the timestamp (and the IODE and IODC) of each set of ephemeris for a
particular satellite and store the most recent copy of the data.
66 Assisted-GPS and Assistance Data
Satellite
broadcast
information
Fixed GPS
receiver
GNSS Connections to GPS
Reference reference receivers
Server
(GRS)
Client Earth
interface
Almanac and other subframe 4 information are visible to all of the reference
receivers since they are transmitted by all of the satellites. The GRS only needs to
keep a single copy of the most up-to-date version of this.
Once the data is collated, the GRS will normally open a port to allow clients (for
example, the LS) to connect over the client interface in order to request and receive
GPS data.
of 42.6°) and the half-beamwidth of GPS L2 is 23.4° (covers an angle of 46.8°). This
means that objects above the surface of the Earth or even a satellite on the far side of
the Earth with a GPS receiver can measure the signals, provided that it is not in the
Earth’s shadow.
Figure 4.3 shows a cross-sectional view of the Earth with two GPS reference
receivers on the surface and one satellite in orbit.
For simplicity, in Figure 4.3, the Earth is modeled as a circle with its radius a
equal to the semimajor axis of the WGS 84 ellipsoid. The outer circle is the plane in
which the satellites orbit, approximately 20,180 kilometers above the surface of the
WGS 84 ellipsoid. The range from the surface of the Earth to the satellite is shown
as r.
One GPS satellite is shown that is in the periphery of the field of view of both of
the GPS receivers. The arc on the surface of the Earth between the two GPS receivers
is the maximum distance that two GPS receivers can be separated in order for the
satellite to be detected by at least one of the receivers. If the receivers are separated
by a greater distance, then there will be a gap in the coverage where the satellite is
not being measured and the GRS will not have access to the current subframe
header information, or possibly even the updated ephemeris, if there is a change in
the ephemeris when the satellite is in the area of no coverage.
The figure shows that the angle 2α gives the maximum angular separation
between the receivers in order to ensure coverage. Using the cos rule, α is given by
⎛ a ⎞
α = cos −1 ⎜ ⎟ = 761
. degrees (4.1)
⎝ a + r⎠
GPS
Reference
receiver
α
a + r
r
GPS
Reference
Earth
receiver
2α
d = 2 πa = 16,945,0233
. meters (4.2)
360
⎛ a sin( β + 90)⎞
δ = sin −1 ⎜⎜ ⎟⎟ (4.3)
⎝ a+r ⎠
GPS
Reference
receiver δ
β
χ
a+r
r α
GPS
Reference
receiver
Earth
Figure 4.4 Two-dimensional view of field of view with overlapping field of view.
4.2 GNSS Reference Server (GRS) 69
and χ is given by
In the case where the overlap (β) is 5°, δ is 13.8°, χ becomes 71.2°, and the angu-
lar separation (α + χ) becomes 147.34°. The maximum distance d on the surface of
the Earth becomes 16,348,941.2 meters, or 16,349 kilometers. Furthermore, when
the overlap is 10°, the separation becomes 142.53°, which translates to a distance of
15,816 kilometers.
To cover a local area of the Earth, such as mainland United States, we would
simply need to put receivers at the extremities of the coverage area since the distance
between two points is less than 15,816 kilometers (using the example 10° overlap).
The reason for putting the receivers as close to the perimeter as possible is to
ensure that the GRS has the most up-to-date information from the rising and setting
satellites.
The discussion up to this point has focused on the minimum requirements to
laying out a GPS receiver network. However, redundancy is an important consider-
ation when planning a network. Redundancy includes duplicating equipment
within a site and duplicating sites within the network. The designer of the GRS
should consider the availability requirements when deciding where to site the
receivers and other network equipment. A high availability GRS may use a hot
standby or a round-robin system within each site or may even consider each GPS
receiver in the network as an independent unit that is collecting data. In this case,
the GRS simply takes a feed from all of the receivers in the network and collates the
information. It is important that the GRS performs integrity monitoring of the
receivers in the network.
If the GRS is providing differential corrections, the network of reference receiv-
ers needs to be significantly denser. As discussed in Chapter 3, the corrections will
be most accurate when the handset is within 100 kilometers of the reference station
that is used to provide the corrections. Comprehensive discussion about the refer-
ence network can be found in [11].
work operator is that the network operator does not need to have changes made to
the LS each time that they want to change GRS providers. The advantage to the LS
providers is that they do not need to support a multitude of different interfaces to
GRS providers. GNSS Reference Interface Protocol (GRIP) [12] is presently the only
open protocol that has been defined between and LS and the GRS and it is discussed
in the next section.
Open Source
Location
GNSS Reference GPS
Server GRIP Data
Server
(LS) source
(OSGRS)
types listed: navigation model, ionosphere model, real-time integrity, UTC model,
and reference time. Note that the request shown is only for GPS assistance data
(GNSSType parameter); however, GRIP is not restricted to GPS.
<?xml version="1.0" encoding="UTF-8"?>
<GNSSRequest GNSSType="GPS"
xmlns="http://www.gmat.unsw.edu.au/snap/grip/1.5"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<AssistTypeAllSats data="NavModel IonoModel RTI UTC RefTime"/>
</GNSSRequest>
The response provided from the OSGRS is shown next. Note that it is only
showing two satellites for the per-satellite assistance data types to be concise, but
the client expects to receive assistance data for all satellites that are in view of the
data source. If the data source consists of a stand-alone receiver in open sky, for
example, then the client would expect to see the assistance data for 10 to 12 satel-
lites or more. If the data source is from a global network such as a commercial pro-
vider or a Web-based RINEX data source, then the assistance data for all satellites
would contain the full constellation of satellites. A-GPS assistance data types and
their contents are discussed later in this chapter.
<?xml version="1.0" encoding="UTF-8"?>
<GNSSResponse GNSSType="GPS"
xmlns="http://www.gmat.unsw.edu.au/snap/grip/1.5"xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance">
<AssistTypeAllSats>
<NavModel>
<sat
number="2">8B065C8CA0A465D0010045A5905BABDA135662BEDBA56B3A0000190EFA448B065C8CA12AA50
91B3176377C8F1907A6047F5A5E1653A10CCCA86B3A7E8B065C8CA1AC0079F86A32C9FFF0269127BC14675
EF1C04CFFAB23A5E094</sat>
<sat
number="4">8B065C8CA0A465D0000045A5905BABDA135662BEF4876B3A00FFF80143D38B065C8CA12A870
A2130D3A088963508A103EB9A411787A10C990D6B3A7E8B065C8CA1ACFFFBF9331B37FFA6268B1C9813770
AD0980CFFAB4C87E6B3</sat>
</NavModel>
<IonoModel>
<Data>0602FFFE2906FFF8</Data>
</IonoModel>
<RTI>
<badSats>3 6 8 24</badSats>
</RTI>
<UTC>
<Data>00001F0000000890970E4B070E</Data>
</UTC>
<RefTime>
<sat number="2">407 5410671 2 407 1 0 0</sat>
<sat number="4">407 5410671 4 407 1 0 0</sat>
</RefTime>
</AssistTypeAllSats>
</GNSSResponse>
In addition to the all-satellites data, GRIP also supports the concept of satellites
in view. This means that the client can request the assistance data for a certain lati-
tude, longitude, and altitude, and the OSGRS will only return the satellites that are
in view from that location.
The OSGRS can be downloaded as Java source code and documentation from
the OSGRS Web page [12]. As well as source code, the OSGRS consists of the GRIP
specification and design documentation with the classes described using UML.
72 Assisted-GPS and Assistance Data
The LS is the node that receives a request from the LBA, the ESME, or the handset to
determine a location. Depending on the capabilities of the handset, the LS packages
assistance data into the format required by the protocol that is being used and pro-
vides the assistance data to the handset. The handset may use the assistance data to
lock onto the satellites and calculate its own location, or it may return the measure-
ments to the server to calculate the location.
As outlined in Chapter 1, the protocol used by the LS to communicate with the
handset often depends on the radio access network (RAN). The LS is often an MLC
that is a node that runs in various networks and can act as stand-alone mobile location
center (SMLC), gateway mobile location center (GMLC), stand-alone SMLC (SAS)
[14], SUPL location platform (SLP) [15], or location information server (LIS) [16].
There are several different standards for the A-GPS messaging with the handset.
RRLP [3] is used by the SMLC and SLP, PCAP [4], and RRC [5] in UTRAN net-
works and TIA-801 [16] in CDMA networks and may also be used by the SLP.
These protocols are different ways of encoding the same basic information but are
specific to the radio access technology.
The secure user plane location (SUPL) architecture [15] is an alternative proto-
col that allows the bypass of many of the traditional telecommunication elements by
allowing the handset to make a TCP/IP connection directly with the SLP.
The specific protocol and details of the messaging is discussed in Chapter 5.
However, the basic message flow for an LBA-initiated nonemergency A-GPS loca-
tion is shown in Figure 4.6 and described next. The numbers in the following steps
relate to the numbers shown in Figure 4.6.
There are other messaging scenarios such as pushing the assistance data in the
initial message in (2) and when the messaging is initiated by another entity such as
the handset. The LS often performs additional functions such as logging and billing.
In order to determine the assistance data to send to the handset, the approxi-
mate location of the handset is required. The cell identifier is provided in the
messaging and the LS retrieves information about the cell from its internal cell data-
base. This information includes the latitude and longitude of the cell and the size of
the cell (a cell is normally described with a range, an orientation from the North,
and an opening angle). Since the handset can be anywhere inside the cell, the loca-
tion of the center of the cell area is used as the location from which to calculate the
satellites in view. If the initial area is very large, more complex mechanisms are
required to determine the satellites in view from the entire uncertainty area.
4.4 Location-Based Application (LBA) 73
MLC
periodically
requests data
from the GRS
using GRIP or
a proprietary
GNSS reference
protocol
server (GRS)
Time is
synched using
NTP protocol
4. Assistance data
5. Location
Location-based
application (LBA)
In order to determine the assistance data, the first step is to determine which sat-
ellites are in view of the approximate location. The LS uses the ephemeris to calcu-
late the location of all of the satellites in WGS 84 ECEF coordinates. It then
calculates the elevation between the initial location and each satellite. All of the sat-
ellites that are above a certain mask angle are considered to be in view of that loca-
tion. The mask angle may be 0° or 5°.
Given the list of satellites that are in view, the LS pieces together the assistance
data message with all of the required assistance data types for that set of satellites.
In this section we have described the basic operation of an LS in terms of GPS.
However, the LS may support other GNSSs in conjunction with GPS or alterna-
tively to GPS. Other GNSSs and A-GNSS are discussed further in Chapter 10.
The LBA is an entity in the network that connects to the MLC in order to request the
location of a handset. The LBA connects and requests locations using the MLP pro-
tocol [7]. In the LCS architecture [14] this interface is known as the Le interface.
MLP requests for location can be either emergency or standard requests. In the
NAES model, the E2 interface is used for emergency requests instead of MLP; this is
discussed in the next section.
Some examples of LBAs include tracking applications, child-finder applica-
tions, applications that provide directions to services or facilities, and geo-games.
They all require the location of the handset at a given time.
74 Assisted-GPS and Assistance Data
The interface between the ESME and the LS for NAES (used in the United States) is
specified in the J-STD-036 [19]. The details of the protocol are defined by the E2
interface [8]. Emergency Services Protocol (ESP) messages flow over the E2 inter-
face between the ESME and the LS and enable the ESME to request the location of a
particular handset. In a redundant system, the PSAP will generally be linked to one
or more ESMEs that, in turn, have connections to one or more LSs.
The ESP messages are in a binary format that allows the ESME to query for
an initial cached location, an updated location, or a last known location. The
ESP request contains the parameters to identify the handset and the position
request type required (initial, updated, or last known). The ESP request response
contains the location or if the request was not fulfilled, and the LS returns an ESP
request response error. The ESP protocol has a restricted set of shapes that are
returned compared to the GAD specification. The following shapes are supported
by E2:
• Ellipsoid point, which is a point on the WGS 84 ellipsoid (latitude and longi-
tude);
• Ellipsoid point with uncertainty, which is a circle on the ellipsoid (latitude,
longitude, uncertainty in meters, and confidence);
• Point with altitude and uncertainty, which is the same as the circle but also
includes altitude and altitude uncertainty.
The result of a GPS position calculation is normally an ellipsoid point with alti-
tude and uncertainty ellipsoid. In order to convert the location into something that
can be sent over E2, the uncertainty ellipse is converted to a circle.
76 Assisted-GPS and Assistance Data
The handset contains a GPS receiver that is specifically designed to receive GPS sig-
nals. It will also have certain enhancements in order to make use of the assistance
data, and it will have a component that can connect to the wireless network in order
to exchange information and receive assistance data from the LS. It may be a cellu-
lar handset or could be a laptop computer or any other type of networked device
such as a camera or a scientific instrument. The handset will be running an applica-
tion that knows the protocol to use for the RAN that it is connected to, may be using
ULP to communicate with an SLP, or may be using some proprietary protocol to
talk to a custom LS.
The handset may initiate the location request, for example, by invoking an LBA
or by dialing the emergency number. Alternatively, the location may be initiated by
the network. Regardless, the A-GPS capable handset will request the assistance data
that it needs to commence a GPS location calculation.
When the handset receives and decodes the assistance data message, it starts
searching for the specific satellites. Once it acquires the first satellite, the offset of
the local oscillator can be determined and accounted for. The acquisition of the
other satellites can be performed very rapidly since the information is provided in
the assistance data. Once the satellites are acquired, the receiver does not need to
demodulate the NAV message but can use the information transmitted through the
wireless network to aid the calculation process. The NAV model is used to correct
for different factors and to calculate the clock offset and location of the satellites in
order to facilitate the location calculation in a handset-based A-GPS operation.
An alternative mode of operation of the handset is to run in handset-assisted
mode. In this mode, more compact assistance data is provided to the handset in
order for it to lock onto the satellites. The handset just makes the measurements and
returns them to the server in order for it to do the calculation. This frees the handset
up from performing battery-consuming calculations and allows the server to per-
form hybrid calculations by using other terrestrial-based measurements in addition
to the satellite measurements.
A more detailed description how an A-GPS handset operates can be found in
[20].
This section describes the significant GPS assistance data types. A summary of the
different assistance data types was provided in Table 1.1. It is worth noting that
there are some assistance data types that apply to the entire GPS and some that are
per satellite.
The two significant modes of A-GPS are handset-based A-GPS and hand-
set-assisted A-GPS. For handset-based A-GPS, the handset performs the location
calculation, whereas for handset-assisted, the calculation is performed on the
server.
Handset-based A-GPS requires a significant amount of information to be trans-
mitted to the handset compared to handset-assisted. This is because the handset
4.7 Assistance Data Types 77
needs to determine where the satellites are in order to restrict its search space and
calculate the location of the measured satellites once the measurements have been
made. Finally, it performs the position calculation using the measurements cor-
rected using the ionosphere model.
Handset-assisted A-GPS, on the other hand, relies on the LS to use the assistance
data to calculate the search space for the measurement acquisition and finally calcu-
late the location. This means that the navigation model does not need to be trans-
mitted to the handset.
It is worth noting that the protocols normally identify each satellite with a satel-
lite ID, which is in the range of 0–63. To convert the satellite ID to a PRN, 1 is added
to it for GPS.
Most of the assistance data types are restricted to send 16 satellites for the
per-satellite information. This is because they are intended to contain the assistance
data for the satellites in view of the approximate location. The approximate loca-
tion will normally come from the location of the cell and includes the area that the
cell covers. There is an assistance data type described next called real-time integrity,
which is a list of satellites that have an integrity problem as detected by the GRS.
When the LS determines the satellites in view, it will generally remove all of the sat-
ellites that are on the real-time integrity list.
The assistance data types are discussed with reference to the RLRP and the
PCAP specifications. It may be useful to have them available when you are looking
at this section.
tocols). For this reason, the server normally provides the information for the satel-
lites that are in view from the approximate location.
The reference time data type also contains optional fields that describe the rela-
tionship between the cellular network time and the GPS time. In RRLP, there are
fields that describe the state of the GSM frame number, the timeslot number, and
the bit number of the reference BTS. In PCAP there are fields that describe the
UTRAN GPS time relationship. For further information, see the individual protocol
specifications.
When the LS receives a request for the GPS reference time, it extracts the GPS
TOW assist information from the data that it has cached from the GRS. It then gen-
erates the GPS week and the GPS time of week. Since the LS is synchronized to UTC
time (as a result of its connection to the NTP server), an LS written in Java would
make a call to the Java System class to determine the current time by invoking Sys-
tem.currentTimeMillis(). This system call returns the UTC time in milliseconds.
This is the current time on the LS; however, there will normally be some delay
between when the LS determines a time and the handset receives and decodes the
reference time data type. The most significant part of the delay is the network delay.
The LS will normally apply an offset to the time that is an estimate of the latency
between itself and the handset.
The LS then uses the GPS UTC model to convert the time from UTC to GPS
time. This results in the GPS week and the GPS time of week in milliseconds. The
Java code to calculate the offset between UTC and GPS time was shown and dis-
cussed in Chapter 3. Once the time is calculated, it is encoded in the format specific
to the protocol being used.
being encoded for each request. The application of the UTC model was discussed in
Chapter 3.
Reduced
Bin search space
kHz
−5
ler
pp
Do
Code phase 0 to 1,023 chips Code phase 0 to 1,023 chips
(a) (b)
Figure 4.7 (a, b) GPS search space and search space reduced by acquisition.
The code phase is the offset between the measured C/A code and the replica gen-
erated by the handset, which is between 0 and 1,023 chips. The Doppler is the
received frequency that has been shifted from the transmitted frequency. The size of
the frequency shift depends on whether the satellite is approaching or receding from
the handset and also on the rate of the relative motion and the local oscillator offset.
The Doppler will be within 5 kHz on either side of the transmitted frequency, not
counting the user motion and the handset oscillator offset. The Doppler will gener-
ally be zero when the satellite is at the zenith and will be at its maximum when the
satellite is on the horizon, which is traveling at its maximum radial velocity.
The GPS acquisition assistance data type narrows the search down to the
two-dimensional search space shown in Figure 4.7(b). The GPS acquisition assis-
tance contains the estimated code phase and Doppler for each satellite as well as the
size of the search required for each side of the estimated values. The size of the
search window is a function of the uncertainty of the estimated location. If the esti-
mated location has a very small uncertainty, then the search windows will be small,
but if it has a large uncertainty, the search area will be large.
Note that since the receiver’s clock is not perfectly synchronized with GPS, the
code phase and Doppler shift search windows are not absolute. This means that a
broad search is attempted for each of the satellites for which assistance data is pro-
vided, and once the first satellite is found, the remaining satellites use the search
windows from the acquisition assistance relative to that of the first satellite
measured.
The GPS acquisition assistance is calculated by the LS using the assistance data
from the GRN and the handset’s estimated location and uncertainty. The GPS
acquisition assistance information consists of the time at which the data was calcu-
lated and the per-satellite information. The per-satellite information is shown in
Table 4.5.
In order to calculate the expected Doppler shift, an estimate of the difference
between the satellite and the user motion is determined. Since the motion of the
handset is unknown, the LS assumes that it is at rest and the velocity is set to zero.
4.7 Assistance Data Types 83
The Doppler shift in hertz is calculated from the dot product of the difference in
the velocities and the estimated line of sight vector as shown in (4.5) [23]:
⎛ v − vr $ ⎞
D = −⎜ s ⋅ls⎟f (4.5)
⎝ c ⎠
where vs is the velocity of the satellite, vr is the velocity of the receiver, c is the speed
of light, l$s is the estimated line of sight unit vector, and f is the transmitted frequency
(1,575.42 MHz for GPS L1).
The line-of-sight vector is calculated as the difference between the satellite and
receiver location divided by the norm of the difference as shown in
r − r$r
l$s = s (4.6)
rs − r$r
where rs is the location of the satellite in WGS 84 ECEF coordinates and rr is the esti-
mated location of the receiver.
Xu [24] introduced a correction to the frequency to account for the clock error
of the satellite and the receiver. The satellite clock error introduces a phase error as
shown in
c * satelliteClockError
phaseError = (4.7)
λ
84 Assisted-GPS and Assistance Data
where λ is the wavelength transmitted by the satellite. This satellite phase error is
equivalent to the frequency error given by
To compensate for the frequency error, the frequency used in (4.5) is manipu-
lated as shown in
where f is the transmitted frequency (1,575.42 MHz for GPS L1) and
usedFrequency is used as input to (4.5). In practice this is only a small correction
because the satellite clock error is in the range of 1E-05 to 1E-08 milliseconds, or in
percentage terms, the frequency is adjusted by less than 1%.
Since we are working in the ECEF coordinate frame, which rotates with the
Earth, the receiver velocity vr is set to zero. The velocity of the satellite is calculated
using the formulas in Bate [25]. An alternative is to calculate the location of the sat-
ellites 1 second apart and determine the distance vectors or differentiate the equa-
tion of the satellite position in the GPS IS.
As shown previously in Table 4.5, the LS provides the Doppler shift and the
Doppler search window size in the GPS acquisition assistance data type for each sat-
ellite that is in view of the estimated location.
For each satellite, the limits of the Doppler search can be found by calculating
the Doppler shift at the boundary of the initial uncertainty area that is closest to the
satellite and at the boundary of the initial uncertainty area that is farthest from the
satellite. Figure 4.8 shows a two-dimensional view of the relationship between the
initial uncertainty area and one satellite for two different uncertainty shapes. In Fig-
ure 4.8(a) the initial uncertainty area is a circle. The Doppler is calculated at the
point on the circle closest to the satellite and at the point on the circle that is farthest
from the satellite. In Figure 4.8(b) the initial uncertainty area is an ellipse. The
points to calculate the Doppler at are the ones that intersect the tangent to the ellipse
at a right angle.
Normally, the initial location will have an altitude and an altitude uncertainty
associated with it, so the LS actually needs to calculate the point on the surface of
the volume of uncertainty that is nearest the satellite and the point on the surface of
the volume that is farthest from the satellite. Once the LS has determined the Dopp-
ler values at the two points, it uses that to set the values in the GPS acquisition
assistance.
The following steps are used by the LS to calculate the Doppler fields:
1. Calculate the satellites in view from the center of the initial uncertainty area
and for each satellite perform the following steps.
2. Calculate the Doppler shift at the point on the perimeter of the uncertainty
area that is closest to the satellite.
3. Calculate the Doppler shift at the point on the perimeter of the uncertainty
area that is farthest from the satellite.
4.7 Assistance Data Types 85
Maximum range
Minimum range
A-GPS handset
(a)
Maximum range
Minimum range
A-GPS handset
(b)
Figure 4.8 (a, b) Model for determining search windows.
4. The Doppler is the average of the Doppler at the two locations and the
Doppler uncertainty is half of the difference between the Doppler
calculated at the two locations.
One way to calculate the Doppler first-order term is to calculate the Doppler at
a point in time a few seconds ahead of the current time and then, using the original
calculation, convert that to the rate of change in hertz per second. This is shown in
Dt 2 − Dt 1
doppler1st = (4.10)
t 2 − t1
The code phase is the chip number within the C/A code and is in the range of 0
to 1,023 chips. It is calculated using
r%rCA
codePhase = 1023
, (4.11)
rCA
where r is the range or the estimated distance between the initial location and the
satellite and rCA is the resolution of the 1,023-bit C/A code in meters and the % indi-
cates the mod function. rCA is given by
CACodeLength
rCA = c = 299,792.458 (4.12)
GPSChippingRate
where the C/A code length in bits is 1,023, the GPS chipping rate is 1.023 MHz, and
c is the speed of light.
The procedure to calculate the code phase and the search window for the code
phase component of the GPS acquisition assistance is similar to the Doppler. That
is, the code phase is calculated at the points on the surface of the initial uncertainty
volume that are the nearest and farthest from the satellite. The code phase is the
average of the code phase at the two locations and the code phase search window is
half of the difference between the code phases calculated at the two locations.
4.7.8 Almanac
The almanac is a coarse, long-term model of the satellite positions and clocks. It is a
per-satellite assistance data type. The key difference between this and the other
per-satellite data types is that it is provided for the entire constellation of satellites.
Almanac is not normally requested by A-GPS enabled handsets.
Table 4.6 is reproduced from Table 1.1 and has the size of the different assistance
data types in bits tacked on as an additional column. The sizes indicate the number
of bits to store the data types as binary based on the sizes of the fields. The per-satel-
lite satellites-in-view data types are assumed to have 10 satellites in view and the
almanac size is based on 30 satellites. The reference time parameter has optional
fields describing the relationship between GPS time and the cellular time, and they
are omitted. The size of the real-time integrity data type is for three bad satellites.
The reference location is encoded as an ellipsoid point with altitude and an uncer-
tainty ellipsoid using the encoding specified in the GAD spec.
Note that when the data is encoded in the protocol particular to the RAN, the
size will be larger depending on the formatting in that protocol such as encoding of
fields, segmentation of messages over a certain size, or octet alignment. The proto-
cols are discussed in more detail in Chapter 5.
The almanac and navigation model assistance data types are by far the largest
data types that need to be transmitted. The larger the messages, the longer it takes
for the message to be sent over the radio interface and be decoded by the handset. In
addition, longer messages result in segmentation requirements that introduce addi-
tional overhead to the handset because it needs to reassemble the messages before it
can decode the assistance data.
The total number of bits required for a handset-assisted location is 860 (or 108
bytes). This is for the reference time and acquisition assistance.
The total number of bits required for a handset-based location is 15,095 (or
1,887 bytes). This is for reference time, reference location, navigation model, iono-
sphere model, UTC model, and real-time integrity.
The amount of data transmitted for handset-based A-GPS is more than 17 times
more than for that of handset-assisted A-GPS.
References
[1] Parkinson, B., et al., (eds.), Global Positioning System: Theory and Applications, Vol. 1,
Washington, D.C.: American Institute of Aeronautics and Astronautics, Inc., 1996.
[2] Kaplan, E. D., and C. J. Hegarty, (eds.), Understanding GPS: Principles and Applications,
2nd ed., Norwood, MA: Artech House, 2006.
[3] 3GPP TS 44.031 Third Generation Partnership Project; Technical Specification Group
GSM/EDGE Radio Access Network; Location Services (LCS); Mobile Station (MS)—Serv-
ing Mobile Location Center (SMLC) Radio Resource LCS Protocol (RRLP), 2009.
[4] 3GPP TS 25.453 Third Generation Partnership Project; Technical Specification Group
Radio Access Network; UTRAN Iupc Interface Positioning Calculation Application Part
(PCAP) Signaling, 2007.
[5] 3GPP TS 25.331 Third Generation Partnership Project; Technical Specification Group
Radio Access Network; Radio Resource Control (RRC); Protocol Specification, 2009.
[6] Mills, D. L., Network Time Protocol Version 4 Reference and Implementation Guide, NTP
Working Group, Technical Report 06-6-1, University of Delaware, June 2006.
[7] Mobile Location Protocol, Open Mobile Alliance, LIF-TS-101 Specification, 2009.
[8] NENA Standard for the Implementation of the Wireless Emergency Service Protocol E2
Interface, 2003.
[9] Gurtner, W., RINEX: The Receiver Independent Exchange Format, Version 2.10, Astro-
nomical Institute, University of Berne, June 8, 2001.
[10] Spilker, J. J., “GPS Signal Structure and Theoretical Performance,” in Global Positioning
System: Theory and Applications, Vol. I, B. Parkinson et al., (eds.), Washington D.C.:
American Institute of Aeronautics and Astronautics, Inc., 1996, pp. 84–86.
[11] van Diggelen, F., A-GPS: Assisted GPS, GNSS, and SBAS, Norwood, MA: Artech House,
2009.
[12] GRIP, Open Source GNSS Reference Server GNSS Reference Interface Protocol (GRIP)
Interface Document, 2008, http://sourceforge.net/projects/osgrs.
[13] Yan, T., et al., “Open Source GNSS Reference Server,” 20th Int. Tech. Meeting of the Satel-
lite Division of the U.S. Inst. of Navigation, Fort Worth, TX, September 25–28, 2007, pp.
2224–2229.
[14] 3GPP TS 23.271 Third Generation Partnership Project; Technical Specification Group Ser-
vices and System Aspects; Functional Stage 2 Description of Location Services (LCS), 2009.
4.8 Assistance Data Type Sizes 89
[15] Secure User Plane Location Architecture, Open Mobile Alliance, OMA-AD-SUPL, 2009.
[16] Dawson, M., J. Winterbottom, and M. Thomson, IP Location, New York: McGraw-Hill
Osborne Media, 2006.
[17] 3GPP2 C.S0022, Position Determination Service Standard for Dual Mode Spread Spectrum
Systems, 2004.
[18] UserPlane Location Protocol, Open Mobile Alliance, OMA-TS-ULP, 2009.
[19] TIA/EIA/IS-TIA/EIA/J-STD-036-A-A—Enhanced Wireless 9-1-1 Phase 2, March 2002.
[20] Bullock, J., et al, “Integration of GPS with Other Sensors and Network Assistance,” in
Understanding GPS: Principles and Applications, 2nd ed., E. D. Kaplan and C. J. Hegarty,
(eds.), Norwood, MA: Artech House, 2006.
[21] 3GPP TS 23.032 Third Generation Partnership Project; Technical Specification Group Ser-
vices and System Aspects; Universal Geographical Area Description (GAD), 2008.
[22] GPS Navstar Joint Program Office, Navstar GPS Space Segment/Navigation User Inter-
faces, Interface Specification, IS-GPS-200, Navstar GPS Joint Program Office, El Segundo,
CA, 2004.
[23] Axelrad, P., and R. G. Brown, “GPS Navigation Algorithms” in Global Positioning System:
Theory and Applications, Vol. I, B. Parkinson et al., (eds.), Washington, D.C.: American
Institute of Aeronautics and Astronautics, Inc., 1996.
[24] Xu, G., GPS Theory, Algorithms, and Applications, New York: Springer, 2003.
[25] Bate, R., D. Mueller, and J. E. White, Fundamentals of Astrodynamics, New York: Dover
Publications, 1971.
CHAPTER 5
As mentioned earlier, there are proprietary protocols for A-GPS which may have
application in specific closed networks. This book, however, explores the stan-
dards-based protocols that are widely used and facilitate A-GPS location of
handsets.
In this book, we consider the major cellular architectures for the GSM/Edge
Radio Access Network (GERAN), UMTS Terrestrial Radio Access Network
(UTRAN), and ANSI-41 networks, as well as the SUPL location platform (SLP) and
the location information server (LIS). The emergency services architectures for
GERAN, UMTS, and ANSI-41 are also introduced.
The location services (LCS) description [5] outlines the architecture for GERAN
and UTRAN LCS. The CDMA LCS document describes the architecture for CDMA
[6].
A mobile location center (MLC) is a node that runs in various networks and can
act as a gateway mobile location center (GMLC) [5], a serving mobile location cen-
ter (SMLC) [7], a stand-alone SMLC (SAS) [8], an SLP [9], a mobile positioning cen-
ter (MPC) [6], or a location information server (LIS) [10].
The emergency architecture for NAES LCS is described in J-STD-026 [11]. The
GMLC and MPC are required to implement the E2 interface [12]. The E2 defines
the interface for the Emergency Services Messaging Entity (ESME) to request the
location of an emergency caller. It is a binary request response protocol. The ESME
91
92 Assisted-GPS Location Within a Network
connects to the MLC and makes requests and receives responses over the binary
emergency services protocol.
The Canadian Wireless E9-1-1 requirements have recently been released [13].
The Automatic Location Identification (ALI) connects to the GMLC over the Le
interface using the MLP protocol (discussed in Chapter 4). The ALI makes request
using the MLP emergency messages and receives responses with a location as a
CircularArea. The Canadian requirements place some other minor requirements in
addition to those already defined by MLP, such as application level heart beating
and location specified at 90% confidence.
At the A-GPS (or A-GNSS) level, each protocol transports the same basic infor-
mation, but has different encodings, procedures, and naming.
This section contains the details of some of the standards-based A-GPS protocols
and the messaging between the LS and the handset. I have chosen to discuss RRLP
in the greatest level of detail, simply because it is used for both GERAN and com-
monly for the SLP. The RRLP messages and field contents are discussed in detail
along with the encoding rules and binary encoding. In addition, the Java code for
RRLP messaging is discussed in detail. PCAP is discussed in conjunction with RRC
at a relatively high level: the message level. TIA-801 is another protocol for deliver-
ing A-GPS information, but it is only discussed briefly.
Most of the standards-based protocols were initially developed for single-fre-
quency code-phase GPS L1 handsets. Recently, more signals have been added to
GPS and other GNSSs have been replenished and proposed. In order to be back-
wardly compatible with existing handset implementations, a new classification of
assistance data and measurements was added to the protocols as a separate infor-
mation element. This new classification is known as Galileo and Additional Naviga-
tion Satellite Systems (GANSS). It is used to define assistance data and
measurements for the other GNSSs and SBASs as well as modernized GPS (for
example, L2 and L5).
5.3 RRLP
The Radio Resource Location Protocol (RRLP) [1] is used to provide a handset with
assistance data in order for the SMLC to receive either the location of the handset
for handset-based A-GPS, or the GPS measurement for handset-assisted A-GPS.
RRLP also supports other GNSSs and modernized GPS by defining data types
within a GANSS information element (IE). In addition to GPS, RRLP can also be
used for enhanced observed time difference (EOTD) messaging, which is not dis-
cussed in this book.
RRLP is used as the protocol between the stand-alone mobile location center
(SMLC) and the mobile station (MS) in a GERAN network. It is also used on both
the Lup and Llp interfaces in secure user plane location (SUPL)–enabled networks.
In the case of a SUPL location platform (SLP), the RRLP is in the positioning pay-
5.3 RRLP 93
load IE for the UserPlane Location Protocol (ULP) on the Lup interface. It is used in
the positioning payload IE for the Internal Location Protocol (ILP) on the Llp inter-
face between the remote SUPL location center (SLC) and the SUPL positioning cen-
ter (SPC). The only required protocol for the positioning payload for A-GPS for
GSM and WCDMA for SUPL is RRLP. RRC [3] and TIA-801 [4] may also
optionally be used for A-GPS.
When used over control plane (between the SMLC and the MS), the amount of
data in an RRLP message is subject to a maximum of 242 octets (an octet is 8 bits).
If the data is larger than that, RRLP pseudosegmentation is used. It is possible that
legacy MSs may send data larger than that; in which case, lower level segmentation
is used [14]. Note that when the data is in the positioning payload for SUPL, there is
no such limit.
In RRLP, messages are known as components and fields in the message are
known as information elements (IEs).
The position measurement procedure allows the SMLC to request the location
or location measurement data from the MS and may be preceded by an assistance
data delivery or position capability transfer. The measure position request is sent
from the SMLC to the MS and contains session information, some control fields,
and possibly assistance data. The position measurement procedure is shown in Fig-
ure 5.1. Note that there are other network nodes that the message goes through
before getting to the MS but these are not shown for simplicity.
The measure position request may be sent as a single message or may be seg-
mented if there are more than 242 octets of data. The RRLP message contains a flag
that indicates whether there are more components of this message still to come, and
the MS uses that to determine whether to decode the data or wait for the rest of the
message.
When the MS receives a request for a location (the measure position request
message), it determines whether it has enough information to process the request. If
SMLC MS
it does, then it uses the information that it has to lock onto the satellites and return
either a location or the measurements for the server to calculate the location.
In the case where the MS does not have enough assistance data, it returns a mea-
sure position response to the SMLC with a location information error element indi-
cating that it needs more assistance data and a list of the assistance data types
required. It may also provide the details of the ephemeris that it already has cached
so that the SMLC does not send the ephemeris for those satellites again. The SMLC
then sends another measure position request to the MS with the assistance data that
the MS has requested.
The position measurement procedure is a very efficient way of getting assistance
data to a handset since the MS only requests the assistance data types that it needs
from the SMLC; however, there is a trade-off due to the back-and-forth
communication.
The assistance data delivery procedure is an alternate way to get the assistance
data to the MS and may precede the position measurement procedure. It is a mecha-
nism for the SMLC to provide assistance data directly to the MS without it being
requested within RRLP. The assistance data message is sent by the SMLC to the MS
and contains assistance data that can be used for making measurements and poten-
tially for calculating the location of a handset. The MS sends an acknowledgment
back to the SMLC on receipt of each assistance data message.
The assistance data delivery procedure is generally used when the server knows
which assistance data types that a handset will need in advance. One example is that
if the SMLC knows that a handset will always need certain data types, for example,
reference time and reference location, then those data types can be sent in the assis-
tance data message. Alternatively, there could be situations where the SMLC needs
to minimize the number of messages that are sent to the MS. For example, the oper-
ator of the SMLC may find that emergency calls are mostly made from a cold-start
situation. In this case, they may configure their SMLC to use the assistance data
delivery procedure to send a complete set of assistance data and hence prevent any
unnecessary additional messaging such as multiple measure position request
messages.
The other procedure available in RRLP is the positioning capability transfer
procedure. This procedure is used by the SMLC to request the capability of the MS
and the assistance data types that it supports. The MS returns the information to the
SMLC in a position capability response message. The SMLC can use this to deter-
mine whether the MS supports A-GPS and which modes of A-GPS it supports
(MS-based or MS-assisted).
Each procedure includes an error handling component. If there is a problem in
the message that the MS receives, it replies with a protocol error message. The pro-
tocol error message contains information that indicates the problem.
sages are introduced along with the information in some of the important fields.
The encoding and decoding of the messages are described in the next section along
with code.
The important information elements (IEs) from the measure position request
message are described in Table 5.1. There are other fields that are not present in the
table but are available in the RRLP specification. The measure position request is
sent to the MS to initiate a location calculation or to request that it provides mea-
surements back to the SMLC. It contains the positioning instructions and may
include assistance data for GPS and/or GANSS.
The measure position response message is sent by the MS to the SMLC in
response to a measure position request and it contains the results of the location
attempt. It may contain a location, an error, or a request for additional assistance
data. Table 5.2 shows the important fields from the measure position response mes-
sage. The measure position response must contain one of the IEs containing mea-
surement data or location information.
If the measure position response contains an error, then the SMLC may send
another measure position request with additional assistance data.
The assistance data message includes assistance data for calculating the location
of the MS or for returning the measurements to the SMLC. The important fields are
shown in Table 5.3. It is initiated on the SMLC and sent to the MS. It is subject to
the RRLP pseudosegmentation and the more assistance data to be sent IE will be set
to true if this is not the last segment of this message. The MS responds to each assis-
tance data message with an assistance data acknowledgment message. The assis-
tance data component contains no information but serves to indicate to the SMLC
that the segment has been received.
The positioning capability request can be sent from the SMLC to the MS to
request the capability of the handset, the assistance data types supported, and any
assistance data types that are required. The MS responds with a positioning capabil-
ity response that details each GANSS that it supports and each assistance data type.
It may also optionally indicate the assistance data that it requires to perform a
location.
The protocol error message is sent from the MS to the SMLC to indicate that
there is a problem with the request that it just sent. The protocol error message con-
tains an error code that indicates the problem to the SMLC.
The ASN.1 provides a way of defining the elements of the messages that make
up the protocol. The ASN.1 allows the protocol to be described in terms of mes-
sages, components, and elements. Table 5.4 shows some of the primary constructs
98 Assisted-GPS Location Within a Network
of ASN.1 notation and how they are encoded using ASN.1 PER. Examples are
shown using the RRLP ASN.1 definitions. Further details can be found in [19, 20].
Items within each component in the ASN.1 notation include a list of
subcomponents, some of which may be optional and some of which may be exten-
sions. Extensions are components that have been added through revisions of the
original RRLP specification. The first version of RRLP did not have any extensions.
The ASN.1 includes an ellipsis (…) to indicate that the subsequent components are
extensions.
An extract from the RRLP specification [1] that describes the RRLP message
format is shown here:
PDU ::= SEQUENCE {
referenceNumber INTEGER (0..7),
component RRLP-Component
}
RRLP-Component ::= CHOICE {
msrPositionReq MsrPosition-Req,
msrPositionRsp MsrPosition-Rsp,
5.3 RRLP 99
assistanceData AssistanceData,
assistanceDataAck NULL,
protocolError ProtocolError,
...,
posCapabilityReq PosCapability-Req,
100 Assisted-GPS Location Within a Network
posCapabilityRsp PosCapability-Rsp
}
The ASN.1 shows that the RRLP protocol is made up of a SEQUENCE (an
ordered list) of two items; they are the referenceNumber and the component. The
first item on each line of the notation is the name of the item and the name on the
right is the data type. For example, the first item of the SEQUENCE is the
referenceNumber, which is an INTEGER from 0 to 7. The second item is compo-
nent, which is an RRLP-Component. In a simple analogy to a software programming
language, the first item is the variable and the second is the type.
To encode the RRLP message, the first item (PDU) is a SEQUENCE of two
items and it has no optional components or extension marker. This means that it
does not require any bit mask or extension bit. The first bits encoded will be the
referenceNumber, which is a number from 0 to 7. This number fits into 3 bits,
which is less than one octet (see the description for INTEGER in Table 5.4), so it is
encoded as a minimum-size bit field of 3 bits.
The next item to include is the RRLP-Component, which is specified as a
CHOICE, and has an extension marker. This means that the next bit encoded is the
extension marker, which indicates whether the choice is one of the components
before the marker or is in one of the extension components that is after the exten-
sion marker. After that, the choice is encoded as an index that starts from 0. In the
example above, 0 corresponds to the measure position request, 1 corresponds to
measure position response, and so forth. If the chosen alternative is one of the com-
ponents in the root (one of the components before the extension marker), then the
choice is encoded as an integer.
Consider, for example, encoding the first byte of a measure position request
message as ASN.1 PER as shown in Figure 5.2. The reference number IE field is set
to 1 and occupies the first 3 bits. The extension bit is required because there is an
extension bit in the definition, but it is set to 0 since the measure position request is
not one of the extensions (the measure position request is in the root). The choice is
then encoded as an integer in the minimum number of bits to allow the selection of
one of the five choices, which is 3 bits. The measure position request is the first ele-
ment in the choice, which corresponds to index 0, so that is put into the choice field.
The ASN.1 notation for the measure position request component from [1] is
shown here.
— Measurement Position request component
MsrPosition-Req ::= SEQUENCE {
positionInstruct PositionInstruct,
referenceAssistData ReferenceAssistData OPTIONAL,
msrAssistData MsrAssistData OPTIONAL,
0 0 1 0 0 0 0 0
MSB LSB
Extension bit
Figure 5.2 referenceNumber and RRLP-Component fields for a measure position request.
5.3 RRLP 101
—
MethodType ::= CHOICE {
msAssisted AccuracyOpt, — accuracy is optional
msBased Accuracy, — accuracy is mandatory
msBasedPref Accuracy, — accuracy is mandatory
msAssistedPref Accuracy — accuracy is mandatory
}
— The values of this field are defined in 3GPP TS 23.032 (Uncertainty code)
Accuracy ::= INTEGER (0..127)
— Position Method
PositionMethod ::= ENUMERATED {
eotd (0),
gps (1),
gpsOrEOTD (2)
}
— useMultiple Sets
UseMultipleSets ::= ENUMERATED {
multipleSets (0), — multiple sets are allowed
oneSet (1) — sending of multiple is not allowed
}
0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0 1 1 0 1 1
MSB LSB
Accuracy Optional
Method Type Position Measure Multiple
Method Response sets
Time
Position Instructions
RRLP -Component Measure Position Request
(
r = C (1 + x ) − 1
K
) (5.1)
where C and x are constants: C is 10 and x is 0.1. K is the accuracy code that is
encoded into 7 bits in the message. Rearranging the equation, the accuracy code is
given by (5.2). Note that some resolution in the number is lost when encoding it, so
the value that the receiver decodes will be different to the value encoded by the
sender.
⎛r ⎞
ln ⎜ + 1⎟
⎝C ⎠
K= (5.2)
ln(1 + x )
where ln is the natural logarithm (base e), although any logarithm could be used as
long as it is the same in both the numerator and the denominator. To encode accu-
racy in meters to an accuracy code, (5.2) is used. To decode accuracy code to accu-
racy in meters, (5.1) is used.
The positioning method is the next field in the position instructions elements.
The positioning method is an ENUMERATED type that can take on the values 0, 1,
or 2. In the example it is set to 1 for GPS. The measure response time is an
INTEGER from 0 to 7, which means that it requires 3 bits.
The response time is 2N where N is the value of this field. The example is set to
5, which represents 32 seconds. Equation (5.3) shows how to calculate N, given a
response time in seconds.
ln( responseTime)
N= (5.3)
ln(2 )
104 Assisted-GPS Location Within a Network
The use multiple sets element is an enumerated type that indicates whether to
use one set or multiple sets and occupies 1 bit. The example is encoded to use one
set.
The example message from Figure 5.3 is shown next in a different representa-
tion. It is the output of a text-based message decode tool. More example RRLP mes-
sages are provided in Appendix D. Note that the uncertainty on the request is not
really encoded, as the number shown rather reflects the resolution of the process to
encode and decode the value.
RRLP
0000 001——- Reference Number: 1
—-0—— Extension: false
——000- Measure Position Request
———-0 20 Extension: false
Options:
0001 0———- Reference Assist Data: false
-0——— MSR Assist Data: false
—0——- System Info Assist Data: false
—-0—— GPS Assist Data: false
——0—- Extension Container: false
Position Instructions
Options:
——-0— EnvironmentCharacter: false
Method Type
———00 00 Choice: MS Assisted
Options:
0002 1———- Accuracy: true
Accuracy
-0010100 94 Uncertainty: 57.2749994933 meters
Position Method:
0003 01——— GPS
Measurement Response Time:
—101—- MeasureResponseTime: 5
Use Multiple Sets:
——-1— One set
———00 6C
RrlpMessage
MeasurePositionRequest MeasurePositionResponse
byte array, which is decoded into the instance and returns the Java primitive
boolean to indicate success or failure of the decode.
In this section we will consider the encode() and decode() methods of the mea-
sure position request message. The encode() method of the MeasurePositonRequest
class is shown next and described at a high level in its Javadoc in lines 1–9. Note that
the line numbers are not part of the code but are shown here in order to reference
them in this text.
The MeasurePositionRequest.encode() method is shown here:
1. /**
2. * This method encodes a measure position request from this instance. It creates a binary
3. * message in ASN.1 PER in a byte buffer. It uses the contents of the member variables to
4. * encode the elements. <br>
5. * Note that the encode does not encode the Extended Reference ID.
6. *
7. * @param the byte buffer to encode the message into.
8. *
9. * @return the number of bits in the byte buffer.
10. */
11. public int encode(byte[] messageBuffer)
12. {
13. //Call the super method to encode the RRLP message header
14. int bitOffset = super.encode(messageBuffer);
15.
16. //The start of the Measure Position Request component
17.
18. //The LSB of the first byte is the extension bit and since we are not using the
extensions
19. //then we just leave that as 0.
20. bitOffset++;
21.
22. //The sequence bitmask for the 5 optional fields.
23. //They are for eotd except for one for gps assist data
24. //but we arent sending that in the measure position request
25. bitOffset += MeasurePositionRequest.MEASURE_POS_OPTIONAL_BITMASK_LENGTH;
26.
27. //Now we are on to the Positioning Instructions sequence
28.
29. //1 bit describing whether the optional environment parameter is present
30. //We arent including this parameter so it stays as 0 in the buffer and we skip over it
31. bitOffset++;
32.
33. //The positioning method type
34. bitOffset = Utility.putBits(this.methodType, messageBuffer, bitOffset,
35. MeasurePositionRequest.METHOD_TYPE_LENGTH);
36.
37. //If methodType is MS assisted, the accuracy is optional so we need to set the bit to
38. //indicate that we are specifying the accuracy
39. if(this.methodType == MeasurePositionRequest.METHOD_MS_ASSISTED)
106 Assisted-GPS Location Within a Network
40. {
41. bitOffset = Utility.putBits(1, messageBuffer, bitOffset, 1);
42. }
43.
44. //Calculate the code for the accuracy
45. int accuracyCode = this.encodeUncertainty(this.requestedAccuracyMeters);
46.
47. //Put the accuracy code into the buffer
48. bitOffset = Utility.putBits(accuracyCode, messageBuffer, bitOffset,
49. MeasurePositionRequest.ACCURACY_CODE_LENGTH);
50.
51. //Put the position method into the buffer
52. bitOffset = Utility.putBits(this.positionMethod, messageBuffer, bitOffset,
53. MeasurePositionRequest.POSITION_METHOD_LENGTH);
54.
55. //Response time = 2^N, so N = ln (respTime)/ln (2)
56. int responseTimeCode = 0;
57. if (this.responseTime > 0)
58. {
59. responseTimeCode = (int)Math.floor(Math.log(this.responseTime)/Math.log(2));
60. }
61.
62. //Put the response time into the buffer
63. bitOffset = Utility.putBits(responseTimeCode, messageBuffer, bitOffset,
64. MeasurePositionRequest.RESPONSE_TIME_LENGTH);
65.
66. //Put the indicator whether to use multiple sets
67. bitOffset = Utility.putBits(this.useMultipleSets, messageBuffer, bitOffset,
68. MeasurePositionRequest.MULTIPLE_SETS_LENGTH);
69.
70. return bitOffset;
71. }
The first thing that this method does is create the header bits and that is done by
the super class, so we call the encode() method of the super class (RrlpMessage) to
do that (line 14). The encode() method in the super class creates the first 7 bits of
data which is common to all of the RRLP messages. This includes the reference
number ID, the extension bit, and the choice field, which indicates the message that
is being encoded. The encode() method returns the bitOffset, which is the offset in
bits of the next bit for data to be added into the byte buffer. At this point in the
method, the bitOffset will be 7.
The RrlpMessage.encode() method is shown here:
1. /**
2. * This method creates the header for encoding an RRLP message. The header is 7 bits.
3. * It is the following format from MSB to LSB:<br>
4. * referenceNumber INTEGER(0..7) -> 3 bits<br>
5. * RRLP-Component extension marker -> 1 bit<br>
6. * RRLP-Component choice -> 3 bits<br>
7. * <br>
8. * Note that this implementation does not support the position capability request and
response because
9. * we are not setting the extension marker. It is being set to 0.
10. *
11. * @param buffer the buffer to put the RRLP header into.
12. *
13. * @return the bit offset of the next bit to go into the buffer.
14. */
15. protected int encode(byte[] buffer)
16. {
17. //The first field is the reference Number IE and it goes in at bitOffset 0 for a length of
REF_ID_LENGTH
18. int bitOffset = Utility.putBits(this.referenceNumberIE, buffer, 0,
RrlpMessage.REF_ID_LENGTH);
19.
20. //We are not supporting the extension messages so we’ll leave that as 0 for now
21. bitOffset++;
22.
23. //The next field is the RRLP component choice which is the message
24. bitOffset = Utility.putBits(this.rrlpComponentChoice, buffer, bitOffset,
RrlpMessage.CHOICE_LENGTH);
25.
5.3 RRLP 107
The first thing that the RrlpMessage.encode() does is encode the reference num-
ber IE into the start of the buffer (line 18). The referenceNumberIE is put into the
buffer starting at index 0 for a length defined by the constant
RrlpMessage.REF_ID_LENGTH. The REF_ID_LENGTH is the length of the ref-
erence ID field and the definition is shown next. It is declared to be private since it is
only used within this class, final so that it can not be modified once it is initialized,
and static so that it is only created once in memory and not for each instance of the
class.
/** The length of the reference id field in bits. */
protected static final int REF_ID_LENGTH = 3;
The format of the message being encoded is based on the ASN.1 definition spec-
ified in the previous section. The sample code does not support the RRLP messages
after the extension, so this bit it left as 0 and the bit offset is incremented to skip over
the field in the buffer (line 21). Note that this method assumes that the buffer is
zero-filled otherwise we would need to put the 0 into the buffer. Finally, the choice
is inserted into the buffer and the bit offset is returned to the calling method (lines 24
and 26).
Returning to the MeasurePositionRequest.encode() method shown previously,
refer to the ASN.1 in the previous section as well as Figure 5.2. Consider the com-
ment on line 16 in the code where we are up to the start of the measure position
request component. Since the sample code is relatively limited and does not support
any extensions or optional fields, then we skip over them as shown in lines 20 and
25. We now get to the only mandatory field (as defined in the ASN.1) of the
MsrPosition-Req component, which is the PositionInstruct element. The
108 Assisted-GPS Location Within a Network
PositionInstruct sequence contains several mandatory fields and one optional field
(environmentCharacter). We are not including the optional field, so we leave the
optional bit as 0 and skip forward to the next bit (line 31). The methodType is a rel-
atively straightforward CHOICE and is a 2-bit number that indicates the type of the
positioning requested. The field following the methodType is the Accuracy. The
only exception is if the methodType is MS-assisted, in which case the Accuracy is
optional because it is defined by the element AccuracyOpt. As shown in lines
39–42, if the methodType is MS-assisted, the optional bit is inserted and set to 1
(line 41) to indicate that the Accuracy field is included. A more complete implemen-
tation for MS-assisted would be to check if the requestedAccuracyMeters is a valid
number and if the optional bit would be set to 1 and the accuracy encoded.
The rest of the encode method involves encoding the remaining position
instructions fields and using (5.2) and (5.3) to calculate the accuracy and response
time codes.
The MeasurePositionRequest.decode() method is shown next. It is passed a byte
buffer and returns a Java primitive boolean, which indicates whether the message
was successfully decoded.
1. /**
2. * This method decodes a Measure Position Request into this instance.
3. *
4. * @param message the rrlp message in a byte buffer.
5. *
6. * @return whether the message was successfully decoded.
7. */
8. public boolean decode(byte[] message)
9. {
10. if(!super.decode(message))
11. {
12. return false;
13. }
14.
15. //Measure Position Request component
16.
17. //Set the bit offset to be after the header
18. int bitOffset = RrlpMessage.OFFSET_AFTER_HEADER;
19.
20. //get the measure position request extension and check that it is 0. Otherwise we don’t
support it.
21. int extension = (int)Utility.getBits(message,
bitOffset++,RrlpMessage.EXTENSION_BIT_LENGTH);
22. if(extension != 0)
23. {
24. return false;
25. }
26.
27. //Get the optional bit mask.
28. int options = (int)Utility.getBits(message, bitOffset,
29. MeasurePositionRequest.MEASURE_POS_OPTIONAL_BITMASK_LENGTH);
30. bitOffset += MeasurePositionRequest.MEASURE_POS_OPTIONAL_BITMASK_LENGTH;
31.
32. //This code does not support any of the options
33. if(options > 0)
34. {
35. return false;
36. }
37.
38. //Position Instructions element
39.
40. //Get the position instructions option flag we don’t support options it needs to be 0
41. int option = (int)Utility.getBits(message, bitOffset++, 1);
42. if(option != 0)
43. {
44. return false;
45. }
46.
47. //Method Type element.
48. this.methodType = (byte)Utility.getBits(message, bitOffset,
5.3 RRLP 109
MeasurePositionRequest.POSITION_METHOD_LENGTH);
49. bitOffset += MeasurePositionRequest.POSITION_METHOD_LENGTH;
50.
51. //Accuracy is read for all method types except for method type 0 (MS-Assisted) where it
is optional
52. byte readAccuracy = 1;
53.
54. //If the method type is MS-assisted then we read the option which is set to 1 if accuracy
is included
55. if(this.methodType == MeasurePositionRequest.METHOD_MS_ASSISTED)
56. {
57. readAccuracy = (byte)Utility.getBits(message, bitOffset++, 1);
58. }
59.
60. //If accuracy is included then read the accuracy
61. this.requestedAccuracyMeters = 0;
62. int accuracyCode = 0;
63. if(readAccuracy == 1)
64. {
65. accuracyCode = (byte)Utility.getBits(message, bitOffset,
MeasurePositionRequest.ACCURACY_CODE_LENGTH);
66. bitOffset += MeasurePositionRequest.ACCURACY_CODE_LENGTH;
67. this.requestedAccuracyMeters = this.decodeUncertainty (accuracyCode);
68. }
69.
70. //The position method
71. this.positionMethod = (int)Utility.getBits(message, bitOffset,
MeasurePositionRequest.POSITION_METHOD_LENGTH);
72. bitOffset += MeasurePositionRequest.POSITION_METHOD_LENGTH;
73.
74. //The response time
75. int responseTimeCode = (int)Utility.getBits(message, bitOffset,
MeasurePositionRequest.RESPONSE_TIME_LENGTH);
76. bitOffset += MeasurePositionRequest.RESPONSE_TIME_LENGTH;
77. this.responseTime = (int)Math.pow(2, responseTimeCode); //respTime = 2^N
78.
79. //use multiple sets
80. this.useMultipleSets = (byte)Utility.getBits(message, bitOffset,
MeasurePositionRequest.MULTIPLE_SETS_LENGTH);
81. bitOffset += MeasurePositionRequest.MULTIPLE_SETS_LENGTH;
82.
83. return true;
84. }
You can see that the decode method is longer than the encode method because it
is checking for the presence of options and choices and making decisions based on
them. In addition, it is keeping track of the bit offset. The decode() method makes
use of the Utility.getBits() method to extract the bit fields from the byte array. The
getBits() method returns the data extracted from the byte array as a long and that
data type is then cast to the required data type of the result. One important thing to
note is that the decode() method needs to maintain and keep track of the bit offset in
the buffer. This is due to the implementation of the getBits() method, which does
not return the bitOffset (like the putBits() method) because it is returning the con-
tents of the requested bit field from the encoded message. You can see in the code
that after each call to the getBits() method, there is a line to bump the bitOffset
along to the end of the field that has just been extracted.
The decode() method starts by calling the super class (RrlpMessage) to encode
the header bits that are common to all RRLP messages (line 10). If the super class
cannot decode the header fields, then an unsuccessful result is returned (line 12). It
then sets up the bitOffset to be at the offset after the header bits, as defined by the
constant that is in the RrlpMessage class (line 18). Referring to the ASN.1 descrip-
tion and Figure 5.2, the first bit after the header is the extension bit and we use the
Utility.getBits() method to extract that bit out of the byte array (line 21). The sam-
ple code does not support any extensions, so if the extension bit is set, we return an
unsuccessful result (lines 22–25). We similarly check the bit mask for the optional
110 Assisted-GPS Location Within a Network
bits, and if any of the bits are set, then this sample code does not decode them, so an
unsuccessful result is returned (line 35). We are now onto the position instructions
element and similarly check the option bit mask (line 42).
The rest of the fields are decoded sequentially except for the position method
where we check if it is MS-assisted (line 55) and, if so, read the option bit to deter-
mine whether or not we need to read the accuracy.
A test case that tests the RrlpMessage.encode() method is shown next. It creates
an instance of ConcreteRrlpMessage and is then able to call the encode() method of
the RrlpMessage class.
/** Validate that the header is encoded ok for ref 1 seq 1. */
public void testMessageHeaderEncodeRef1Seq1()
{
byte[] message = new byte[1];
ConcreteRrlpMessage rrlpMsg = new ConcreteRrlpMessage(1, (byte)1);
int offset = rrlpMsg.encode(message);
56. }
57. catch(IOException ioe)
58. {
59. System.err.println(“Caught exception while processing data e:” + ioe);
60. }
61. catch(InterruptedException ie) // this is thrown by the sleep
62. {
63. System.err.println(“Interrupted during the sleep e:” + ie);
64. }
65. }
The other part of the client/server pair is the client. The RrlpClient.run()
method is shown here:
9. /**
10. * Run the rrlp client.
11. */
12. public void run()
13. {
14. Socket socket = null;
15. DataOutputStream out = null;
16. DataInputStream in = null;
17.
18. System.out.println(“RrlpClient.run connecting to server...”);
19. try
20. {
21. socket = new Socket(“localhost”, this.portNumber);
22. out = new DataOutputStream(socket.getOutputStream());
23. in = new DataInputStream(socket.getInputStream());
24. }
25. catch (UnknownHostException e)
26. {
27. System.err.println(“Dont know about host: localhost e: ” + e);
28. return;
29. }
30. catch (IOException e)
31. {
32. System.err.println(“Couldn’t get I/O for the connection ” + e);
33. return;
34. }
35.
36. MeasurePositionRequest mpr = new MeasurePositionRequest();
37. byte[] data = new byte[RRLP_MESSAGE_BUFFER_SIZE];
38.
39. System.out.println(“RrlpClient.run connection established. waiting for data...”);
40. try
41. {
42. int noBytes = in.read(data);
43. while(noBytes > 0)
44. {
45. System.out.println(“Received byte data: ” + Utility.toHexString(data, noBytes));
46. if(mpr.decode(data))
47. {
48. System.out.println(“Decoded message:\n” + mpr);
49.
50. //Send it back to the server
51. out.write(data, 0, noBytes);
52. }
53. else
54. {
55. System.out.println(“Could not decode message”);
56. }
57. noBytes = in.read(data);
58. }
59.
60. out.close();
61. in.close();
62. socket.close();
63. }
64. catch(Exception e)
65. {
66. System.err.println(“Exception on the connection ” + e);
67. }
68. }
the while loop (line 43), which will continue until the number of bytes returned
from the stream is less than 0, which indicates that the connection has gone away.
The client calls the decode method (line 46) of the MeasurePositionRequest to
decode the message, and if it is successfully decoded, then it is written to standard
output (line 51).
To complete the sample code, the data is written back onto the connection to
the server (line 51) and then waits for the next message to arrive from the server (line
57). It is important to note that this class is hardcoded to expect and decode the
measure position request message, but other messages may arrive from a server that
is using the RRLP protocol.
In a UTRAN network, the handset is known as user equipment (UE). The Position
Calculation Application Part (PCAP) [2] Protocol is used to provide a UE with
GNSS assistance data or to perform the position calculation using measurement
made by the UE. The relevant entities of a UTRAN network are shown in Figure 5.5
along with the connections labeled with the protocols. PCAP is the protocol
between the SAS and the RNC and radio resource control (RRC) [3] is the protocol
between the radio network controller (RNC) and the UE.
The RRC protocol handles the control plane signaling between the UE and
other elements in a UTRAN network, performs connection management and
release, and handles the broadcast of system information, mobility procedures,
power control, and location determination. The PCAP protocol contains messages
for location determination only. Many of the location determination messages have
the same fields in PCAP as they do in RRC, so converting a message from RRC to
PCAP (and vice versa) in the RNC is relatively straightforward.
Historically, the RNC was the node in a UTRAN network that performed the
function of location determination in addition to the signaling and call handling. In
order to simplify the RNC, some of the functions were moved out of the RNC to a
new node called the SAS. Initially the RNC was responsible for coordinating the
location calculation and used the SAS to perform the A-GPS functions of providing
assistance data given a reference location or of performing the location calculation
given a set of GPS measurements. This mode of operation is known as RNC-centric
mode. In RNC-centric mode the RNC determines, initiates, and controls the posi-
tioning method to be used. Later, the overall control of the location determination
was moved out of the RNC to the SAS. This mode is called the SAS-centric mode of
operation where the SAS determines, initiates, and controls the positioning.
Radio
Stand alone network
PCAP RRC Node B RRC
SMLC (SAS) controller UE
(RNC)
RNC SAS
(a)
RNC SAS
(b)
Figure 5.6 (a, b) RNC-centric procedures.
exchange initiation response with the required assistance data types (or the
provisioned set of assistance data types). If the SAS cannot provide one or more of
the required assistance data types, then it responds with an information exchange
initiation failure with the cause IE set to indicate the reason for the failure. There are
several other messages associated with periodic reporting of assistance data for
RNC-centric operations that are described in detail in the PCAP specification.
In SAS-centric mode, the positioning is controlled by the SAS. The fundamental
message flow is shown in Figure 5.7. The RNC sends a position initiation request to
the SAS (A), which includes the capabilities of the UE, the approximate location,
and quality of position (QoP) requirements. The capabilities of the UE indicate
which GNSSs are supported by the UE, whether it supports UE-based or
UE-assisted modes of operation, and whether RTT is supported. The QoP require-
ments are the requested horizontal and vertical accuracy and the time available to
do the location. The approximate location can be geographic coordinates or an
identification of the cell.
If the SAS can satisfy the QoP using the location of the cell, then it will use that
as the location and send back a position initiation response (E). If the cell does not
satisfy the QoP, then the SAS will determine which positioning method to use and
send a position activation request (B) to the RNC. The position activation request
may contain assistance data. The RNC will return a position activation response (C)
to the SAS with the location or measurements to calculate the location. Alterna-
tively, it may contain a list of the assistance data required to complete the location.
The RNC may also send a position activation failure (D) with the cause IE set to
indicate the problem. If the position activation response (C) contains a list of
required assistance data, then the SAS may send another position activation request
to the RNC with the requested assistance data and receive a position activation
RNC SAS
response back. If the SAS receives measurements, then it can calculate the location
of the UE and provide that (or the UE-calculated location) back to the RNC in the
position initiation response (E). The position initiation response will also contain
the accuracy fulfillment indicator, which indicates whether the response meets the
requested QoP criteria. If, however, there is an error, then the SAS will send the
RNC a position initiation failure (F). Note that the SAS-centric procedure is subject
to a timer that is set based on the positioning response time IE that is in the position
initiation request message.
References
[1] 3GPP TS 44.031 Third Generation Partnership Project; Technical Specification Group
GSM/EDGE Radio Access Network; Location Services (LCS); Mobile Station (MS)—Serv-
ing Mobile Location Center (SMLC) Radio Resource LCS Protocol (RRLP), 2009.
[2] 3GPP TS 25.453 Third Generation Partnership Project; Technical Specification Group
Radio Access Network; UTRAN Iupc Interface Positioning Calculation Application Part
(PCAP) Signaling, 2009.
[3] 3GPP TS 25.331 Third Generation Partnership Project; Technical Specification Group
Radio Access Network; Radio Resource Control (RRC); Protocol Specification, 2009.
[4] 3GPP2 C.S0022/TIA IS-801, Position Determination Service Standard for Dual Mode
Spread Spectrum Systems, 2004.
[5] 3GPP TS 23.271 Third Generation Partnership Project; Technical Specification Group Ser-
vices and System Aspects; Functional Stage 2 Description of Location Services (LCS), 2009.
[6] 3GPP2 X.S0002/TIA PN-4747 (IS-881) Third Generation Partnership Project; MAP Loca-
tion Services Enhancements, 2002.
[7] 3GPP TS 43.059 Third Generation Partnership Project; Technical Specification Group
GSM/EDGE Radio Access Network; Functional Stage 2 Description of Location Services
(LCS) in GERAN, 2008.
[8] 3GPP TS 25.305 Third Generation Partnership Project; Technical Specification Group
Radio Access Network; Stage 2 Functional Specification of User Equipment (UE) Position-
ing in UTRAN, 2008.
[9] Secure User Plane Location Architecture, Open Mobile Alliance, OMA-AD-SUPL, 2009.
[10] Dawson, M., J. Winterbottom, and M. Thomson, IP Location, New York:
McGraw-Hill/Osborne Media, 2006.
[11] TIA/EIA/IS-TIA/EIA/J-STD-036-A-A—Enhanced Wireless 9-1-1 Phase 2, March 2002.
[12] NENA, NENA Standard for the Implementation of the Wireless Emergency Service Proto-
col E2 Interface, 2003.
[13] Canadian Radio—Television and Telecommunications Commission, Wireless E9-1-1
Phase 2 Stage 1 Technical Specification Recommendation, 2009.
[14] 3GPP TS 49.031, Third Generation Partnership Project; Technical Specification Group
GSM/EDGE Radio Access Network; Location Services (LCS); Base Station System Appli-
cation Part LCS Extension (BSSAP-LE), 2008.
[15] European Space Agency/Galileo Joint Undertaking, Galileo Open Service, Signal In Space
Interface Control Document, OS SIS ICD, 2008.
5.5 Software Projects 119
[16] Japan Aerospace Exploration Agency, Quasi-Zenith Satellite System Navigation Service,
Interface Specification for QZSS (IS-QZSS), 2008.
[17] GPS Navstar Joint Program Office, Navstar GPS Space Segment/Navigation User Inter-
faces, Interface Specification, IS-GPS-200, Navstar GPS Joint Program Office, El Segundo,
CA, 2009.
[18] 3GPP TS 23.032 Third Generation Partnership Project; Technical Specification Group Ser-
vices and System Aspects; Universal Geographical Area Description (GAD), 2004.
[19] ITU-T X.680; Series X: Data Networks and Open System Communications; OSI Network-
ing and System Aspects—Abstract Notation One (ASN.1); Information Technol-
ogy—Abstract Syntax Notation One (ASN.1): Specification of Basic Notation, 2008.
[20] ITU-T X.691; Series X: Data Networks and Open System Communications; OSI Network-
ing and System Aspects—Abstract Notation One (ASN.1); ASN.1 Encoding Rules—Speci-
fication of Packed Encoding Rules (PER), 1999.
CHAPTER 6
Position Calculation
The GPS satellites transmit a ranging code that ultimately allows the handset to
determine the distance between the satellite and the handset. When combined with
measurements from other satellites, knowledge of the location of each satellite, and
application of error correction, the location of the handset can be calculated.
When the handset is A-GPS enabled and connected to a network, the position
calculation may be performed on the handset or the server. When running in hand-
set-assisted mode, the A-GPS server provides the handset with a compact set of
assistance data (normally reference time and acquisition assistance) and the handset
locks onto the satellites and returns the measurements to the server. This allows the
position calculation to be performed on the server that has more processing power
and can optionally include other measurements that have been made by the network
to calculate a hybrid location.
This chapter discusses the position calculation with particular reference to it
being performed on the server. It introduces the mathematical theory at a high level,
and the models used for the calculations and discusses the implementation with the
source code and object model. It is done from the perspective of a walk-through of
the Java code that accompanies this book with a worked example position
calculation.
For handset-based A-GPS, the encoding of the measurements depends on the proto-
col that delivers the measurements. Table 6.1 shows the measurements that the
handset returns to the server. It returns the GPS time and the remaining fields are
returned for each satellite measured by the handset.
The location of the handset can be calculated using the code phase measure-
ments (whole chips and fractional chips) or using the Doppler measurements. The
other measurements that the handset makes provide information about the quality
of the measurements that the handset has made. Those quality measurements are
the carrier-to-noise ratio (C/N0), the multipath indicator, and the pseudorange RMS
error.
The location of the handset can be calculated using either the code phase or the
Doppler shift measurements made by the handset. A code phase based calculation
for a given set of measurements may calculate the location within a few meters
where a Doppler-based calculation will calculate an inferior location that will be
within several thousand meters.
121
122 Position Calculation
The code phase calculation will generally be successful if the initial location is
within 100 kilometers and there are sufficient GPS measurements. When the hand-
set is in a cellular network, the initial location comes from the location of the cell
tower. For a stand-alone GPS, the location may be cached from previous location
fixes.
The alternative to knowing the initial location is to initially perform a Doppler
shift-based position calculation to determine the seed location, followed by a code
phase-based position calculation to determine the more accurate location.
In this chapter we initially discuss the code phase-based position calculation
and work through an example with real data from a GPS reference station. The
Doppler shift-based location and the use of hybrid measurements are discussed.
The position calculation steps described next are required in order to calculate the
location of the handset. There are some optional steps that may improve the accu-
racy of a location, but these may result in a position calculation failure if not applied
carefully (decrease the yield). When considering which optimizations to include in
the position calculation process, two important factors need to be weighed:
accuracy and yield.
Accuracy is the distance of a calculated location from the ground truth. Yield is
an indication of whether a location is successful or not and is often expressed as a
statistical measure of the percentage of successful position calculations over time.
They are somewhat mutually exclusive goals. For example, achieving the highest
possible accuracy means that sometimes a satellite may be pruned (or dropped)
from the calculation process due to it having a high measurement error; however,
the position calculation may ultimately fail if the remaining satellites do not allow
the position calculation function to converge on a solution. Similarly, achieving a
higher yield may require the inclusion of measurements to satellites that have a high
measurement error and the result may be less accurate than it could have been by
removing the satellite from the calculation.
6.3 Positioning Using GPS Code Phase Measurements 123
In Chapter 3, GPS and A-GPS were introduced along with the geometric model of
receiver positioning (Section 3.13). Geometrically, the problem involves determin-
ing the point of intersection of spheres. The centers of the spheres are the location of
the satellites and the radius of the spheres are the respective measured ranges to the
satellites. The point of intersection is the location of the handset.
The GPS ranging signals that are measured by the handset allow calculation of
the range to the satellites. These range measurements, however, are corrupted by
the offset of the handset and the offset of the satellite clock from GPS time and are
hence referred to as pseudorange measurements. Note that the measurements are
also corrupted by measurement errors, but these are insignificant compared to the
clock offsets. The equations shown in this section are based on the description in
[1].
Consider Figure 6.1, which shows a three-dimensional coordinate frame. Our
ultimate goal is to determine the location of the handset (or the user) u (xu, yu, zu),
and we do this in the WGS 84 ECEF coordinate system. The location of the satellite
s (xs, ys, zs) is also shown and is separated from the user by the range vector r.
The magnitude of the vector r is given by
r = s−u (6.1)
(xs − x u ) + (ys − yu ) + (z s − z u )
2 2 2
r= (6.2)
s (x s , y s , zs )
zs
u (x u ,y u ,zu)
ys
xs
y
zu
xu
yu
x
Figure 6.1 User and satellite model.
r = c(t − t SV ) (6.3)
where c is the speed of light, t is the time of signal reception by the handset, and tSV is
the time of transmission of the signal from the satellite.
As noted earlier, the clocks onboard the satellite and receiver are not synchro-
nized with each other and the clocks on the satellites are not synchronized to the
clocks on the other satellites. Each satellite has a free running clock, which is gener-
ally offset from the GPS system time. This satellite clock offset ΔtSV, however, can be
calculated using the information from the broadcast NAV message. The receiver
clock offset tu is recovered by solving for it in the position calculation process by
using redundant satellite measurements.
The pseudorange (ρ) can be defined based on (6.3) with the clock error terms
introduced as shown in (6.4) from [1].
[
ρ = c (t + t u ) − (t SV + Δt SV ) ]
= ct + ct u − ct SV − cΔt SV (6.4)
= c(t − t SV ) + c(t u − Δt SV )
where t is the time of receipt by the handset, tu is the handset clock error, tSV is the
time on the satellite, and ΔtSV is the satellite clock error. Substituting r back into
(6.4), and ignoring the satellite clock error since it can be calculated using broadcast
information, the pseudorange can be defined as shown in
ρ = r + ct u (6.5)
6.3 Positioning Using GPS Code Phase Measurements 125
Substituting the expression for the geometric range from u to s from (6.2) into
(6.5), the result is
(xx − x u ) + ( y s − y u ) + ( z s − z u ) + ct u
2 2 2
ρ= (6.6)
Since ρ is measured, the location of the satellite can be calculated (xs, ys, zs) from
the ephemeris and c is a constant, and we have an equation with four unknowns.
These unknowns are the three coordinates of the handset (xu, yu, zu) and the handset
clock error (tu). The nonlinear equations can be solved when the handset makes
measurements to at least four satellites, that is, four nonlinear equations to solve for
four unknowns.
As described in [2], the measurements can be combined into a set of normal
equations as shown in (6.7).
Δρ = HΔx + ε (6.7)
where Δρ is the difference between the predicted and actual measurement, H is the
geometry matrix, Δx is the error in the last estimated location and error in the esti-
mated handset clock error, and ε is the residual error. The contents of each element
of Δρ when there are four satellite measurements are shown in
⎡
⎢
(ρ 1
) (
− Δt 1SV × c − r 1 + t r × c ⎤
⎥
)
⎢ (ρ 2
− Δt SV2
) (
× c − r2 + tr × c ⎥ )
Δρ = ⎢ ⎥ (6.8)
⎢
⎢
(ρ 3
− Δt SV
3
) (
× c − r3 + tr × c ⎥
⎥
)
⎢
⎣ (ρ 4
− Δt SV
4
) (
× c − r4 + tr × c ⎥
⎦ )
where ρ is the measured pseudorange to satellite n, ΔtSVn is satellite clock error for
n
satellite n, c is the speed of light, rn is the calculated range to satellite n from the cur-
rent estimate location, and tr is the handset clock offset. H is frequently referred to
as the geometry matrix (it is referred to as G in [2]). The contents of H are shown in
⎡ x 1s − x u y1s − y u ⎤
z 1s − z u
⎢− 1
− 1
− c ⎥ 1
⎢ r r r ⎥
⎢ x s2 − x u y s2 − y u z s2 − z u ⎥
⎢− r2
−
r2
−
r2
c⎥
H=⎢ ⎥ (6.9)
⎢ x s3 − x u y s3 − y u z s3 − z u ⎥
⎢− r3
−
r3
−
r3
c⎥
⎢ ⎥
⎢ x s4 − x u y s4 − y u z s4 − z u ⎥
⎢⎣− r
−
r4
−
r4
c⎥
⎦
where (x sn , y sn , z sn ) is the coordinate of satellite n, (xu, yu, zu) is the last estimated
coordinate of the user, and rn is the range from the estimated location to satellite n.
As shown in (6.10), Δx is the estimate of the error in the present location and the
error in the handset clock error.
126 Position Calculation
⎡Δx u ⎤
⎢Δy ⎥
Δx = ⎢ u ⎥ (6.10)
⎢Δz u ⎥
⎢Δt ⎥
⎣ u⎦
( )
−1
x$ = H T WH H T WΔρ (6.11)
where x$ is the estimate of the change to apply to x and W is the weight matrix. The
weight matrix W is generally satellite elevation dependent, which means that satel-
lites at higher elevations are given a higher weight; this also accounts for measure-
ment errors. The implementation of the least squares solution is discussed later in
this chapter.
Generally, the process of calculating the handset location consists of prepro-
cessing the data and then performing the least squares process by iteratively refining
the solution to (6.11). At each iteration, the H, W, and Δρ matrices are recalculated
since the estimate x of the user location has been updated.
The next section describes the preparation of the data and that is followed by
the position calculation in Section 6.3.15.
• Check health of the satellites and prune measurements that are from
unhealthy satellites or are from satellites for which we do not have the
ephemeris.
• Calculate the pseudoranges to use for the measurements given the code
phases.
• Calculate the location of each satellite at the measurement’s time of transmis-
sion.
• Calculate the satellite clock correction for each satellite.
• Adjust the clock correction for the satellites group delay.
• Apply the geometric range correction to each satellite location.
• Prune bad satellite measurements.
• Prune satellites based on their elevation.
• Check and prune satellites based on their measured SNR and RMS error.
• Correct measurements for ionosphere propagation.
• Correct measurements for troposphere propagation.
• Solve the equations to determine the location of the handset.
• Perform location integrity checking.
6.3 Positioning Using GPS Code Phase Measurements 127
These steps are outlined in the following sections with the code that implements
the algorithm. The GpsPositionCalculation Java class contains the code to calcu-
late the location given a set of GPS measurements, the ephemeris, an initial loca-
tion estimate, and the current ionosphere model. The class, using the
GpsPositionCalculation, instantiates it and calls the calculatePosition() method
with the appropriate parameters. Note that the initial location will often come from
the location of the cell tower. The calculatePosition() method makes a series of
method calls to the methods described in the following sections to set up the infor-
mation required to solve the equations to determine the location of the handset.
The code is not exhaustive and is simplified for ease of understanding. No
optimizations have been applied to the code such as memory pooling or precalculat-
ing intermediate calculations that are made several times during the process. There
is limited error checking. If an error occurs during the position calculation, then no
error code is set. Some of the steps have been simplified or implemented as stubs
only. In addition, no quality measure or uncertainty of the location is returned to
the calling method. These are parts of the implementation that have been left as an
exercise for the reader (see Section 6.6).
There is a batch job called PosCalc.bat in the batch directory that runs the posi-
tion calculation for all of the records in a RINEX file. It has command line parame-
ters that indicate the file name of the RINEX observation file (containing the GPS
measurements), the file name of the RINEX navigation file (containing the
ephemeris), and an initial location estimate. It runs a position calculation for each
measurement in the file and outputs statistics of the yield and accuracy.
• Latitude: 25.73280998;
• Longitude: −80.16017092;
• Altitude: −16.1466.
The worked example is run each time that the package is built from the source
code. This is because it is a test case in the method
GpsPositionCalculationTest.testPositionCalculationCh6WorkedExample(). The
test method uses methods in the RinexObsFile and RinexNavFile classes to read in
the RINEX navigation and observation files, respectively. The
testPositionCalculationCh6WorkedExample() method sets up the data for the posi-
tion calculation by using the RinexNavFile.getSatInfo() method to get the
ephemeris for all of the satellites at the given time (March 16, 2009, at time
0:00:0.00). It uses the RinexObsFile.getMeasurement() method to get the first GPS
measurement from the observation file and it sets up an initial location estimate.
The initial location estimate is about 5,000 meters from the ground truth location.
An initial estimate will normally be within the range of 0 to 20,000 meters from the
ground truth depending on how it is determined. For example, in a cellular network
it will depend on the size of the cell.
The initial location is set to:
The method first uses a bit mask to check if the MSB of the 6 bit field is set by
isolating that bit with the bitmask 0×20 (or 0010 0000) (line 14). If the bit is not set,
then the satellite is completely healthy, so we return true. Otherwise, we pull out the
five LSBs (line 23) to check if the error code is one that does not affect L1 (lines
26–27). If it does not affect L1, then we return that the satellite is healthy (line 29);
otherwise, we fall through to line 31 and return false.
Code in the GpsPositionCalculation class calls this method for each of the mea-
sured satellites. If a satellite fails the health test, then it should be excluded from the
position calculation.
Note that for A-GPS, it is not expected that a handset would make a measure-
ment to a satellite that is not healthy. This is because the LS does not provide assis-
130 Position Calculation
tance data to a handset for a satellite that is not healthy. In addition, the server
provides a list of the bad satellites to the handset using the real-time integrity (RTI)
assistance data type as discussed in Chapter 4. It is possible, however, that a handset
has cached information about a satellite that has gone bad and may choose to
ignore the RTI information, or alternatively the satellite health has changed in the
time between when assistance data was sent to the handset and the response was
received on the LS. Regardless, it is worth checking the health of the satellite
because handsets in the field have been shown to occasionally provide measure-
ments to satellites that have a bad health indicator. If measurements from satellites
that are bad are included in the position calculation, the location may fail or a less
accurate location may be calculated.
ρ
t SV = t − (6.12)
c
where tSV is the time that the satellite transmitted the signal in seconds from the start
of the week, t is the time that the measurement was made by the handset, ρ is the
measured pseudorange to the satellite, and c is the speed of light. The Satel-
lite.calculateSatelliteLocation() method (discussed in Chapter 3) is called to calcu-
late the location of the satellite at that time and it returns an instance of a
Wgs84Coordinate for each satellite. The location calculated for the satellites for the
worked example are shown here as x, y, z ECEF coordinates.
PRN: 32 satLocation: -11501772.43 -11195805.97 21600295.49
PRN: 31 satLocation: -1452139.21 -19791493.85 17799129.73
PRN: 14 satLocation: 13580826.41 -14259715.37 17887352.18
PRN: 16 satLocation: 60483.65 -23829334.95 -11422170.12
PRN: 30 satLocation: 16300474.85 -8989815.78 18552206.96
PRN: 22 satLocation: 11669760.39 -23488115.02 -3820602.87
14.
15. // Calculate the Relativity time correction as specified in the spec
16. double deltaTr = Satellite.F * this.e * this.sqrtA * Math.sin(ek);
17.
18. // Calculate the clock correction and add the relativity time correction
19. double dtsv = this.af0 + (this.af1 * tk) + (this.af2 * (tk * tk)) + deltaTr;
20.
21. return dtsv;
22. }
The satellite clock corrections for the worked example are shown here:
PRN: 32 satClockCorrectionSec: -0.00028607
PRN: 31 satClockCorrectionSec: 0.00005484
132 Position Calculation
( Δt sv ) L1 = Δt sv − TGD (6.13)
These are added to the satellite clock correction and the overall satellite clock
correction in seconds and meters that include the group delay differential becomes:
PRN: 32 satClockCorrectionSec: -0.00028607 satClockCorrMeters: -85760.25882810
PRN: 31 satClockCorrectionSec: 0.00005485 satClockCorrMeters: 16444.73363056
PRN: 14 satClockCorrectionSec: 0.00014041 satClockCorrMeters: 42093.99616495
PRN: 16 satClockCorrectionSec: -0.00006730 satClockCorrMeters: -20175.28541734
PRN: 30 satClockCorrectionSec: -0.00013264 satClockCorrMeters: -39764.21938552
PRN: 22 satClockCorrectionSec: -0.00020341 satClockCorrMeters: -60979.78075286
X S′ = R z Ω e(
& Δt X
S ) (6.14)
where Rz is the rotation matrix about the z axis, Ω& is the rotation rate of the Earth
e
(and hence the rotation of the ECEF CRF), Δt is the time for the signal to travel to
the Earth, XS is the uncorrected location of the satellite, and XS′ is the corrected sat-
ellite location. Equation (6.15) is the expanded form of the rotation matrix with the
signal travel time and Earth rotation rate terms included.
6.3 Positioning Using GPS Code Phase Measurements 133
& Δt
⎡ cos Ω & Δt 0⎤
sin Ω
e e
Rz (
& Δt = ⎢− sin Ω
Ω e )
⎢
& Δt
e
& Δt 0⎥
cos Ω e ⎥
(6.15)
⎢⎣ 1 1 1⎥⎦
z′ = z
The equivalent Java code from the GpsPositionCalculation class is shown here:
1. /**
2. * This method applies geometric range correction to a satellite location. This is the
correction
3. * for the rotation of the earth.
4. *
5. * @param satLocation the location of the satellite to apply the correction for.
6. * @param satSignalPropagationTimeSec this is the signal propagation time for the
measurement
7. * from the satellite to the handset in seconds.
8. */
9. public void applyGeometricRangeCorrection(Wgs84Coordinate satLocation,
10. double satSignalPropagationTimeSec)
11. {
12. double omegaDeltatT = Satellite.OMEGA_EARTHS_ROTATION_RATE_RADIANS_PER_SECOND *
13. satSignalPropagationTimeSec;
14.
15. double newX = Math.cos(omegaDeltatT) * satLocation.getX() + Math.sin(omegaDeltatT)*
satLocation.getY();
16. double newY = -1 * Math.sin(omegaDeltatT) * satLocation.getX() + Math.cos(omegaDeltatT)*
satLocation.getY();
17.
18. satLocation.setEcef(newX, newY, satLocation.getZ());
19. }
As seen above, the correction in the location is in the vicinity of 100 meters.
Note that if this correction is not applied, the locations calculated will be in error.
For the RINEX sample data set from Miami 3, the average distance of locations
from the ground truth is 2.5 meters, but that average is over 33 meters if geometric
range correction is not applied.
134 Position Calculation
r= x 2 + y2 + z 2 (6.17)
where (x, y, z) is the coordinate of the estimated location. The accuracy of the result
produced by this method will be reduced when the initial estimate of the altitude dif-
fers significantly from the altitude of the handset.
Note that since the pseudomeasurement is a direct measurement, it is not sub-
ject to the handset clock offset like a GPS measurement is; when populating the H
matrix, the last column is set to 0.
An alternative to using the altitude in the initial location estimate is to use a digi-
tal elevation model (DEM) of the terrain. The DEM is an accurate model of the
Earth’s surface and provides the ground height for a given latitude and longitude.
culating the elevation of the satellites that have been measured and removing mea-
surements that are from satellites that are too low on the horizon from the
perspective of the initial location. The satellite elevation mask may be configured,
that is, passed in to the position calculation class, or hardcoded to be a constant 5°.
The size of the elevation mask needs to be considered carefully during system test-
ing. Also consider that satellite measurements should only be pruned if there are
redundant measurements, that is, more than four satellite measurements.
The reason that low-elevation satellites are considered for removal is that they
suffer the most from both ionosphere delay and multipath effects. Due to the low
elevation, the signal from the satellite has much more ionosphere to travel through
than a satellite that is directly overhead, for example. This means that there is more
uncertainty in the measurement. Similarly, the signals are more likely to suffer from
multipath or NLOS effects from objects on the surface of the Earth such as buildings
and natural features.
Whether to prune a satellite needs to be considered carefully because even
though the low elevation satellites may have more measurement error, they can also
significantly affect the DOP.
Once the locations of the satellites have been calculated, the elevation is calcu-
lated as the elevation between two instances of the Wgs84Location class by calling
its elevation() method. The elevation of the satellites for the worked example is
shown here:
PRN: 32 elevation: 28.60
PRN: 31 elevation: 64.03
PRN: 14 elevation: 48.64
PRN: 16 elevation: 25.32
PRN: 30 elevation: 33.09
PRN: 22 elevation: 42.18
5.
6. //phi is limited so it is set to the boundary value if it is outside the range
7. if (phi > +0.416)
8. {
9. phi = +0.416;
10. }
11. if (phi < -0.416)
12. {
13. phi = -0.416;
14. }
15.
16. double lambdaI = Satellite.radsToSemiCircles (Math.toRadians(longitudeDegrees)) +
17. (psi * Math.sin(azimuthRadians)/Math.cos(Satellite.semiCirclesToRadians(phi)));
The ionosphere corrections applied to the satellites measured for the example
are shown next in meters. The corrections are quite small for that particular time. In
addition, none of the satellites are low on the horizon, which would require a larger
correction.
PRN: 32 ionoCorrection: 4.29
PRN: 31 ionoCorrection: 2.50
PRN: 14 ionoCorrection: 2.73
PRN: 16 ionoCorrection: 4.94
PRN: 30 ionoCorrection: 3.34
PRN: 22 ionoCorrection: 3.26
2.312 0084
.
d = + (6.18)
−1
sin θ + 194
2
. x 10 sin θ + 06854
2
. x 10 −3
where θ is the elevation of the satellite from the estimated location in radians. The
tropospheric corrections for the satellites in the example are shown here:
PRN: 32 tropoCorrection: 4.99
PRN: 31 tropoCorrection: 2.66
PRN: 14 tropoCorrection: 3.19
PRN: 16 tropoCorrection: 5.58
PRN: 30 tropoCorrection: 4.38
PRN: 22 tropoCorrection: 3.56
The class diagram for the troposphere classes are shown in Figure 6.2. The
TroposphereModel class is an abstract class which means that it cannot be
instantiated; only its subclasses can be instantiated. It contains one abstract method,
getTroposphereDelay(). An abstract method is one that all of the subclasses must
implement. Figure 6.2 shows that there is presently only one troposphere model
class: the Hopfield model. It implements getTroposphereDelay().
138 Position Calculation
TroposphereModel
HopfieldTroposphereModel
The GPS position calculation class is shown in Figure 6.3. The position calcula-
tion class has an instance of a TroposphereModel as shown. This will actually be a
subclass of the TroposphereModel.
x = x 0 + x$ (6.19)
poscalc::GpsPositionCalculation 1 1 TroposphereModel
-tropo : TroposphereModel
+calculatePosition() : Wgs84Coordinate +getTroposphereDelay(in elevation : double) : double
4. {
5. //Calculate the location
6.
7. //call the method to perform the preprocessing
8. Wgs84Coordinate[] satelliteLocations = performPosCalcPreprocessing(measure-
ment,ephemeris,
9. initialLocation, iono);
10. if(satelliteLocations == null)
11. {
12. return null;
13. }
14.
15. //Now lets set up the matrices.
16.
17. //x is the estimate of the location. it is initialized to the initial location and is
updated
18. //each time we go through the iteration loop
19. Matrix x = new Matrix(4,1);
20. x.setElement(0, 0, initialLocation.getX());
21. x.setElement(1, 0, initialLocation.getY());
22. x.setElement(2, 0, initialLocation.getZ());
23. x.setElement(3, 0, 0);
24. //System.out.println(“x: ” + x);
25.
26. //Some variables that are used inside the loop
27. int numberOfIterations = 0;
28.
29. Wgs84Coordinate estimatedPresentLocation = new Wgs84Coordinate();
30. estimatedPresentLocation.setEcef(initialLocation.getX(),initialLocation.getY(),
initialLocation.getZ());
31.
32. //Set up some of the matrices used inside the loop. It is probably not that efficient
33. //to be allocating all of this memory each time this method is invoked so memory
34. //pooling or another mechanism would be better for high throughput applications
35.
36. //H s the geometry matrix
37. Matrix H = null;
38. //p is the delta p matrix
39. Matrix p = null;
40. //xHat is the change to apply to the x matrix
41. Matrix xHat = null;
42. //The residuals
43. Matrix v = null;
44.
45. double variance;
46.
47. //This is the main interation loop
48. do
49. {
50. //Set up the H matrix which is the geometry matrix
51. H = this.setUpHmatrix(measurement, rangeMeasurements, satelliteLocations,
estimatedPresentLocation);
52.
53. Matrix W = this.setUpWmatrix(measurement, rangeMeasurements, satelliteLocations,
estimatedPresentLocation);
54.
55. //Set up the delat p matrix
56. p = this.setUpPmatrix(measurement, rangeMeasurements, satelliteLocations, x,
estimatedPresentLocation);
57.
58. //calculate the new estimate of x = (HtWH)^-1 * HtWP
59.
60. Matrix Ht = H.transpose();
61. Matrix HtW = Ht.multiply(W);
62. Matrix HtWH = HtW.multiply(H);
63. Matrix HtWHinv = HtWH.invert();
64. if(HtWHinv == null)
65. {
66. return null;
67. }
68.
69. Matrix HtWHinvHt = HtWHinv.multiply(Ht);
70. Matrix HtWHinvHtW = HtWHinvHt.multiply(W);
71. xHat = HtWHinvHtW.multiply(p);
72.
73. //xHat is the estimate change this time through the loop now add it to the estimate
74. x = xHat.add(x);
75.
76. //Put this into the WGS 84 coordinate object
140 Position Calculation
0
Considering the example data, x is set to the initial location provided in Section
6.3.2 with the estimated clock error set to 0; this is shown next. This Matrix
instance is initialized in lines 16–19 of the calculatePosition() method.
⎡ 983,04658
. ⎤
⎢−5,662,32388. ⎥
x0 =⎢ ⎥
⎢ 2,756,97422
. ⎥
⎢ ⎥
⎣ 00
. ⎦
The code declares some variables and then enters the main iteration loop on line
48. It then calls the setUpHmatrix() method to set up the H matrix. In order to com-
plete the matrix, we first calculate the range from the estimated location x0 to satel-
lite n using (6.2). The satellite coordinates for the worked example are shown in
Section 6.3.4. The ranges to each satellite are calculated and are shown here:
1
r : 23271479.32
2
r: 20780526.90
3
r: 21483641.96
4
r: 23063820.33
5
r: 22252736.49
6
r: 21799741.86
The geometry matrix H is then calculated using (6.9) and is shown next with the
example data. Note that compared to (6.9), this instance of H has six rows since
there are measurements to six satellites.
⎡− −11501772.43 − 983046.58 −
. + 566232388
1119580597 .
−
21600295.49 − 2756974.22
2.99792458 × 10 8 ⎤
⎢ 23271479.32 23271479.32 23271479.32 ⎥
⎢ −142139.21 − 983046.58 . + 566232388
1979149385 . 17799129.73 − 2756974.22 ⎥
⎢ − − − 2.99792458 × 10 8 ⎥
2078052690
⎢ 13580826 . 2078052690. 2078052690
.
.41 − 983046.58 −14259715.37 + 566232388
. 17887352.18 − 2756974.22 ⎥
⎢ − − − 2.99792458 × 10 8 ⎥
H=⎢ 2148364196. 2148364196
. 2148364196. ⎥
⎢ − 60483.65 − 983046.58 −
−23829334.95 + 5662323.88
−
−11422170.12 − 2756974.22
2.99792458 × 10 8 ⎥
⎢ 23063820.33 23063820.33 23063820.33 ⎥
⎢ 16300474.85 − 983046.58 −898981578
. + 566232388
. . − 2756974.22
1855220696 ⎥
⎢ − − − 2.99792458 × 10 8 ⎥
22252736.49 22252736.49 22252736.49
⎢ 11669760.39 − 983046.58 −23488115.02 + 566232388
. −3820602.87 − 2756974.22 ⎥
⎢− − − 2.99792458 × 10 8 ⎥
⎣ 2179974186. 2179974186
. 2179974186. ⎦
and the resulting H matrix for the first iteration is shown as the output of the fol-
lowing Matrix.toString() method. Note that the H matrix is recalculated each itera-
tion as the location is refined.
6.3 Positioning Using GPS Code Phase Measurements 141
The code to calculate H is shown next. The setUpHMatrix() method sets up the
matrix and returns it. The matrix is allocated on line 13 with the number of rows to
be the number of measurements and four columns. The method then loops through
and calculates the row for each measurement. On line 16 it calculates the range
from the estimated location of the handset to the satellite and then fills in the rest of
the elements of the H matrix.
1. /**
2. * This method sets up the H matrix and returns it.
3. *
4. * @param measurement the measurement from the satellites.
5. * @param satelliteLoc the location of the satellites.
6. * @param handsetLocEstimate the estimated location of the handset.
7. *
8. * @return the H matrix.
9. */
10. private Matrix setUpHmatrix(GpsMeasurement measurement, Wgs84Coordinate[] satelliteLoc,
11. Wgs84Coordinate handsetLocEstimate)
12. {
13. Matrix H = new Matrix(measurement.getNumSatsMeasured(), 4);
14. for (int i = 0; i < measurement.getNumSatsMeasured(); i++)
15. {
16. double satRange = handsetLocEstimate.distanceTo (satelliteLoc[i]);
17. H.setElement(i, 0, -1 * (satelliteLoc[i].getX() -
handsetLocEstimate.getX())/satRange);
18. H.setElement(i, 1, -1 * (satelliteLoc[i].getY() -
handsetLocEstimate.getY())/satRange);
19. H.setElement(i, 2, -1 * (satelliteLoc[i].getZ() -
handsetLocEstimate.getZ())/satRange);
20. H.setElement(i, 3, Satellite.C_SPEED_OF_LIGHT);
21. }
22. return H;
23. }
The weight matrix W is updated each time through the loop in the
setUpWMatrix() method. Its values from the first iteration are shown here:
W: Matrix size: (6, 6)
0.4787 0.0 0.0 0.0 0.0 0.0
0.0 0.8990 0.0 0.0 0.0 0.0
0.0 0.0 0.7506 0.0 0.0 0.0
0.0 0.0 0.0 0.4276 0.0 0.0
0.0 0.0 0.0 0.0 0.5460 0.0
0.0 0.0 0.0 0.0 0.0 0.6715
The next matrix to set up is the Δρ matrix as defined by (6.8) and is shown next
with the sample data. Similar to the previous matrix, this one also has six rows
because there are six satellite measurements.
⎡(23,318,037.10 + 000028607
. × c ) − (23,271,47932
. + 00. × c) ⎤
⎢ ⎥
⎢(20,928,086.44 − 000005484
. × c ) − (20,780,52690 . × c) ⎥
. + 00
⎢(2165 . − 000014040
, 7,79322 . × c ) − (21,483,64196
. + 00. × c) ⎥
Δρ = ⎢ ⎥
⎢(23,168,462.59 + 000006731
. × c ) − (23,063,82033 . × c) ⎥
. + 00
⎢ ⎥
⎢(22,345,695.94 + 000013265
. × c ) − (22,252,736.49 + 00. × c )⎥
⎢ ⎥
⎣(21865
, . + 00
,20873 . 0020342 × c ) − (21799
, . × c) ⎦
. + 00
,74186
The code to calculate Δρ is shown next. It sets up the p matrix on line 12 and
goes through each satellite in the measurement. For each measurement, it calculates
out the result using (6.8).
1. /**
2. * This method sets up and returns the p matrix.
3. *
4. * @param measurement the satellite matrix
5. * @param satelliteLoc the location so the satellites
6. * @param x the current estimate of x.
7. * @param handsetLocEstimate the current estimate of the handsets location.
8. */
9. private Matrix setUpPmatrix(GpsMeasurement measurement, Wgs84Coordinate[] satelliteLoc,
Matrix x,
10. Wgs84Coordinate handsetLocEstimate)
11. {
12. Matrix p = new Matrix(measurement.getNumSatsMeasured(), 1);
13. for (int i = 0; i < measurement.getNumSatsMeasured(); i++)
14. {
15. double estimatedSatRange = handsetLocEstimate.distanceTo(satelliteLoc[i]);
16. SatGpsMeasurement satMeasurement = measurement.getSatelliteMeasurement(i);
17.
18. p.setElement(i, 0,
19. (satMeasurement.getCorrectedPseudorange() -
satMeasurement.getAssociatedSatClockErrorMeters()) -
20. (estimatedSatRange + (x.get(3, 0) * Satellite.C_SPEED_OF_LIGHT)));
21. }
6.3 Positioning Using GPS Code Phase Measurements 143
22. return p;
23. }
This distance between the calculated location and the ground truth reported for
the Miami 3 reference station is 4.97 meters. The clock error of the receiver is
0.000432 second, and the least squares process completed in two iterations.
6.3.15 Uncertainty
When considering any calculated location, it is very important to understand the
uncertainty and the confidence level of the uncertainty. The ellipse calculated by the
least squares process is related to the geometry of the satellites and the handset and
also the quality of the individual measurements that the handset makes. The
semimajor axis lies in the direction of the lowest precision (or highest deviation),
and the semiminor axis lies in the direction of the highest precision (lowest devia-
tion). A model of a horizontal error ellipse is shown in Figure 6.4. The ellipse is off-
set from North by the orientation defined by the angle β. The semimajor axis is in
the direction of the largest deviation σmax and the semiminor axis is in the direction
of σmin.
The error ellipse is calculated using the VCV matrix [8]. To calculate it, we cal-
culate the covariance matrix of the parameters as shown in
( )
−1
C x$ = H T WH (6.20)
C xlocal
$ = RC x$ R T (6.21)
σmax
σmin
where φ is the latitude and λ is the longitude. The resulting local covariance matrix
is given by
⎡ σ e2 σ en σ eh ⎤
C xlocal
$ = ⎢⎢σ ne σ 2
n σ nh ⎥⎥ (6.23)
⎢⎣σ he
2
σ 2
hn σ h2 ⎥⎦
The VCV is then calculated by multiplying the variance factor (discussed in Sec-
tion 6.3.16.2) by the covariance matrix. The altitude uncertainty is then calculated
at one standard deviation as the square root of the up element as shown in
altUncert = σ 2h (6.24)
The VCV for the two-dimensional horizontal error ellipse is calculated from the
2 × 2 submatrix of the covariance matrix starting from its upper left hand corner.
Thus, the VCV becomes that shown in
⎡σ2 σ en ⎤
VCV = ⎢ e (6.25)
⎣σ ne σ 2n ⎥⎦
1 ⎛ 2σ ⎞
β= tan −1 ⎜ 2 en 2 ⎟ (6.26)
2 ⎝σn − σe ⎠
1⎛ 2 2 ⎞
(σ ) + 4( σ en ) ⎟
2
semiMajor = ⎜σ e + σ n +
2 2
− σ 2n (6.27)
2⎝ ⎠
e
1⎛ 2 2 ⎞
(σ ) + 4( σ en ) ⎟
2
semiMinor = ⎜σ e + σ n −
2 2
− σ 2n (6.28)
2⎝ ⎠
e
For the worked example, the uncertainty is calculated as shown here. Note that
it is not scaled but is shown at the default confidence of 39.4%.
altUncert:10.088292696055293
orientation:6.913790565263772
semiMajor:3.8018920778395326
semiMinor:2.9511686165097015
6.3.16.1 Residuals
The residuals are a measure of how much the observations need to be adjusted to fit
the calculated location [8]. They are calculated as shown in
v$ = Hx + Δρ (6.29)
The position calculation sanity checks them by making sure that the sum of the
squared residuals (SSR) is less than a preconfigured maximum value. For the given
data, the SSR is 18.46.
146 Position Calculation
v$ T Wv$
vf = (6.30)
n −u
PDOP = C x$ 11 + C x$ 22 + C x$ 33
(6.31)
HDOP = C x$ 11 + C x$ 22
The PDOP and HDOP values for the example are shown here:
pdop: 3.59
hdop: 3.29
A GPS antenna in open-sky on the roof of our laboratory logs GPS measure-
ments on a regular basis. The statistics for the horizontal error (distance from
ground truth) for calculating a code phase-based location for all of the records for
one day are:
Total records: 155,043 average: 2.38 stdev: 1.52 minimum: 0.00 maximum: 24.68
Doppler shift occurs because the GPS signal travels at the speed of light and the
rate of change of the range between the satellite and the receiver stretches or com-
presses the wavelength that is effectively measured at the receiver. When a satellite is
approaching the receiver, the frequency will be increased slightly and when the sat-
ellite is receding, the frequency is reduced. We assume a stationary receiver and,
using the measured Doppler shift values from the satellites, can calculate a location.
The difference between a Doppler shift-based position calculation and a code
phase-based calculation is that for the code phase calculation, H and Δρ are sourced
from the position of the satellites and the measured code phases. Alternatively, for
the Doppler shift-based calculation, H and Δρ are sourced from the velocity of the
satellites and the measured Doppler shift. The complete Doppler shift-based posi-
tion calculation is outlined by Hill [9].
For the following description, I have kept the same notation as used for the code
phase-based position calculation. The geometry matrix H is set up as shown in
n n
where (vx, vy, vz) is the velocity of satellite n and ||s || is the norm of the location of
satellite n, s (xs, ys, zs)n.
The velocity of the satellite can be calculated using the formulas in [10]. The
velocity is calculated in the perifocal coordinate system (inertial) and then converted
back to the ECEF coordinate system. The polar equation of a conic is used to deter-
mine ρ (the semilatus rectum). A rearrangement of 1.5-4 from [10] is shown in
where r is the norm of the difference between the location of the satellite and the
handset as given in (6.2), e is the eccentricity from the satellite ephemeris, and v is
the true anomaly at epoch from the ephemeris. We can then use equation 2.5-4 from
[10] to derive (6.34), which gives the velocity with respect to the P and Q unit vec-
tors of the perifocal coordinate system.
148 Position Calculation
μ
vp = (i sin v)
ρ
(6.34)
μ
vq = ( e + cos v)
ρ
⎡v i ⎤ ⎡v p ⎤
⎢ ⎥ ~⎢ ⎥
⎢v j ⎥ = R ⎢v q ⎥ (6.35)
⎢⎣v k ⎥⎦ ⎢⎣v w ⎥⎦
⎡cos Ω cos ω − sin Ω sin ω cos i − cos Ω sin ω − sin Ω cos ω cos i sin Ω sin i ⎤
R = ⎢sin Ω cos ω + cos Ω sin ω cos i − sin Ω sin ω + cos Ω cos ω cos i − cos Ω sin i⎥ (6.36)
⎢ ⎥
⎢⎣ sin ω sin i cos ω sin i cos i ⎥⎦
where ω is the argument of perigee from the ephemeris, Ω is the longitude of the
ascending node which is calculated form the ephemeris, and i is the corrected incli-
nation which is also calculated from the ephemeris.
Combining (6.39) and (6.40), it is possible to multiply this out to determine an
expression for vi, vj, and vk. We are still in the geocentric equatorial reference frame
and vi, vj, and vk expanded are shown in
v i = ( cos Ω cos ω − sin Ω sin ω cos i)v p + ( − cos Ω sin ω − sin Ω cos ω cos i)v q + 0
v j = (sin Ω cos ω + cos Ω sin ω cos i)v p + ( − sin Ω sin ω + cos Ω cos ω cos i)v q + 0 (6.37)
v k = (sin ω sin i)v p + ( cos ω sin i)v q + 0
Note that the last term is 0 because vw is zero. Finally, we need to convert the
velocity back to the ECEF reference frame (vx, vy, vz) from the present inertial refer-
ence frame. This is given by
⎡v x ⎤ ⎡v i ⎤ ⎡− Ω & y⎤
⎢ ⎥ ⎢ ⎥ ⎢ & ⎥
⎢v y ⎥ = ⎢v j ⎥ − ⎢ Ωx ⎥ (6.38)
⎢v z ⎥ ⎢v ⎥ ⎢⎣ 0 ⎥⎦
⎣ ⎦ ⎣ k⎦
The Δx matrix has the same meaning as used for the code phase-based calcula-
tion as shown in (6.10). The significant difference is that it does not need to be
6.5 Hybrid Position Calculation 149
within 100 kilometers of the initial location and it is quite reasonable to set it to (0,
0, 0).
The matrix should probably be renamed, but I have left it with the same name
for consistency with the code phase least squares calculation. It is modified as
shown in
⎡ ΔF r1 ⎤
⎢ F c × r + s ⋅v +tu
1 1 1
(s 1
⎥)
−r
⎢ t ⎥
⎢ ΔF r2 ⎥
⎢
F
c × r 2 + s 2 ⋅ v2 + t u (s2 − r ⎥ )
Δρ = ⎢ 3 t ⎥ (6.39)
⎢ ΔF ⎥
⎢ r c × r 3 + s 3 ⋅ v3 + t u
⎢ Ft
( s3 − r ⎥
⎥
)
⎢ 4 ⎥
⎢ ΔF r c × r 4 + s 4 ⋅ v 4 + t u
( s4 − r ⎥ )
⎢⎣ Ft ⎥⎦
where ΔFrn is the measured Doppler shift for satellite n, Ft is the transmitted fre-
quency which is 1,575.42 MHz for GPS L1, rn is the range from satellite n to the
user as specified by (6.2), sn is the ECEF coordinates (x,y,z) of satellite n, vn is the x,
y, and z components of the velocity for satellite n, tu is the receiver clock error, and
||sn|| is the norm of the location of satellite n.
The least squares defined by (6.11) is then used to calculate the location of the
handset.
The position calculation discussed in the previous sections describes calculating the
position using GPS measurements only. There are many situations where a handset
may not be able to make measurements to at least four satellites. In these situations,
it is helpful to include range measurements from other sources. The primary differ-
ence between range measurements and GPS measurements is that they are not sub-
ject to the clock offset against GPS time. When range measurements are available,
they are included in the calculation by modifying the H matrix so that the fourth
column is 0. This is set to 0 because the measurement is not subject to clock error.
Hybrid position calculation is discussed in detail in Chapter 8.
1. The position calculation code does not prune any measurements when it
determines that they are bad (for example, from an unhealthy satellite or a
low-elevation satellite), it just aborts the calculation. Enhance the code so
that it has a mechanism to prune measurements from unhealthy satellites.
One way to do it may be to mark the satellite measurement as being invalid
150 Position Calculation
and then check whether the measurement is valid before putting into the
matrices for the least squares process.
2. The SatelliteGpsMeasurement.calculateApproximateSignalPropagationTime()
method over uses the Java Math.toRadians() and Math.toDegrees()
methods to do conversions to and from radians. Improve the method so that
it does any required conversions to radians up front and then works in
radians.
3. During the position calculation, some of the required information is
calculated multiple times, for example, the satellite elevations are calculated
in several places. Update the code so that the satellite elevations are captured
the first time that they are calculated so that the information can be reused.
4. Enhance the code to perform the position calculation using the code phase
measurements instead of the pseudoranges. When creating the GPS
measurement from the RINEX file, convert the pseudoranges to code phases
and then use that as input to the position calculation. The position
calculation will need to be modified to solve the millisecond ambiguity
problem.
5. The Satellite.calculateEccentricAnomaly method does not handle the case
where the iterative solution does not converge. Update the code so that this
case is handled correctly.
6. Add some additional troposphere models. They should extend the
TroposphereModel abstract class. Modify the GpsPositionCalculation class
so that it is passed in an instance of the troposphere model and uses that one
for the position calculation. Compare the accuracy of some of the different
models.
7. The GpsPositionCalculation.calculatePosition() method contains the code
to perform the calculate the location of the handset and return the result. It
calculates a lot of other information such as PDOP and the SSR. Enhance the
code so that it returns an object that contains the important details about the
calculation.
8. Update the position calculation to be a two-step process. It should initially
perform a location calculation using the Doppler measurements in order to
determine the approximate location. It can then use that location as input to
the code phase calculation in order to determine an accurate location.
9. Implement the Doppler shift-based position calculation described in
Section 6.4.
References
[4] GPS Navstar Joint Program Office, Navstar GPS Space Segment/Navigation User Inter-
faces, Interface Specification, IS-GPS-200, Navstar GPS Joint Program Office, El Segundo,
CA, 2004.
[5] GPS Navstar Joint Program Office, Global Positioning System Standard Positioning Service
Signal Specification, 2nd ed., June 2005.
[6] Klobuchar, J. A., “Ionospheric Effects on GPS,” in Global Positioning System: Theory and
Applications, Vol. 1, B. Parkinson et al., (eds.), Washington, D.C.: American Institute of
Aeronautics and Astronautics, Inc. 1996.
[7] Spliker, J. J., “Tropospheric Effects on GPS,” in Global Positioning System: Theory and
Applications, Vol. 1, B. Parkinson et al., (eds.), Washington, D.C.: American Institute of
Aeronautics and Astronautics, Inc., 1996.
[8] Harvey, B. R., Practical Least Squares for Statistics and Surveyors, Monograph 13, Univer-
sity of New South Wales, School of Geomatic Engineering, 1998.
[9] Hill, J., 2001, “The Principle of a Snapshot Navigation Solution Based on Doppler Shift,”
Proceedings of ION GPS 2001, Salt Lake City, UT, September 11–14, 2001.
[10] Bate, R., D. Mueller, and J. E. White, Fundamentals of Astrodynamics, New York: Dover
Publications, 1971.
CHAPTER 7
A-GPS handsets have been shown to report time that is several seconds away from
the true GPS time. In addition, network vendors have reported that they have hand-
sets that may not know the GPS time well when operating in handset-assisted
A-GPS mode.
This is not a limitation of the handset, but is due to the way that hand-
set-assisted GPS works. In this mode, the handset generally requests the GPS acqui-
sition assistance and reference time assistance data types from the LS. The server is
synchronized to UTC time using an NTP server and can calculate accurately GPS
time using the UTC model. It then uses this time to calculate the acquisition assis-
tance data and also complete the reference time assistance data type. The hand-
set-assisted message flow was discussed in Chapter 5.
The handset may use the reference time to synchronize its clock. As mentioned
in Chapter 3, the LS will generally advance the time by a configured amount to
improve that accuracy of the reference time to the handsets in the network. There
will always be some variability in the network latency and the handset that synchro-
nizes its clock using the received reference time data type may be several seconds in
error from true GPS time. This time error is the clock offset between the server and
the handset.
When the handset receives the assistance data, it locks onto the satellites using
the acquisition assistance information and returns the measured code phases and
Doppler shift measurements to the LS. The measurements that the LS receives were
described in Chapters 5 and 6. When the LS receives the measurements from the
153
154 GPS Position Calculation with Time Recovery
Table 7.1 Position Calculation Accuracy for Different GPS Time Offset Values
Time Offset Distance from
Applied to Ground Truth in Distance from
Number Measured Time Meters (Average/ Ground Truth
of Satellites in Seconds Standard Deviations) in Meters 67%/95% Yield %
All visible 0 2.29/1.41 2.89/4.76 100.0
All visible 0.5 253.07/88.52 318.87/526.39 100.0
All visible 1 511.54/175.41 644.54/1,064 99.22
All visible 1.5 811.66/252.72 1,022.69/1,688.25 70.23
All visible 2 1,342.00/472.16 1,490.05/2,185.38 38.43
All visible 5 4,966.28/2,842.40 4,755.21/9,070.94 19.52
All visible 10 N/A N/A 0
8 0 2.58/2.15 3.25/5.37 100.0
8 0.5 253.59/87.89 319.52/527.47 100.0
8 1 530.83/221.27 668.85/1,104.13 99.86
8 1.5 852.56/333.18 1,074.23/1,773.32 70.50
8 2 1,273.65/435.84 1,455.02/1,956.28 38.99
8 5 4,153.86/855.50 4,409.81/5,035.61 3.41
8 10 N/A N/A 0
7 0 2.78/2.53 3.5/5.78 100.0
7 0.5 291.84/132.50 367.72/607.03 100.0
7 1 591.73/262.53 745.58/1,230.8 97.82
7 1.5 948.25/401.82 1,194.8/1,972.36 73.89
7 2 1,422.61/528.71 1,588.79/2,227.87 43.22
7 5 4,650.41/1,168.25 5,211.86/6,137.66 8.91
7 10 14,576.99/5,027.87 15,686.83/20,991.78 0.38
6 0 3.37/3.62 4.25/7.01 100.0
6 0.5 339.49/181.81 427.76/706.14 100.0
6 1 699.21/361.95 881/1454.36 94.39
6 1.5 1,122.79/572.13 1,414.72/2,335.4 71.79
6 2 1,574.74/710.52 1,751.51/2,650.04 56.77
6 5 4,767.80/1,776.79 5,284.06/7,199.38 17.36
6 10 10,759.19/2,700.84 11,074.06/16,797.30 6.53
5 0 4.72/7.12 5.95/9.82 99.78
5 0.5 435.50/337.79 548.73/905.84 99.79
5 1 900.49/677.78 1,134.62/1,873.02 91.69
5 1.5 1,382.59/987.48 1,742.06/2,875.79 79.10
5 2 1,842.83/1,242.08 1,940.79/3,605.00 69.19
5 5 4,991.21/2,891.41 5,230.67/9,002.57 38.53
5 10 11,186.99/6,113.45 11,103.05/20,016.51 24.76
Integrated time recovery alters the least squares process by adding an additional
unknown for which to solve. This additional unknown is the offset in time between
the server and the handset. It is called the recovery offset, or gross time error.
156 GPS Position Calculation with Time Recovery
Iterative time recovery consists of invoking the calculation at discrete time intervals
and choosing the result that minimizes the sum of the squared residuals (SSR) [1].
The SSR is a measure of the quality of the measurements used for the position calcu-
lation and was discussed in Chapter 6.
The position calculation is performed within a configured time window. For
example, if the handsets are known to be within 2 seconds of the GPS time, then the
position calculation is performed for the range of the measured time minus 2 sec-
onds to the measured time plus 2 seconds. The least squares process defined in
Chapter 6 is called repeatedly for different times and the results are stored and SSRs
are compared. The times are chosen within the specified time window relative to the
time reported in the GPS measurement.
Minimizing the SSR for any particular measurement produces a near optimal
result, provided that the granularity of times chosen to perform the position calcula-
tion are sufficiently small. Figure 7.1 shows the location error and the SSR for a typ-
ical GPS measurement over a 7-second time period (3.5 seconds on each side of the
measured time). The graphs in Figure 7.1 shows that the SSR follows a smooth
curve and the location error is minimized very close to the point where the SSR is at
a minimum.
The bracketing search implemented is loosely based on the numerical
minimization function in Chapter 10 of Press et al. [2]. The only assumption that
this search algorithm makes is that the curve is smooth with a single minimum. This
algorithm finds the minimum regardless of where the search space is relative to the
minimum (provided that the minimum is within the search space).
The initial bracketing starts with a coarse time search to find the earliest and lat-
est time where a location can be calculated within the overall search window. This
coarse search starts from each end of the supplied search window in order to find
the first time (relative to that end of the search window) where a successful location
is calculated. These initial “bracketed” end points are defined as a and c. The loca-
tion is then calculated at point b, which is halfway between a and c.
Two more position calculations are then performed for points d (halfway
between a and b) and e (halfway between b and c). If d is less than e, then the search
is recursively invoked using points a, d, and b as input. Alternatively, if d is greater
than e, the next recursive search is performed using points b, e, and c (these become
a, b, and c input to the next search). Alternatively, the points a, d, and b are input to
the next search. Figure 7.2(a) illustrates the selection of points a, b, c, d, and e.
The search is complete when the points a and b are sufficiently close to each
other in time as determined by a defined stop interval in seconds.
7.2 Iterative Time Recovery 157
Location error by time (search window is 3.5 seconds each side of measured)
1600
1400
1200
Error (meters)
1000
800
600
400
200
0
Time
(a)
1.60E+07
1.40E+07
1.20E+07
1.00E+07
SSR
8.00E+06
6.00E+06
4.00E+06
2.00E+06
0.00E+00
Time
(b)
Figure 7.1 (a, b) SSR and location accuracy over a 7-second period.
Figure 7.2 shows the three different cases that occur depending on where the
search window is. In Figure 7.2(a), the entire SSR curve is within the search win-
dow. In Figure 7.2(b) the search window occurs such that the minimum is included
within the curve, but it is very close to one end of the search window. This minimum
could be close to either end of the search window. In Figure 7.2(c) the search win-
dow does not include the true minimum, so the time bias estimation discussed in this
section will return the minimum that is within the search window.
The minimization is controlled by two parameters:
• The size of the time window to search each side of the measured time;
• The time resolution at which a and b are deemed to be sufficiently close in
time order to terminate the search.
158 GPS Position Calculation with Time Recovery
c
a
SSR
e
d
Time
(a)
e
SSR
a d
Time
(b)
e
SSR
b
d
a
Time
(c)
Figure 7.2 SSR minimization algorithm: (a) the entire curve is within the search window, (b) part
of the curve is within the search window, including the minima, and (c) part of the curve is within
the search window not including the minima.
The iterative time recovery is implemented in the Java example code. The
calcPositionIterativeTimeRecovery() method in the GpsPositionCalculation class is
called to perform the time recovery. It does the high-level processing of the time
recovery algorithm and calls the calculatePosition() method to calculate the loca-
tion of the handset for each given time. The search window size and the stop resolu-
tion are passed into the method and used by the bracketing search. A segment of the
7.2 Iterative Time Recovery 159
Once the early and late search is complete and the SSR is recorded for both, we
calculate the SSR for the midpoint and then invoke the recursive bracketing search.
This is shown in the following code fragment. The SSR is recorded at the midpoint
(line 7) and then the recursive bracketing search is invoked (line 10). The
doBracketingSearch() method first checks to see if the difference between the two
outside values of the search are sufficiently small and, if so, then the method returns
which breaks it out of the recursion. If the search is continuing, it then performs the
position calculation at the end points and recursively calls itself with the new search
boundaries.
1. //Calculate the middle time and the SSR at that time. Then invoke the recursive
2. //bracketing search which will converge in on the best location.
3. double middleTime = earliestSuccessTime + ((latestSuccessTime -
earliestSuccessTime)/2.0);
4.
5. theTime.set(originalWeek, middleTime);
6. result = this.calculatePosition(measurement, ephemeris, initialLocation, iono);
160 GPS Position Calculation with Time Recovery
Table 7.2 Position Calculation Accuracy Using the Iterative Time Recovery Algorithm
Time Distance from Average Number
Time Offset Ground Truth Distance of Discrete Position
Recovery Applied to Meters (Average/ from Ground Calculations
Number of Search Measured Standard Truth Meters Required to
Satellites Window Time Deviation) 67%/95% Yield % Minimize the SSR
All visible 1 0 2.47/2.72 3.11/5.14 100.0 24.00
All visible 1 0.5 2.47/2.72 3.11/5.14 100.0 24.29
All visible 2 0 2.37/1.54 2.99/4.93 100.0 27.48
All visible 2 0.5 2.38/1.54 3/4.95 100.0 27.66
All visible 2 1.0 2.37/1.53 2.99/4.93 100.0 28.28
All visible 2 1.5 2.39/1.55 3.01/4.97 100.0 28.47
All visible 10 1.5 2.41/1.67 3.04/5.01 100.0 58.39
8 1 0 3.08/3.62 3.88/6.41 100.0 24.00
8 1 0.5 2.99/3.37 3.77/6.22 100.0 24.33
8 2 0 2.80/2.86 3.53/5.82 100.0 27.38
8 2 0.5 2.67/2.46 3.36/5.55 100.0 27.55
8 2 1.0 2.70/2.48 3.4/5.62 100.0 28.22
8 2 1.5 2.70/2.52 3.4/5.62 100.0 28.39
8 10 1.5 2.60/2.12 3.28/5.41 100.0 59.34
7 1 0 3.98/5.50 5.01/8.28 100.0 24.00
7 1 0.5 3.77/4.84 4.75/7.84 100.0 24.33
7 2 0 3.35/3.75 4.22/6.97 100.0 27.34
7 2 0.5 3.34/3.62 4.21/6.95 100.0 27.55
7 2 1.0 3.35/3.67 4.22/6.97 100.0 28.21
7 2 1.5 3.29/3.40 4.15/6.84 100.0 28.38
7 10 1.5 3.95/4.43 4.98/8.22 100.0 59.34
6 1 0 7.15/17.30 9.01/14.87 100.0 24.00
6 1 0.5 7.04/15.37 8.87/14.64 100.0 24.33
6 2 0 6.34/17.27 7.99/13.19 100.0 27.38
6 2 0.5 6.31/18.58 7.95/13.12 100.0 27.58
6 2 1.0 6.46/21.22 8.14/13.44 100.0 28.20
6 2 1.5 5.96/13.89 7.51/12.4 100.0 28.39
6 10 1.5 7.10/13.27 8.95/14.77 100.0 59.34
5 1 0 30.63/112.52 38.59/63.71 99.77 24.00
5 1 0.5 29.30/108.33 36.92/60.94 99.84 24.32
5 2 0 32.22/144.42 40.6/67.02 99.83 27.42
5 2 0.5 32.74/176.77 41.25/68.1 99.83 27.60
5 2 1.0 29.30/149.19 36.92/60.94 99.84 28.22
5 2 1.5 28.37/171.03 35.75/59.01 99.82 28.43
5 10 1.5 42.58/338.01 53.65/88.57 99.78 58.99
from other transient processes running on the machine will be averaged out over a
long period of time. The calculations are performed for all satellites in view of the
receiver.
162 GPS Position Calculation with Time Recovery
A software tool records the total elapsed time in seconds to perform the position
calculations, and on completion divides it by the total number of calculations per-
formed. This is recorded in the table as the total number of transactions per second
(TPS).
The absolute numbers are not considered crucial in the analysis because they are
highly dependent on the platform and the implementation; however, the relative
performance effects are worthwhile to consider for analysis. The last column in the
table shows the ratio of the measured TPS rate to the measured TPS rate without
any time recovery processing as a percentage.
The software is running on a Sun Netra 210 running the Solaris operating sys-
tem. During the run, the CPU is operating at 100% of its capacity (0% idle).
The first row in the table shows the TPS when running without time recovery
enabled, which is 1,430.4 TPS. However, once the iterative time recovery is
enabled, there is a significant performance impact. The performance impact is
highly dependent on the size of the search window, since this affects the number of
iterations required.
As mentioned in Section 7.1, in the worst case, the handset timestamps the mea-
surements with the reference time that is provided by the LS [4]. A conservative esti-
mate of the time error when it reaches the handset might be 2 seconds. If the PCF is
configured to work with the 2-second time recovery search window on the host
7.3 Integrated Time Recovery 163
platform, it would be able to process 120.1 TPS, which is only 8.4% of the speed of
running without time recovery.
Such a large performance impact makes this solution difficult in situations
where the platform needs to achieve a high contracted throughput. For this applica-
tion, a more efficient time recovery algorithm is required. In Section 7.3, we con-
sider integrated time recovery as the alternative.
The integrated time recovery algorithm involves adding an additional term, the time
recovery offset or the gross time error, to the LS solution. In order to solve for
another unknown, we need to have at least five measurements instead of the mini-
mum of four required when the time is well known.
The aim is now to use the least squares described in Chapter 6 to solve for the
coordinates of the receiver in Earth-centered Earth-fixed (ECEF) reference frame
(xu, yu, zu), the receiver clock error (tu), and the gross time recovery error (tG). This
gross time recovery error can be in the range of seconds. As shown in (7.1), Δx is the
estimate of the present location and the handset clock error and now contains an
additional term for the gross time error (tG).
⎡x u ⎤
⎢y ⎥
⎢ u⎥
Δx = ⎢z u ⎥ (7.1)
⎢t ⎥
⎢ u ⎥
⎢⎣t G ⎥⎦
⎡ x 1s − x u y1s − y u ⎤
z 1s − z u
⎢− 1
− 1
− − 1 R& ⎥
1
⎢ r r r ⎥
⎢ x s − x u ys − yu z s − z u
2 2 2
⎥
⎢− 2
− 2
− 2
− 1 R& ⎥
H=⎢ r r r ⎥ (7.2)
⎢ x s3 − x u y s3 − y u z s3 − z u & ⎥
⎢− r 3
−
r 3
−
r 3
− 1R ⎥
⎢ ⎥
⎢ x s − x u ys − yu z s − z u
4 4 4
⎥
⎢⎣− − − − 1 R& ⎥
r4 r4 r4 ⎦
& is the range rate that is calculated as specified in equation 5 in [3] and is
where R
shown in
s−u
R& = ( v s − v u ) ⋅ +f +ε (7.3)
r
164 GPS Position Calculation with Time Recovery
where vs and vu are the three dimensional velocities of the satellite and the user,
respectively, s and u are the ECEF coordinates of the satellite and the user, respec-
tively (see Figure 6.1), r is given in (6.2), f is the receiver clock drift in meters per sec-
ond, and ε is the error.
The range rate is the rate of change of the range between the user and the satel-
lite. When performing the calculation, we have to assume that the user is stationary,
vu = (0, 0, 0), unless we have a way of retrieving that information. The range rate is
normally between 100 meters and 400 meters per second, but can be between 0 and
550 meters per second, either positive or negative.
Since the time error of the original measurement can be quite large, it is impor-
tant to recalculate the location of the satellites each time through the least squares
iteration loop. Section 7.3.1 shows that the integrated time recovery method is quite
accurate and has a good performance. It also has the significant advantage of not
needing to configure the time window over which to search, as is the case with
iterative time recovery.
References
[1] Syrjarinne, J., “Possibilities for GPS Time Recovery with GSM Network Assistance,” Pro-
ceedings ION GPS 2000, Salt Lake City, UT, 2000.
[2] Press, W. H., et al., Numerical Recipes in C: The Art of Scientific Computing, 3rd ed., New
York: Cambridge University Press, 2007.
[3] Glennon, E., “Solution of Timing Errors for AGPS,” Proceedings ION GPS 2005, 2005.
[4] Harper, N., et al., “Process for Improving GPS Acquisition Assistance Data and Server-Side
Location Determination for Cellular Networks,” Journal of Global Positioning Systems,
Vol. 3, No. 1-2, 2004.
CHAPTER 8
Hybrid Location
A-GPS works well when the handset is in an area where it can receive measurements
from four or more satellites with good geometry. However, the GPS signal does not
penetrate well into buildings and suffers in dense urban environments. In this situa-
tion, the handset may not be able to measure enough satellites to perform a position
calculation and will fall back to another location technology to determine the loca-
tion. The alternative is to make use of whatever GPS measurements are available
and combine them with other measurements. Combining measurements from mul-
tiple location technologies in order to calculate the location is known as hybrid
positioning.
This chapter discusses hybrid GPS and ranging measurements in order to calcu-
late a location where one would not otherwise be able to be calculated. It discusses
the algorithm and steps through the implementation. It then outlines a series of
experiments and results that use simulated range measurements to calculate a loca-
tion in order to demonstrate the advantages of making use of multiple measurement
types.
Generally, GPS performs well when the user’s environment allows the handset
to lock onto at least four satellites that are well distributed throughout the sky.
However, studies show that there are problems locking on to even the minimum
number of satellites in urban canyons [1]. Even when four satellites are available,
the distribution of satellites can be such that the resulting location is inaccurate. The
primary factors that affect a GPS location are the number of satellites measured and
the geometry of the satellites measured.
In these low-signal situations, additional ranging measurements are helpful,
particularly when the GPS receiver is built into a cell phone and there is an emer-
gency situation. An emergency situation is often a one-off cold-start location deter-
mination. In this chapter we are considering one-off position calculations and
excluding methods where multiple locations are integrated or filtered in order to
calculate a more accurate location.
When attempting a high-accuracy fix, the LS initially provides assistance data to the
wireless handset. In handset-assisted mode, the handset attempts to lock on to as
many satellites that it can within the time limit that has been specified by the LS and
returns whatever measurements it has to the LS. In the case where there are not
enough measurements to perform a position fix, the LS can use other measurements
from the network to perform a hybrid location. The other measurements may be
167
168 Hybrid Location
from sources such as the cellular network [for example, round-trip time (RTT) in a
UMTS network or timing advance (TA) in a GSM network], uplink WiFi, DTV, or
other signals.
There is a large amount of work on integrating GPS with other sensing inputs
such as Inertial Navigation Systems (INS), Loran C, and TDOA. There is a lot of
work on improving the quality of the location fixes by taking multiple measure-
ments as described in [2]. Integrating ranging measurements from DTV signals
shows significant promise [3].
This chapter contains the results of some tests where the position calculation is
run using a test data set in open sky. We then investigate the performance of the
hybrid position calculation using ideal range measurements (no error) and with
range measurements with different simulated inaccuracies. The inaccuracies are
simulated using a random process.
We then investigate the performance of the LS with different numbers of GPS
satellites and range measurements. The GPS measurements are sourced from the
open-sky measurements and are pruned down to a smaller number by randomly
selecting a given number of satellites to use. The range measurements are simulated
and are generated with different levels of error.
Note that the measurements discussed in this chapter are considered to be pure
range measurements and are not subject to their own clock errors. For example,
consider the case of hybrid location determination within a UTRAN network (dis-
cussed in Chapter 5). The range measurements are derived from round trip time
(RTT) measurements that are reported by the Node B (or base station) and the
receive-transmit delay that is reported by the handset (the UE). The RTT is mea-
sured in the Node B from the amount of time that a radio signal takes to propagate
from the Node B to the handset (the UE) and return. In addition, the handset reports
the receiver-transmit delay (Rx-Tx time difference) to the Node B. Both of these
measures are reported to the SAS for each Node B from which the RNC has mea-
surements. The SAS ultimately receives a PCAP message with this information. The
range from the Node B to the UE is then determined (in chips) as half of the differ-
ence between the RTT and the Rx-Tx difference. This is converted to a range based
on the chipping rate of the radio access. For example, FDD WDCMA uses a
chipping rate of 3.84 Mchps.
Range measurements are integrated into the model that was described in Chapter 6.
The range measurements are independent of GPS and hence are not subject to the
receiver or satellite clock errors. Figure 8.1 shows the model where a transmitter t at
range rt is included in the model.
The range from u to t is defined by (6.2) but substituting t for s. The least
squares process in Chapter 6 is used to calculate the location of the handset. The Δρ
matrix changes from that shown in (6.8) to that shown in (8.1). Equation (8.1) con-
tains three satellite measurements and one range measurement in the last row. The
difference between the range measurement and the satellite measurements is that
the clock error of the satellite and the handset does not need to be included. The
8.2 Hybrid Position Calculation 169
t (x t ,y t ,zt) s (x s , y s , zs )
rs
rt
zs
u (x u ,y u ,zu)
ys
xs
y
zu
xu
yu
x
Figure 8.1 User and satellite model.
(
⎡ ρ1 − Δt 1SV
⎢
) (
× c − r1 + t r × c ⎤
⎥
)
Δρ = ⎢
(
⎢ ρ 2 − Δt SV
2
) (
× c − r2 + tr × c ⎥
⎥
) (8.1)
⎢
(
⎢ ρ 3 − Δt SV
3
) (
× c − r3 + tr × c ⎥
⎥
)
⎢⎣ σ 1 − rt1 ⎥⎦
where the variables are the same as described for (6.8) except for rt1, which is the
range from the current estimate of the location to transmitter 1, and σ1 is the mea-
sured range to transmitter 1.
The H matrix changes from (6.9) to as shown in (8.2). Equation (8.2) contains
three satellites and one range measurement in the last row.
⎡ x 1s − x u y1s − y u ⎤ z 1s − z u
⎢− 1
− 1
c ⎥ − 1
⎢ r r r ⎥
⎢ x s − x u ys − yu z s − z u ⎥
2 2 2
⎢− r2
−
r2
−
r2
c⎥
H⎢ ⎥ (8.2)
⎢ x s3 − x u y s3 − y u z s3 − z u ⎥
⎢− r3
−
r3
−
r3
c⎥
⎢ ⎥
⎢ x t1 − x u yt1 − y u z t1 − z u ⎥
⎢⎣− r4
−
r4
−
r4
c ⎥
⎦
170 Hybrid Location
where the variables are the same as described for (6.9) except xt, yt, and zt, which are
the coordinates of the transmitter. Note that the fourth column of the last row con-
tains a 0.
Obtaining a location in an urban canyon can be a significant problem. This is
because the signals are low power and do not penetrate obstacles such as buildings.
The QZSS system is presently under consideration [4] as an augmentation to GPS.
The orbital configurations of the QZSS satellites are such that there will be more
satellites at higher elevations in Japanese cities such as Tokyo. This will allow users
to be able to detect more satellites and get a more accurate location fix.
For the Java implementation, the range measurements (transmitter location and
range) are stored in an instance of a RangeMeasurement object and the individ-
ual RangeMeasurement instances are stored in a RangeMeasurementSet object,
which is just a container for the collection of range measurements.
An instance of the RangeMeasurementSet object is passed into the
GpsPositionCalculation.calculatePosition() method. The class diagram for the
range measurement objects is shown in Figure 8.2.
The methods to set up the H and Δρ matrixes were discussed in Chapter 6. They
are enhanced so that they can include the range measurement information in the cal-
culation. The setUpPmatrix() method is shown next. The range measurement set is
now passed into the method. It is checked in line 5 to determine whether there are
any range measurements, and the Δρ matrix is allocated on line 9 with sufficient
rows to include both the GPS and the range measurements. The additional code
from that already outlined in Chapter 6 is in lines 22–32. If there are any range mea-
surements (line 23), we go through each range measurement provided (line 25), cal-
culate the value as shown in the last row of (8.1), and add them to the matrix (line
30).
1. private Matrix setUpPmatrix(GpsMeasurement measurement, RangeMeasurementSet
rangeMeasurements, Wgs84Coordinate[] satelliteLoc,
2. Matrix x, Wgs84Coordinate handsetLocEstimate)
3. {
4. int numRangeMeasurements = 0;
RangeMeasurementSet
-rangeMeasurements
0..*
RangeMeasurement
-transmiiterLocation : Wgs84Coordinate
-range : double
5. if(rangeMeasurements != null)
6. {
7. numRangeMeasurements = rangeMeasurements.getNumRangeMeasurements();
8. }
9. Matrix p = new Matrix(measurement.getNumSatsMeasured() + numRangeMeasurements, 1);
10.
11. //Complete the p matrix for the GPS measurements
12. for (int i = 0; i < measurement.getNumSatsMeasured(); i++)
13. {
14. double estimatedSatRange = handsetLocEstimate.distanceTo(satelliteLoc[i]);
15. SatGpsMeasurement satMeasurement = measurement.getSatelliteMeasurement(i);
16.
17. p.setElement(i, 0,
18. (satMeasurement.getCorrectedPseudorange() -
satMeasurement.getAssociatedSatClockErrorMeters()) -
19. (estimatedSatRange + (x.get(3, 0) * Satellite.C_SPEED_OF_LIGHT)));
20. }
21.
22. //Complete the p matrix for the range measurements
23. if(numRangeMeasurements > 0)
24. {
25. for (int i = 0; i < numRangeMeasurements; i++)
26. {
27. int row = i + measurement.getNumSatsMeasured();
28. Wgs84Coordinate transmitterLocn =
rangeMeasurements.getRangeMeasurement(i).getLocation();
29. double transmitterEstimatedRange = handsetLocEstimate.distanceTo(transmitterLocn);
30. p.setElement(row, 0, rangeMeasurements.getRangeMeasurement(i).getRange() -
transmitterEstimatedRange);
31. }
32. }
33. return p;
34. }
The setUpHMatrix() is modified to add the rows associated with the range mea-
surements as shown next. Similar to setUpPmatrix(), there is some additional setup
in lines 4–9. The range measurements are added in lines 20–33. The elements of H
are set up in lines 28–30; the values are calculated based on the location of the trans-
mitter and the estimated range to the transmitter from the reference location as
specified in the last row of (8.2). The final column is set to 0 for range measurements
(line 31).
1. private Matrix setUpHmatrix(GpsMeasurement measurement, RangeMeasurementSet
rangeMeasurements,
2. Wgs84Coordinate[] satelliteLoc, Wgs84Coordinate handsetLocEstimate)
3. {
4. int numRangeMeasurements = 0;
5. if(rangeMeasurements != null)
6. {
7. numRangeMeasurements = rangeMeasurements.getNumRangeMeasurements();
8. }
9. Matrix H = new Matrix(measurement.getNumSatsMeasured() + numRangeMeasurements, 4);
10. for (int i = 0; i < measurement.getNumSatsMeasured(); i++)
11. {
12. double satRange = handsetLocEstimate.distanceTo(satelliteLoc[i]);
13.
14. H.setElement(i, 0, -1 * (satelliteLoc[i].getX() - handsetLocEstimate.getX())/satRange);
15. H.setElement(i, 1, -1 * (satelliteLoc[i].getY() - handsetLocEstimate.getY())/satRange);
16. H.setElement(i, 2, -1 * (satelliteLoc[i].getZ() - handsetLocEstimate.getZ())/satRange);
17. H.setElement(i, 3, Satellite.C_SPEED_OF_LIGHT);
18. }
19.
20. if(numRangeMeasurements > 0)
21. {
22. for (int i = 0; i < numRangeMeasurements; i++)
23. {
24. int hIndex = i + measurement.getNumSatsMeasured();
25. Wgs84Coordinate transmitterLoc =
rangeMeasurements.getRangeMeasurement(i).getLocation();
26. double transRange = handsetLocEstimate.distanceTo(transmitterLoc);
27.
28. H.setElement(hIndex, 0, -1 * (transmitterLoc.getX() -
handsetLocEstimate.getX())/transRange);
29. H.setElement(hIndex, 1, -1 * (transmitterLoc.getY() -
handsetLocEstimate.getY())/transRange);
172 Hybrid Location
This section describes a series of experiments that show the performance of the
hybrid position calculation using a position calculation class.
will use the location of the base station as the initial location. The handset could be
anywhere within the range of the cell. Depending on the handset’s location and the
physical size of the cell, the initial location provided to the position calculation
could be some distance away from the true location of the handset.
It is impossible to define a truly typical initial location uncertainty size, but for
this section, we have defined a typical initial location uncertainty where the handset
is 1,000 meters from the base station and at an altitude difference of 100 meters.
Note that the initial location may be more accurate than the size of the cell if other
technologies are employed to calculate the initial location. For example, RTT mea-
surements are readily available in a UTRAN network, so an RTT-based location
may be used as the initial location estimate for the A-GPS fix. Other location tech-
nologies that can provide an accurate seed location for A-GPS include U-TDOA and
TA/NMR. These typical initial location offsets are highlighted in the results tables
throughout this chapter.
The GPS measurements discussed in this chapter are 80,657 distinct GPS mea-
surements taken from the NovAtel GPS receiver on the roof of the laboratory. Dur-
ing the 24-hour period, the GPS receiver locks on to an average of 8 satellites with a
minimum of 6 satellites and a maximum of 11 satellites. The satellites have an
orbital period of just under 12 hours. Using 24 hours of data covers all satellites
coming into view twice and includes many different satellite arrangements, so this is
a reasonable sized data set to use.
In order to run some of the simulations outlined in this chapter, this basic data
set is used and a subset of individual satellites are taken from each of the GPS mea-
surement. For example, the complete data set contains 80,657 GPS measurements.
Each GPS measurement contains a measurement of all of the satellites in view at
that instant in time. To run a test for only four satellites, all 80,657 GPS measure-
ments are still used. However, only four satellites are randomly selected from each
measurement; the location is calculated and results collated.
As a starting point, Table 8.1 shows the accuracy in meters at the 67% and 95%
levels for different initial location offsets in the horizontal and vertical directions.
Range
Cellular
base station
Handset
During the 24 hours, the position calculation achieved a 100% yield and the accu-
racy for the typical uncertainty of 1,000 meters horizontal and 100 meters altitude
at 67% is 4.94 meters and at 95% is 8.47 meters.
When there are many satellites visible, there is more redundancy when solving
the equations and the horizontal offset has little effect on the calculated location.
For example, when the horizontal offset is 100 kilometers and the altitude is 100
meters, the accuracy is essentially the same as applying no offset.
Table 8.1 Horizontal and Vertical (Altitude) Errors for All Satellites in
View
All Satellites: Horizontal Error
Altitude Offset
0 100
Accuracy Accuracy
67% 95% Yield 67% 95% Yield
Horizontal 0 4.94 8.47 100.00 4.94 8.47 100.00
Offset
1,000 4.94 8.47 100.00 4.94 8.47 100.00
10,000 4.94 8.48 100.00 4.94 8.48 100.00
50,000 4.94 8.49 100.00 4.94 8.49 100.00
100,000 4.93 8.51 100.00 4.93 8.52 100.00
All Satellites: Vertical Error
Altitude Offset
0 100
Accuracy Accuracy
67% 95% Yield 67% 95% Yield
Horizontal 0 24.26 36.24 100.00 24.26 36.24 100.00
Offset
1,000 24.26 36.24 100.00 24.26 36.25 100.00
10,000 24.26 36.26 100.00 24.26 36.27 100.00
50,000 24.27 36.29 100.00 24.28 36.28 100.00
100,000 24.29 36.29 100.00 24.28 36.29 100.00
8.4 Hybrid Position Calculation Accuracy 175
uses the altitude from the initial location estimate to set the range to the Earth-cen-
tered measurement. The results are shown in Table 8.3. There is a significant
increase in the horizontal and vertical error in the result compared to when using
four satellites in Table 8.2.
Receiving a small number of satellites at a high elevation can be a problem for
the location calculation as this satellite arrangement results in poor dilution of pre-
cision (DOP). Table 8.4 shows the results when using the four highest elevation sat-
ellites for
each measurement as input to the position calculation. The accuracy of the
location is similar to using four randomly selected satellites; however, the yield has
been significantly reduced.
In this section, we have shown results for situations where a limited number of
satellites are visible, or those visible are not in an ideal arrangement such as being at
a high elevation. In these situations, a stand-alone GPS PCF has been shown to suf-
fer in terms of both yield and accuracy. In the next section we will consider these sit-
uations and the expected accuracy when range measurements are included from
other sources.
Table 8.2 Horizontal and Vertical Errors for Four Randomly Selected
Satellites
All Satellites: Horizontal Error
Altitude Offset
0 100
Accuracy Accuracy
67% 95% Yield 67% 95% Yield
Horizontal 0 9.79 30.55 83.84 10.04 38.62 84.08
Offset
1,000 9.80 30.51 84.24 10.01 38.45 83.71
10,000 9.74 30.86 83.67 10.02 38.51 83.88
50,000 10.06 39.87 83.95 10.01 38.70 83.90
100,000 10.27 46.53 84.24 10.25 45.51 84.03
All Satellites: Vertical Error
Altitude Offset
0 100
Accuracy Accuracy
67% 95% Yield 67% 95% Yield
Horizontal 0 26.37 48.12 83.84 28.01 88.14 84.08
Offset
1,000 26.32 48.08 82.24 27.95 84.87 83.71
10,000 26.83 47.88 83.67 28.02 71.00 83.88
50,000 27.73 64.12 83.95 27.85 58.80 83.90
100,000 27.98 72.78 84.24 28.05 71.03 84.03
176 Hybrid Location
Table 8.3 Horizontal and Vertical Errors for Three Randomly Selected
Satellites and an Earth-Centered Measurement
All Satellites: Horizontal Error
Altitude Offset
0 100
Accuracy Accuracy
67% 95% Yield 67% 95% Yield
Horizontal 0 24.45 74.02 87.11 82.26 236.61 87.11
Offset
1,000 24.42 73.56 87.03 82.17 234.13 86.82
10,000 28.07 99.09 87.06 81.80 239.10 87.19
50,000 103.31 333.20 86.79 110.59 402.40 87.16
100,000 203.95 651.10 86.98 206.99 675.29 87.05
All Satellites: Vertical Error
Altitude Offset
0 100
Accuracy Accuracy
67% 95% Yield 67% 95% Yield
Horizontal 0 0.05 0.18 87.11 100.04 100.42 87.11
Offset
1,000 2.70 3.13 87.03 101.56 103.10 86.82
10,000 27.13 31.16 87.06 115.83 130.81 87.19
50,000 135.61 155.72 86.79 180.07 253.96 87.16
100,000 270.29 311.03 86.98 257.23 406.95 87.05
Table 8.4 Horizontal and Vertical Errors for the Four Highest Elevation
Satellites
All Satellites: Horizontal Error
Altitude Offset
0 100
Accuracy Accuracy
67% 95% Yield 67% 95% Yield
Horizontal 0 10.06 31.84 59.88 10.06 31.84 59.88
Offset
1,000 10.06 31.84 59.88 10.06 31.84 59.88
10,000 10.06 31.84 59.87 10.06 31.83 59.88
50,000 10.06 31.83 59.86 10.05 31.80 59.86
100,000 10.07 31.79 59.85 10.06 31.78 59.86
All Satellites: Vertical Error
Altitude Offset
0 100
Accuracy Accuracy
67% 95% Yield 67% 95% Yield
Horizontal 0 34.86 69.41 59.88 34.86 69.41 59.88
Offset
1,000 34.86 69.41 59.88 34.86 69.41 59.88
10,000 34.86 69.39 59.87 34.86 69.33 59.88
50,000 34.87 69.38 59.86 34.87 69.40 59.86
100,000 34.85 69.36 59.85 34.86 69.36 59.86
8.4 Hybrid Position Calculation Accuracy 177
to 360°. This is combined with using the randomly selected number of GPS mea-
surements from each of the 80,657 test measurements.
Consider the casein which the handset can measure three GPS satellites and
three range measurements. The results are shown in Table 8.5. It can be seen that
the yield is almost 100% and the results are very accurate. Note, however, that the
results are somewhat artificial because the range measurements do not have any
error associated with them. The results do show that using range measurements can
significantly improve the calculated location. For example, the accuracy at the 67%
level has gone from 82.17 meters (for three satellites and an Earth-centered mea-
surement) down to 5.83 meters.
It is possible that only one range measurement may be available in association
with some GPS measurements for a particular location fix. This is the case for
TA/NMR and also for some of the early UTRAN RTT deployments where the RNC
is only capable of returning one measurement to the SAS. Table 8.6 shows results
for three measured satellites and one range measurement. This results in a very high
yield and also quite good accuracy. It can also be seen that the accuracy of the loca-
tion fix can become poor when the initial location estimate is a significant distance
from the true location of the handset.
Table 8.5 Horizontal and Vertical Errors for Three Satellites and Three
Range Measurements
All Satellites: Horizontal Error
Altitude Offset
0 100
Accuracy Accuracy
67% 95% Yield 67% 95% Yield
Horizontal 0 10.06 31.84 59.88 10.06 31.84 59.88
Offset
1,000 10.06 31.84 59.88 10.06 31.84 59.88
10,000 10.06 31.84 59.87 10.06 31.83 59.88
50,000 10.06 31.83 59.86 10.05 31.80 59.86
100,000 10.07 31.79 59.85 10.06 31.78 59.86
All Satellites: Vertical Error
Altitude Offset
0 100
Accuracy Accuracy
67% 95% Yield 67% 95% Yield
Horizontal 0 34.86 69.41 59.88 34.86 69.41 59.88
Offset
1,000 34.86 69.41 59.88 34.86 69.41 59.88
10,000 34.86 69.39 59.87 34.86 69.33 59.88
50,000 34.87 69.38 59.86 34.87 69.40 59.86
100,000 34.85 69.36 59.85 34.86 69.36 59.86
178 Hybrid Location
world, however, range measurements have errors that depend on many factors such
as the resolution of the radio interface, signal propagation effects, interference, syn-
chronization, and measurement error.
In this section, we introduce error into the range measurements to simulate
using measurements of different accuracies. Similar to the previous section, the
range measurements are simulated as from a point source 10,000 meters from the
ground truth and are selected in a random direction from 0° to 360°. A simple
method is then used to introduce an error to the measurements.
The range to the simulated source is corrupted by a randomized value with a
specific range. For example, when a range uncertainty of 500 is considered, the
range to the base station for each measurement is selected as a random distance
between 9,750 and 10,250 meters.
Table 8.7 shows the results of calculating a location using three satellites with
three range measurements, each of which has been corrupted by up to 100 meters.
The results show that the PCF achieves a very high yield and good accuracy. Simi-
larly, when there is only one range measurement as shown in Table 8.8, the yield is
quite high. However, the accuracy is reduced.
A range error of 100 meters is quite a conservative estimate using ranging tech-
nology available today such as RTT for UMTS networks or UTDOA-based
measurements.
Figures 8.4 and 8.5 show the position calculation accuracy at the 67% and 95%
levels for different numbers of range measurements and different amounts of cor-
Table 8.6 Horizontal and Vertical Errors for Three Satellites and One Range
Measurement
All Satellites: Horizontal Error
Altitude Offset
0 100
Accuracy Accuracy
67% 95% Yield 67% 95% Yield
Horizontal 0 4.94 8.47 100.00 4.94 8.47 100.00
Offset
1,000 4.94 8.47 100.00 4.94 8.47 100.00
10,000 4.94 8.48 100.00 4.94 8.48 100.00
50,000 4.94 8.49 100.00 4.94 8.49 100.00
100,000 4.93 8.51 100.00 4.93 8.52 100.00
All Satellites: Vertical Error
Altitude Offset
0 100
Accuracy Accuracy
67% 95% Yield 67% 95% Yield
Horizontal 0 30.52 110.02 99.97 32.23 109.60 99.98
Offset
1,000 30.61 125.46 99.98 33.36 130.55 99.99
10,000 50.69 5658.21 99.98 64.45 5681.05 99.98
50,000 2049.77 8551.16 99.98 2060.67 8515.85 99.99
100,000 2419.26 8661.38 99.97 2377.49 8619.04 99.97
8.4 Hybrid Position Calculation Accuracy 179
ruption in the range measurements on a log scale. They all use the typical initial
location uncertainty of 1,000 horizontal meters and 100 vertical meters (altitude).
The graphs in Figure 8.4 show that there is a direct relationship between the
inaccuracy of the range measurement and the resulting error in the position calcula-
tion result. A low quality of range measurement produces a less accurate location.
When there are only two satellites in view and two range measurements, the accu-
racy is poor when the range measurements have more than about 80 meters of error.
In the case when there are three satellites in view as shown in Figure 8.5, the
accuracy is improved.
This section has shown that hybrid A-GPS and range measurement positioning
is a realistic solution to get an accurate location when there are not enough GPS sat-
ellites available. This is quite often the case in areas such as urban canyons. When
several range measurements are available for the position fix, such as is the case for
an RTT solution, the position calculated becomes highly accurate. When there
are only two GPS satellites but four range measurements accurate to 100 meters, a
typical initial location uncertainty accuracy is 40 meters at 67% with a yield of
99.99%.
When inaccurate ranging measurements are used, the accuracy of the location
fix reduces as the amount of inaccuracy is increased. However, as more ranging
measurements are used, the difference is reduced, that is, the effect of the error is less
significant as there are more range measurements. This demonstrates the value of
including numerous range measurements, for example, from U-TDOA or other
range measures such as from TA or RTT. It also demonstrates that the range mea-
Table 8.7 Horizontal and Vertical Errors for Three Satellites and Three Range
Measurements with a Range Error of 100 Meters
All Satellites: Horizontal Error
Altitude Offset
0 100
Accuracy Accuracy
67% 95% Yield 67% 95% Yield
Horizontal 0 33.42 65.52 100.00 32.89 66.60 100.00
Offset
1,000 33.41 65.65 100.00 33.16 65.59 100.00
10,000 33.91 75.31 99.45 33.83 74.77 99.33
50,000 34.82 108.52 98.36 35.11 109.64 98.23
100,000 35.48 160.16 97.66 35.34 157.44 97.67
All Satellites: Vertical Error
Altitude Offset
0 100
Accuracy Accuracy
67% 95% Yield 67% 95% Yield
Horizontal 0 53.43 184.96 100.00 56.40 187.81 100.00
Offset
1,000 54.03 188.03 100.00 54.99 186.96 100.00
10,000 56.57 229.74 99.45 56.78 233.27 99.33
50,000 58.99 385.58 98.36 59.57 387.02 98.23
100,000 59.94 554.20 97.66 60.09 567.84 97.67
180 Hybrid Location
Table 8.8 Horizontal and Vertical Errors for Three Satellites and One Range
Measurements with a Range Error of 100 Meters
All Satellites: Horizontal Error
Altitude Offset
0 100
Accuracy Accuracy
67% 95% Yield 67% 95% Yield
Horizontal 0 33.42 65.52 100.00 32.89 66.60 100.00
Offset
1,000 33.41 65.65 100.00 33.16 65.59 100.00
10,000 33.91 75.31 99.45 33.83 74.77 99.33
50,000 34.82 108.52 98.36 35.11 109.64 98.23
100,000 35.48 160.16 97.66 35.34 157.44 97.67
All Satellites: Vertical Error
Altitude Offset
0 100
Accuracy Accuracy
67% 95% Yield 67% 95% Yield
Horizontal 0 53.43 184.96 100.00 56.40 187.81 100.00
Offset
1,000 54.03 188.03 100.00 54.99 186.96 100.00
10,000 56.57 229.74 99.45 56.78 233.27 99.33
50,000 58.99 385.58 98.36 59.57 378.02 98.23
100,000 59.94 554.20 97.66 60.09 567.84 97.67
surements will allow a fix when there are not enough GPS satellites in view of the
handset.
10,000
1,000
2 Range
3 Range
Position calculation accuracy (meters) log scale
100
4 Range
10
1
0 100 200 300 400 500 600 700 800 900 1,000
10,000
1,000
2 Range
100 3 Range
4 Range
10
1
0 100 200 300 400 500 600 700 800 900 1,000
Range measurement inaccuracy (meters)
Figure 8.4 Change in position calculation accuracy for two satellites and different numbers of
range measurements.
182 Hybrid Location
1,000
1 Range
2 Range
100
Position calculation accuracy (meters) log scale
3 Range
4 Range
10
1
0 100 200 300 400 500 600 700 800 900 1,000
Range measurement inaccuracy (meters)
10,000
1,000
1 Range
2 Range
100
3 Range
4 Range
10
1
0 100 200 300 400 500 600 700 800 900 1,000
Range measurement inaccuracy (meters)
Figure 8.5 Change in position calculation accuracy for three satellites and different numbers of
range measurements.
References
[1] Junedi, D., and W. Ren, “Integration of GPS and GSM Signals for Location,” Master’s The-
sis 20, University of New South Wales, SNAP Group, 2004.
[2] Ma, C., Techniques to Improve Ground-Based Wireless Location Performance Using a
Cellular Telephone Network, University of Calgary, Department of Geomatics Engineering
Report 20177, 2003.
[3] Ju-Yong, D., M. Rabinowitz, and P. Enge, “Performance of Hybrid Positioning System
Combining GPS and Television Signals,” 2006 IEEE/ION Proceedings of Position, Loca-
tion, and Navigation Symposium, 2006.
[4] Japan Aerospace Exploration Agency, Quasi-Zenith Satellite System Navigation Service,
Interface Specification for QZSS (IS-QZSS), 2009.
CHAPTER 9
In open sky, the conventional GPS error models, that is, the ones to which a handset
has access, will allow the calculation of the location of the handset using GPS L1 to
within 5 meters or so. In this chapter, some techniques are discussed for using
improved models in order to improve the accuracy of the location calculation by a
small amount.
183
184 Other Server-Side Improvements and Controls
accurately predict the location of the satellites for any given time. A review of the
different interpolation strategies can be found in [3].
The expected accuracy of the calculated location of the satellites is in the vicin-
ity of 5 centimeters [3]. This translates to an improved calculated location.
In the previous section, improvements to the accuracy of the location were dis-
cussed. In this section, some strategies and mechanisms for improving the integrity
of a calculated location are discussed.
Once the LS determines the location of a handset, the location is provided to the
network entity that requested it (for example, an MLP client). If the LS is trusted by
the entity, then the location will be considered to be valid. This is a problem if the
location provided is a falsified location and not the true location of the handset.
The integrity of the location calculated by the LS (in cooperation with the hand-
set) is critical because it may be used by emergency services operators to find an
injured person or the location of an accident. It may also be used to gain access to
services that are restricted to a certain area. One example is when a user fraudu-
lently gains access to a broadcast that is restricted to a particular set of geographi-
cally located users. Other examples include a target that is being tracked and does
not want the tracker to know his or her correct location, spoofing the location of a
shipment that is being remotely tracked, or even disguising criminal activities by
deceiving a law-enforcement location-based application (LBA).
One example of a system where an operator may be motivated to deceive a GPS
receiver in order to make a financial gain is in the area of commercial fishing. In
Europe, vessels are required to carry a device that logs their location so that the area
in which the vessel is fishing can be later checked in order to ensure they are only
fishing where it is legal for them to do so [11].
The aim of the spoofer (or attacker) is to convince the LS to provide the location
that the attacker desires. The attacker does this by falsifying (or spoofing) the loca-
tion or the measurement data so that the location provided by the LS is effectively
predetermined by the attacker. The attacker may be an unscrupulous user or inter-
mediary that changes the software in the handset to manipulate the measurements.
In this section, the mechanism for location assurance is discussed along with
measurement spoofing. Both methods are employed by the LS to reduce the chance
of a location being calculated incorrectly.
the tower, then the location is deemed to be invalid by the LS and hence is not
passed on.
An alternative is to determine whether the location is within the defined area of
the cell. The LS will generally have a database that contains not only the location of
the cell tower, but will have additional information such as the orientation and
opening of the antenna and also its range. The LS can determine whether the loca-
tion is within those bounds, and if not, the location is deemed invalid.
A more precise mechanism is to use other measurements from the network to
validate the location. For example, in a UTRAN network, the location can be vali-
dated against the RTT measurements that are sourced from within the trusted net-
work. The RTT measurements are range measurements from one or more base
stations at known locations. If the reported location is outside the bounds of the
individual range measurements, then the location is deemed to be invalid by the LS.
The GpsPositionCalculation.performLocationAssuranceCheck() method per-
forms the location assurance checking. It is configured with a distance in meters
above which the location is deemed to be invalid.
There will be situations where the initial location of the handset is not well
known, for example, if the A-GPS handset reports a cell that is not in the database.
In this situation it is still possible for the LS to calculate the location of the handset
by performing a location calculation using the Doppler initially, followed by a code
phase-based position calculation (as discussed in Chapter 6). The location assur-
ance check can still be applied to this situation; however, if the handset has falsified
both the Doppler and the code-phase measurements, then the location assurance
check is ineffective.
9.2.2 Antispoofing
Location assurance was discussed in the previous section and it applies to checking,
or validating, a location that has already been calculated. Antispoofing, on the
other hand, is a technique that can be applied to help identify whether the measure-
ments are falsified and hence invalidate the calculated location. This gives a more
fine-grained mechanism than location assurance to detect attackers and provides a
mechanism for the analysis of the location when location assurance cannot be per-
formed, such as when there are no independent location technologies to assure the
location of the handset.
Antispoofing is more fine-grained than location assurance because location
assurance is subject to the resolution of the location technology used to perform it.
For example, if the cell location is the only information available to validate the
location, then a spoofer is able to simulate a location anywhere within the boundary
of the cell, which may be a large area for larger cells, for example, tens of
kilometers.
Generally, the LS requires the handset to provide true and accurate measure-
ments (and not false ones) in order to calculate an accurate location. Spoofing is the
process whereby the handset provides falsified measurements to the server in order
that the server calculates an incorrect location for the handset. In this section, the
effect of spoofed measurements provided to the LS is discussed and a basic mecha-
nism to detect spoofed measurements is outlined. This is in contrast to most spoof-
9.2 Location Integrity 187
ing research, which has been focused on detecting false radio frequency signals
arriving at the GPS receiver front-end [12] and also authenticating location results
provided to a third party.
As discussed previously, the A-GPS capable handset provides the following
per-satellite measurement elements to the LS: code phase, Doppler, signal-to-noise
ratio, multipath indicator, and pseudorange RMS error. A naïve LS will perform a
position calculation using the measurements as provided and the result will then be
passed on to the network entity that requested it. If the LS is trusted by the entity,
then the location will be considered by that entity to be valid, and the attacker
succeeds.
In the case in which the A-GPS handset is an attacker, and the LS has no defense
mechanism in place, the attacker does not need to measure the signals from the sat-
ellite at all, but can generate the measurements that will result in its desired location
being provided ultimately to the LBA. If the desired location is within a few hundred
kilometers of the attacker’s present location, the handset can simply download the
NAV message from the satellites that are in view.
Once the handset has the NAV message, it can calculate the location and veloc-
ity of the satellites, introduce errors such as ionosphere errors using the ionosphere
model and an additional error model, and generate simulated satellite code phase
and Doppler measurements to send to the LS based on the desired location of the
handset. If the attacker needs to generate a location for somewhere remote from the
current location, a feed of ephemeris data from a network source is required in
order to obtain the information for satellites that the attacker cannot see and hence
cannot get the NAV message.
There are several ways for the server to perform spoofing detection. Some sim-
ple methods are described in the following sections.
⎛ v − vr $ ⎞
D=⎜ s ⋅ls⎟f (9.1)
⎝ c ⎠
188 Other Server-Side Improvements and Controls
where vs is the velocity of the satellite, vr is the velocity of the receiver, c is the speed
of light, l$s is the estimated line of sight unit vector, and f is the transmitted frequency
of L1, which is 1,575.42 MHz. The c and f scalars convert the result from ms−1 to
Hz.
The line-of-sight vector is calculated as the difference between the satellite and
the receiver location divided by the norm of the difference and is shown in
r − r$r
l$s = s (9.2)
rs − r$r
Table 9.2 SSR Statistics from the NovAtel GPS Reference Receiver for
Different Numbers of Satellites
Number of Standard
Visible Number of Average Deviation
Satellites Observations SSR of SSR SSR 67% SSR 95%
5 173,211 6.66 ,13.61 8.39 13.86
6 2,268,482 17.53 ,27.75 22.09 36.47
7 11,589,266 28.85 ,376.38 36.35 60.01
8 25,602,257 52.46 4,448.57 66.10 109.12
9 25,122,525 54.88 709.62 69.15 114.16
10 14,179,154 71.04 876.96 89.51 147.77
11 7,208,648 71.20 131.68 89.71 148.09
12 1,568,299 78.86 120.26 99.37 164.04
the laboratory. The data set consists of 87,713,876 individual measurements of the
satellites in view of the receiver.
The trend is as expected; more satellites result in more total error in the mea-
surements (SSR increases). The relationship between the number of satellites and
the SSR is almost linear. That is, as an extra satellite is considered, the SSR increases
by a reasonably constant amount.
Since this is a good quality receiver operating in the open sky, this can be consid-
ered as a baseline for spoof detection. For example, if a handset that reports 8 satel-
lites results in an SSR of less than 52.46, then it may be considered to be a spoofer;
however, this parameter could be tuned.
Recently, a SUPL handset in the field was found to be spoofing an LS. This was
discovered during an interoperability testing (IOT) exercise. The data from several
location calculations is shown in Table 9.3.
The handset is considered to be a spoofer because the SSR is very low. The
chipset supplier confirmed that it was spoofing the code phases that it was sending
to the LS. It was not trying to intentionally cause harm, but instead of measuring the
code phases, it was generating them based on its own handset-based location calcu-
lation result (which happened to be incorrect).
1. Run some analysis on data from a RINEX file to see how the SSR is affected
by different numbers of satellites. Tune the SPOOFING_SSR_LIMIT
constant in the GpsPositionCalculation class, which has a different level
depending on the number of satellites in the measurement.
2. Write a class that attempts to spoof the measurements provided to the
position calculation. Try running it with and without the call to
checkIfMeasurementsSpoofedSsrAnalysis() commented out.
3. Implement the Doppler shift-based antispoofing method.
190 Other Server-Side Improvements and Controls
References
[1] Dow, J. M., R. E. Neilan, and G. Gendt, “The International GPS Service (IGS): Celebrating
the 10th Anniversary and Looking to the Next Decade,” Adv. Space Res., Vol. 36, No. 3,
2005, pp. 320–326.
[2] IGS, http://igscb.jpl.nasa.gov/.
[3] Schenewerk, M., “A Brief Review of Basic GPS Orbit Interpolation Strategies,” GPS Tool-
box, National Geodetic Survey, 2003.
[4] Spilker, J. J., and B. W. Parkinson, “Overview of GPS Operation and Design,” in Global
Positioning System: Theory and Applications, Vol. 1, Washington, D.C.: American Insti-
tute of Aeronautics and Astronautics, Inc., 1996.
[5] GPS Navstar Joint Program Office, Navstar GPS Space Segment/Navigation User Inter-
faces, Interface Specification, IS-GPS-200, Revision D, Navstar GPS Joint Program Office,
El Segundo, CA, 2004.
[6] Spliker, J. J, “Tropospheric Effects on GPS,” in Global Positioning System: Theory and
Applications, Vol. 1, Washington, D.C.: American Institute of Aeronautics and Astronau-
tics, Inc., 1996.
[7] Saastamoinen, J., “Atmospheric Correction for the Troposphere and Stratosphere in Radio
Ranging of Satellites,” in The Use of Artificial Satellites for Geodesy, Geophys. Monogr.
Ser., Vol. 15, S. W. Henriksen, A. Mancini, and B. H. Chovitz, (eds.), Washington, D.C.:
AGU, 1972, pp. 247–251.
[8] Mekik, C., “Tropospheric Delay Models in GPS,” Intl. Symp. on GIS/GPS, Istanbul, Tur-
key, September 15–18, 1997.
[9] Yin, H., D. Huang, and Y. Xiong, “Regional Tropospheric Delay Modeling Based on GPS
Reference Station Network,” International Association of Geodesy Symposia, VI
Hotine-Marussi Symposium on Theoretical and Computational Geodesy, February 27,
2008.
[10] NASA Global Ionospheric (TEC) Maps, http://www.gdgps.net/products/tec-maps.html.
[11] Commission Regulation (EC) No 2244/2003, “Laying Down Detailed Provisions Regard-
ing Satellite-Based Vessel Monitoring Systems,” Official Journal of the European Union, L
333/17, 20.12.2003, December 18, 2003.
9.3 Software Projects 191
Assisted-GNSS
As mentioned in Chapter 1, the basic task of a GNSS assistance data server is to pro-
vide assistance data to a GNSS-enabled handset in order to improve the time to first
fix and the yield. In addition, the LS often provides the position calculation as well,
in order to reduce the size of the assistance data required and make use of additional
measurements that it can retrieve from the network.
All of the associated implementation and description in the book up to now has
used one example of a GNSS, that is, GPS. In addition, it has been focused on the
first civilian signal, GPS L1. A lot of the information applies to the other GNSSs at a
high level, that is, they broadcast a navigation message, they all have a ranging sig-
nal, and they use their own time reference. There will be a large number of naviga-
tion-enabling satellites in orbit in the future, which means that an A-GNSS receiver
has access to many more satellites than it does at present. That will significantly
increase accuracy and yield, especially in areas where it is presently difficult to cal-
culate a location, such as urban canyons.
This chapter generalizes the previous work in the book to A-GNSS and also dis-
cusses some of the issues associated with an A-GNSS server compared to an A-GPS
server. It discusses the differences in the protocols and how the server can make use
of measurements from more than one GNSS.
10.1 Assisted-GNSS
193
194 Assisted-GNSS
Many of the GNSSs are still in the planning and deployment stage and details
will change, so they are only discussed in this chapter in general terms. Specific
details about the constellations, signals, and broadcast messages can be obtained
from the International Committee on Global Navigation Satellite Systems (ICG)
[1].
10.1.1 GLONASS
The GLONASS system is developed and managed by the Russian Federal Space
Agency. A fully operational constellation consists of 24 satellites. A fully opera-
tional constellation means that a minimum of five satellites are visible at any given
time. At present, the satellite transmissions use the frequency division multiple
access (FDMA) technique in which each satellite uses a separate channel, or fre-
quency band, and has a standard precision (SP) and high precision (HP) signal at
different clock rates. In addition, the HP signal has a larger bandwidth than the SP
signal. GLONASS is presently undergoing a modernization effort, which includes
transmitting in CDMA in order to improve compatibility with other GNSSs.
The GLONASS Information-Analytical Center (IAC) provides information
about the status of GLONASS [2] from the GLONASS control center. It also hosts
the current version of the GLONASS ICD [3], and is the source of precise ephemeris
for GLONASS.
GLONASS uses the PZ 90 coordinate reference system, which differs from
WGS 84 by less than 0.4 meters in any direction. The ground control segment and
the network of command and tracking stations are entirely located within the terri-
tory of Russia.
GLONASS has its own time scale called GLONASS time, which is synchronized
within 1 second of UTC (offset by 3 hours). The navigation message has the data to
convert between GLONASS time and UTC time. When a leap second is added to
UTC, it is also added to GLONASS time.
The GLONASS L1 signal is modulated with a pseudorandom ranging code, the
navigation message, and an auxiliary meander sequence [3]. The ranging code has a
period of 1 millisecond with a bit rate of 511 kilobits per second. The navigation
data is transmitted at 50 bits per second and consists of immediate and
nonimmediate portions, where the immediate data relates to the satellite transmit-
ting the information and the nonimmediate data relates to the other satellites in the
constellation.
The navigation message is split into superframes (duration of 2.5 minutes),
which contain 5 frames (duration 30 seconds), and each frame consists of 15 strings
(2 seconds each). The string is 2 seconds long and contains 85 bits of navigation
data and the time mark. Similar to the GPS ICD, the GLONASS ICD contains the
algorithms to calculate the location of the satellites at a given point in time given the
ephemeris.
10.1.2 Galileo
The Galileo GNSS is presently being built and deployed by the European Union
(EU). It will consist of 30 satellites when fully deployed. The satellites transmit on
10.1 Assisted-GNSS 195
several frequencies and will provide different services for civilian use, commercial
use, and safety of life.
The Galileo satellites transmit ranging codes and also a navigation message.
The Galileo open service is specified in the Galileo OS SIS ICD [4]. The Open Ser-
vice (OS) uses the Galileo F/NAV navigation message format. The message struc-
ture is a series of frames, subframes, and pages. The frequency of repeating of data
within the message depends on the categories of the data (fast, medium, and slow
rates) and contains the time, the satellite clock correction, the satellite health, the
ephemeris, and the almanac. The navigation data contains all of the information
required to enable the handset to perform positioning. Similar to the GPS IS and the
GLONASS IS, the Galileo OS SIS ICD provides the equations that apply to the
ephemeris parameters, including calculating the location of the satellites. The equa-
tions used in Galileo to calculate the position of a satellite are similar to that for
GPS.
Galileo System Time (GST) is a sequential time scale that started at midnight
between August 21 and 22, 1999. Each time that a leap second is added to UTC, the
GST moves ahead by a second. The week number is 12 bits, which enables 4,096
weeks after which it rolls over to 0. The time of week is the number of seconds since
the start of the week and ranges from 0 to 604,800 seconds. The navigation message
includes a model to convert GST to UTC.
Galileo has a modern ionospheric model which includes broadcast storm flags
(or ionospheric disturbance) for particular regions [4].
10.1.3 Compass
Compass is a system that is presently in planning and development by the Chinese
government. It consists of 35 satellites, with 5 of them in geostationary orbit. The
ranging signals will use CDMA, similar to GPS and Galileo and consisting of two
levels of service: open and restricted. At the time of this writing, there was no pub-
licly available ICD.
10.1.4 QZSS
The Quasi-Zenith Satellite System (QZSS) is a regional navigation satellite system
that is in the development phase. It is planned that several satellites will be placed in
an orbit so that the satellites are overhead in Japan for 12 hours a day. The orbit
pattern is known as a highly inclined elliptical orbit (HEO). Since the satellites are
high in the sky, they will suffer less from obstruction from tall buildings or moun-
tains. This will increase the availability (yield) for performing a satellite-based posi-
tion calculation. In a dense city, the position yield will go from about 40% to
90%–100% [5]. In addition, VDOP will be improved, which means that a
QZSS-capable handset will be able to calculate the altitude more accurately.
The QZSS will transmit a ranging and navigation message that is similar to (and
compatible with) GPS, but will have additional augmentation information trans-
mitted on a new signal. The augmentation information will be correction data and
integrity data [6]. The satellites use the modernized GPS as a base, transmitting the
L1 C/A, L1C, L2, and L5 signals, in order to minimize the changes to receiver
196 Assisted-GNSS
designs. The QZSS consists of satellites and a ground segment that consists of an
MCS and monitoring stations (MS).
The QZSS uses the time base for GPS with a controlled offset from GPS time.
For representing coordinates, it uses the Japan satellite navigation Geodetic System
(JGS), which is referenced to the International Terrestrial Reference System (ITRS).
The coordinate offset between JGS and WGS 84 shall be 0.2 meters or less [6]. The
navigation message is the same as that broadcast by GPS.
10.1.5 WAAS
The Wide Area Augmentation System (WAAS) is a GNSS augmentation that pro-
vides information about the GNSS satellites and also provides a GPS ranging signal.
The system consists of receiver stations deployed in North America and Hawaii,
several wide-area master stations, and geostationary satellites [7]. The master sta-
tions located on each coast of the United States collect data from the network of ref-
erence stations and calculate correction data. The correction data is then broadcast
on L1 from one of the geostationary satellites. The details of the WAAS are
provided in the WAAS specification [7].
The WAAS provides corrections for GNSS satellite positions and the satellite
clock error. It also provides ephemeris corrections and ionospheric delay informa-
tion. The localized ionospheric delay information is the component that signifi-
cantly increases the accuracy of the location that the handset makes. The
ionospheric delays are provided as corrections for a number of points (organized in
a grid pattern) for the WAAS service area.
The geostationary satellites transmit the same ranging signal as the GPS satel-
lites so it can be used as an additional range measurement (the range of PRNs for
WAAS ranging codes are from 120 to 138 and are compatible with GPS). Since the
satellites are high in the sky, they increase the VDOP, which leads to an improved
vertical accuracy in the calculated location. The WAAS broadcasts on a single car-
rier frequency of GPS L1.
The WAAS transmits data at 250 bits per second and consists of different mes-
sages as defined by the message type. The WAAS has its own time definition and is
maintained to be within 50 nanoseconds of GPS time. The WAAS provides the
parameters to convert between the time scales.
10.1.6 EGNOS
The European Geostationary Navigation Overlay Service (EGNOS) is a system that
provides GPS and GLONASS corrections for GNSS users in Europe. Similar to the
WAAS, it provides several geostationary satellites and a network of ground stations
that monitor satellite signals. The GEO satellites provide corrections to users that
(similarly to the WAAS) allow a five- to tenfold accuracy improvement over using a
GNSS alone. The EGNOS is similar to the WAAS in that the primary accuracy
improvement comes from accurate location specific ionosphere corrections. It also
provides correction over the Internet from SISNeT [8].
The WAAS and EGNOS messages are compatible, so the same receiver can
make use of the signals from both systems.
10.2 Protocols 197
10.1.7 Others
There are several other augmentations and regional satellite systems that are in vari-
ous stages of design and deployment and they are discussed briefly in this section.
The Indian Regional Navigational Satellite System (IRNSS) is a regional naviga-
tion system that will provide service in the Indian region and is in the planning
stages.
The Multifunctional Satellite Augmentation System (MSAS) is a SBAS that is
developed in Japan and is compatible with WAAS and EGNOS. The GPS Aided
Geo Augmentation Navigation (GAGAN) is the other SBAS that is being developed
in India and will also be compatible.
The Local Area Augmentation System (LAAS) is an aircraft landing system that
provides differential GPS corrections over a VHF data link to the GPS receiver. The
Ground-based Regional Augmentation System (GRAS) also provides differential
corrections over a VHF link and is being developed in Australia.
10.2 Protocols
The assistance data protocols (RRLP, PCAP, RRC, and TIA-801) initially only sup-
ported GPS L1 C/A code assistance. Support for modernized GPS, the other GNSSs,
and the SBASs has been added over the last few years. In the protocol standards, it
has been named Galileo and Additional Navigation Satellite Systems (GANSS).
In this section, we explore support for A-GNSS through the RRLP specification
[9]. In this chapter, the fields are not discussed at the encoding level, so the informa-
tion will equally apply to PCAP, RRC, and TIA-801. In Tables 5.1, 5.2, and 5.3, the
important fields from the position request, position response, and assistance data
messages were listed and outlined. In this section, they are explored further from the
GNSS point of view.
When reading this section, it is best to have the RRLP specification nearby.
(WAAS, EGNOS, MSAS, GAGAN), Modernized GPS (L1C, L2C, L5), QZSS, and
GLONASS.
The ASN.1 for the GANSS Positioning Method from RRLP is shown here:
— additional satellite systems may be added in future versions of the protocol
GANSSPositioningMethod ::= BIT STRING {
gps (0),
galileo (1),
sbas (2),
modernizedGPS (3),
qzss (4),
glonass (5) } (SIZE (2..16))
The handset will look at this bitmap and, depending on its capabilities, will
respond with the list of the location technologies for which it is capable of using and
needs assistance data. Note that if it already has current assistance data cached, it
will respond with the measurements (handset-assisted) or the location
(handset-based).
The GANSS Carrier-Phase Measurement Request Element is a flag in the posi-
tion request that allows the LS to request carrier phase measurements (compared to
usual code-phase used in SPP) in handset-assisted mode. If present, the handset, if
capable, will make carrier phase measurements for all of the location technologies
that it supports, provided that they were in the Positioning Instructions Element.
The GNSSs support more than one frequency and the LS can request that the
handset returns more than one satellite frequency when operating in hand-
set-assisted mode. The GANSS Multi-frequency Measurement Request Element is a
flag that requests the handset the measurement for more than one signal, for exam-
ple, if it is requesting that the handset return measurements for modernized GPS, it
may request measurements from both L2C and L5.
The GANSS reference time provides the time fields for a specific GANSS. The
GANSS that the time is for is specified by the GANSS_TIME_ID field, which is
Galileo system time (GST), GPS time, QZSS time, or GLONASS system time.
The GANSS reference location is the location with uncertainty in the WGS 84
coordinate reference frame. This location normally comes from the cell tower loca-
tion and range (and possibly orientation and opening) and is specified by one of the
shapes in the GAD specification [10]. For an omnicell this will normally be the
shape Ellipsoid Point with uncertainty circle. If the cell is a sector, that is, it has an
orientation and opening, then the shape will be an Ellipsoid Arc.
The GANSS ionospheric model is the ionosphere model that is defined by the
Galileo ICD [4]. The Galileo ionosphere model consists of some parameters to
model the ionosphere delay and contains storm flags for specific regions of the
Earth.
The GANSS additional ionospheric model contains the parameters for the
Klobuchar model that is transmitted by GPS [11] and can be applied globally. The
model contains the field Data ID to indicate the area of applicability for the model.
For example, it can be set to a value that indicates that it is only applicable to the
coverage area of a specific GNSS, for example, the QZSS [6].
GANSS Earth orientation parameters contain the parameters to convert
between ECI and ECEF as defined in the GPS IS [11]. These parameters model the
relationship between the Earth’s rotational axis and WGS 84.
The RRLP ASN.1 definition for the GANSS Generic Assistance Data is shown
here:
— GANSS Generic Assistance Data Elements
GANSSGenericAssistDataElement ::= SEQUENCE {
ganssID INTEGER (0..7) OPTIONAL,
ganssTimeModel SeqOfGANSSTimeModel OPTIONAL,
ganssDiffCorrections GANSSDiffCorrections OPTIONAL,
ganssNavigationModel GANSSNavModel OPTIONAL,
ganssRealTimeIntegrity GANSSRealTimeIntegrity OPTIONAL,
ganssDataBitAssist GANSSDataBitAssist OPTIONAL,
ganssRefMeasurementAssist GANSSRefMeasurementAssist OPTIONAL,
ganssAlmanacModel GANSSAlmanacModel OPTIONAL,
ganssUTCModel GANSSUTCModel OPTIONAL,
ganssEphemerisExtension GANSSEphemerisExtension OPTIONAL,
ganssEphemerisExtCheck GANSSEphemerisExtensionCheck OPTIONAL,
... ,
sbasID INTEGER (0..7) OPTIONAL,
ganssAddUTCModel GANSSAddUTCModel OPTIONAL,
ganssAuxiliaryInfo GANSSAuxiliaryInformation OPTIONAL
}
The GANSS Generic Assistance Data is repeated for each GANSS for which
specific assistance data is being provided. Each instance of the GANSS Generic
Assistance Data includes an identifier to indicate which location technology that the
assistance data is for (GANSS ID).
GANSS ID is the identifier of the GNSS for which assistance data is included in
this GANSS Generic Assistance Data. If this ID is missing, then the assistance data
is for Galileo. Otherwise, it could be set to, for example, SBAS, modernized GPS,
QZSS, or GLONASS. If it is set to SBAS, then the particular SBAS is indicated by the
SBAS ID field.
The GANSS time model specifies the model to relate the GNSS system time to a
different GNSS time model. As noted in the previous sections, each of the GNSSs
200 Assisted-GNSS
has its own time models and this data type allows the handset to map the time for
the GNSS specified in this GANSS Generic Assistance Data to the time of one or
more other GNSSs. The LS can specify the relationship to more than one GNSS time
model by including this time model more than once.
GANSS differential corrections specifiy the differential corrections for this
GNSS.
The GANSS navigation model provides the navigation model for this GNSS
(specified by the GANSS ID) to the handset. The LS can provide the navigation
model as Keplerian parameters discussed earlier in this book or as state vectors in
ECEF coordinates. Interpretation of the navigation model fields depends on the par-
ticular GNSS, for example, if the GANSS ID indicates that the assistance data is for
modernized GPS, then the GPS specification is used to interpret the parameters.
Unlike the GPS specific navigation model (not GANSS), which only allows the LS to
transmit 16 satellites, this navigation model allows the LS to send up to 32 satellites.
Note, however, that the LS will normally know the approximate location of the
handset and from that it will determine the satellites that are in view of the handset.
It will then package the assistance data so that it contains the data for that set of
in-view satellites.
The GANSS real-time integrity provides a list of the satellites that are consid-
ered bad for this GNSS. The GRS deems that satellites are bad based on monitoring
and provides this list to the LS. The LS does not provide the other assistance data
types for the bad satellites, so a handset with nothing cached, for example, if it has
just performed a cold start, will not need to use this field because no assistance data
in the other fields will be sent for the bad satellites. Handsets with cached data,
however, can use this to invalidate data that it has already cached.
The GANSS data bit assistance allows the LS to provide the handset with
per-satellite information about the expected bits that are modulated on the broad-
cast message. If the handset knows the bits that are arriving, it can adjust its search
accordingly, which allows it to achieve greater sensitivity.
The GANSS reference measurement is the acquisition assistance information
for this GNSS given the reference location. The LS calculates the acquisition assis-
tance based on the reference location that normally comes from the cell location.
This reference location may be refined based on measurements from the cellular net-
work, such as RTT in a UTRAN network.
The GANSS almanac model provides the coarse long-term model of the satellite
orbital parameters and can be used by the handset to determine the approximate
location of the satellite in order to narrow the search space in the absence of other
more accurate information such as the ephemeris. Similarly to the GANSS naviga-
tion model, the parameters are interpreted depending on the specific GNSS, for
example, for Galileo, the Galileo OS SIS ICD is used.
The GANSS UTC model contains the parameters to relate the time from this
GNSS to UTC time as defined by UTC (NICT). UTC is maintained by the BIPM,
and the physical realizations of UTC (named UTC(k)) are maintained by national
meteorological institutes. The National Institute of Information and Communica-
tions Technology (NICT) is the institute in Koganei, Japan. The QZSS is related to
this time. To relate to other realizations of UTC, the GNSS additional UTC model is
used.
10.2 Protocols 201
In the GANSS ephemeris extension parameters are similar to the GPS extended
ephemeris, but are specific to the GNSS for which this data type is specified. The
GANSS ephemeris extension contains corrections to the ephemeris based on a
long-term model of the satellite orbit that the LS predicts.
In the GANSS ephemeris extension check parameters provide information
about unforeseen events for a specific satellite between the times specified. The
GANSS ephemeris extension check indicates that the extended ephemeris for that
satellite is not valid for that particular duration.
The GANSS SBAS ID is the identifier of the SBAS for this the GANSS assistance
data. It is included if the GANSS ID indicates that this assistance data is for an
SBAS.
The GANSS additional UTC model is used to relate the time for this GNSS to a
realization of the UTC time known as UTC(k). The UTC model to which it is real-
ized is specific to the GNSS, for example, the modernized GPS is realized to
UTC(USNO) and QZSS is realized to UTC(NICT).
GANSS auxiliary information is used by the LS to provide per-satellite informa-
tion to the handset. For each satellite for which the LS chooses to send information,
it can specify the signals available for that satellite. For example, if the GANSS assis-
tance data is for modernized GPS, it specifies whether this satellite supports which
(or all of) L1C, L2C, and L5 signals. In addition, if the GANSS ID is GLONASS, the
channel number associated with the satellite can be specified.
References
203
204 Appendix A
This command will build all of the source code in the project, run all of the tests
defined in the test classes, and build the jar file. The tests in the test classes are writ-
ten using the JUnit unit testing framework.
207
208 Appendix B
Once built, the classes are run directly from the jar file. There are some batch
files in the batch directory that run the main application and other individual
classes. The batch files are listed in Table B.2.
To generate the Javadoc in the Java API form from your source code, use the
Maven command:
mvn javadoc:javadoc
The code coverage results are generated in the emma directory (see Figure 2.6).
For more details, see the README file on the accompanying CD. Updates to
the code will be available from time to time at http://www.artechhouse.com/static/
reslib/harper/harper1.html
Appendix C
Source Code Object Model
This appendix contains the source code object model for some of the code accompa-
nying this book.
NavMessage
-satellites[] : SatelliteNavMessage
+getSatellite(in prn : int) : SatelliteNavMessage
+newData(in prn : int, in data : byte[])
1
SatelliteNavMessage
Subframe
-prn : int
-data : byte[]
-subframes[] : Subframe
+newData(in data : byte[])
+newData(in data : Subframe)
0..* 1 0..3 +getSubframeId() : int
+getSubframe() : Subframe
+getPageId() : int
+getPage() : SatNavMessagePage
1
0..25
SatNavMessagePage Subframe
-pageNumber : int -data : byte[]
-subframes[] : Subframe +newData(in data : byte[])
+getSubFrame() : Subframe 1 0..2 +getSubframeId() : int
+newData(in data : Subframe) +getPageId() : int
SatelliteInfoHandler
-sateInfoCollection
1
Utc
0..* -utcParameters
+getUtcTime(in gpsTime : double) : double
SatelliteInformation
-satellites[] : Satellite
+getSatellite() : Satellite
IonosphereModel
1
-ionosphereParameters
0..* +getCorrection(in location : Wgs84Coordinate) : double
Satellite
-clockCorrectionParameters
-Ephemeris
+Satellite(in navMessage : SatelliteNavMessage)
+calculateLocation() : Wgs84Coordinate
+calculateVelocity()
211
212 Appendix C
RrlpMessage
MeasurePositionRequest MeasurePositionResponse
GpsMeasurementCollection
-gpsMeasurementCollection
TroposphereModel
1
+getTroposphereDelay(in elevation : double) : double
0..*
GpsMeasurement
-satMeasurementCollection
HopfieldTroposphereModel
1
+getTroposphereDelay(in elevation : double) : double
0..*
SatMeasurement
GpsTime
RangeMeasurementSet
-rangeMeasurements
0..*
RangeMeasurement
-transmiiterLocation : Wgs84Coordinate
-range : double
Rinex
RinexNavFile RinexObsFile
215
216 Appendix D
Acquisition Assistance:
Time Relation:
Options:
-------0 06 GSM Time: false
0005 01100010 62
0006 01110100 74
0007 1100100- GPS Tow 23B: 3226212
-------1 C9
0008 011----- Number of Elements: 12
Acquisition Element:
Options:
---1---- Additional Doppler: true
----1--- Additional Angle: true
-----010 7A
0009 001----- Satellite ID: 17
---00111 27
0010 0100100- Doppler0: -1116
-------1 49
0011 01100--- Doppler1: 44
-----100 64 Doppler uncertainty: 4
0012 10111011 BB
0013 00------ Code phase: 748
--00011- Int code phase: 3
-------1 07
0014 1------- GPS bit number: 3
-0010--- Code phase search window: 2
-----001 91
0015 01------ azimuth: 5
--000--- elevation: 0
Acquisition Element:
Options:
-----1-- Additional Doppler: true
------1- Additional Angle: true
-------0 46
0016 10101--- Satellite ID: 21
-----001 A9
0017 01111100 7C
0018 1------- Doppler0: -1287
-100110- Doppler1: 38
-------1 CD
0019 00------ Doppler uncertainty: 4
--111000 38
0020 0110---- Code phase: 902
----0110 66
0021 1------- Int code phase: 13
-11----- GPS bit number: 3
---0010- Code phase search window: 2
-------0 E4
0022 0101---- azimuth: 5
----000- elevation: 0
Acquisition Element:
Options:
-------1 51 Additional Doppler: true
0023 1------- Additional Angle: true
-001110- Satellite ID: 14
-------0 9C
0024 01100111 67
0025 110----- Doppler0: -1218
---11011 DB
0026 0------- Doppler1: 54
-100---- Doppler uncertainty: 4
----0101 45
0027 100100-- Code phase: 356
------01 91
0028 000----- Int code phase: 8
---11--- GPS bit number: 3
-----001 19
0029 0------- Code phase search window: 2
-00010-- azimuth: 2
------00 08
0030 0------- elevation: 0
D.2 Measure Position Response (GPS Measurements) 217
Acquisition Element:
Options:
-1------ Additional Doppler: true
--1----- Additional Angle: true
---01010 6A
-------0 3E
0012 0------- Not Measured
-000000- Pseudo Range RMS Error: 0
GPS Measurement Element:
-------0 00
0013 00101--- Satellite ID: 5
-----101 2D
0014 001----- Carrier Noise Ratio: 41
---00110 26
0015 11110010 F2
0016 000----- Doppler: -18544
---10111 17
0017 00111--- Whole Chips: 743
-----000 38
0018 10111011 BB Fractional Chips: 187
Multi Path Indicator
0019 00------ Not Measured
--000000 00 Pseudo Range RMS Error: 0
GPS Measurement Element:
0020 011001-- Satellite ID: 25
------10 66
0021 1011---- Carrier Noise Ratio: 43
----0100 B4
0022 11010010 D2
0023 1010---- Doppler: -13014
----1110 AE
0024 010110-- Whole Chips: 918
------00 58
0025 01110111 77
0026 0------- Fractional Chips: 238
Multi Path Indicator
-00----- Not Measured
---00000 00
0027 0------- Pseudo Range RMS Error: 0
[SNIP] – Various satellites removed from GPS TOW Assist for compactness
Reference Location:
------01 E1
0044 101----- Length: 13
Geographic Shape
---1001- Type of Shape: Ellipsoid point with
altitude and uncertainty Ellipsoid
-------0 B2
0045 000-----
Point:
---10110 16
0046 00011110 1E
0047 00001000 08
0048 010----- Latitude: 34.409888 to
34.409899 degrees south
---01101 4D
0049 01101001 69
0050 01011000 58
0051 100----- Longitude: 150.879450 to
150.879471 degrees east
---00000 80
0052 00000100 04
0053 000----- Altitude: 32 to 33 meters above
the ellipsoid
---0----
Major axis uncertainty:
----0101 05
220 Appendix D
----1000 B8
0091 10110001 B1
0092 0011---- CUC: 2835
----0000 30
0093 00101101 2D
0094 10011000 98
0095 11010110 D6
0096 1011---- E: 47811947
----1001 B9
0097 00011111 1F
0098 1000---- CUS: 4600
----1010 8A
0099 00010000 10
0100 11011101 DD
0101 10000101 85
0102 1010---- A power half: 2702039130
----0010 A2
0103 01101010 6A
0104 1100---- TOE: 9900
----0--- Fit Flag: 0
-----111 C7
0105 11------ AODA: 31
--011111 DF
0106 11111000 F8
0107 01------ CIC: -31
--000010 42
0108 01111111 7F
0109 11111100 FC
0110 01000100 44
0111 11------ Omega A0: -1979715309
--100000 E0
0112 00010001 11
0113 11------ CIS: 71
--101001 E9
0114 11001110 CE
0115 00111000 38
0116 11110110 F6
0117 10------ IO: 658039770
--100110 A6
0118 10111111 BF
0119 11------ CRC: 6911
--000011 C3
0120 01101001 69
0121 01100100 64
0122 11001001 C9
0123 11------ W: -1918528729
--011111 DF
0124 11101010 EA
0125 00110001 31
0126 01------ Omega ADot: -22331
--100000 60
0127 00111101 3D IDot: 61
More Assistance Data To Be Sent:
0128 1------- More assistance data to be sent.
223
224 List of Acronyms and Abbreviations
latitude
longitude
universal gravitation parameter
229
Glossary
Accuracy The distance between the calculated location and the
ground truth.
A-GPS handset A handset that is capable of performing A-GPS. It con-
nects to the A-GPS server over the network and requests
GPS assistance data. Assistance data is specific to the
handset’s approximate location. The handset uses the
assistance data to lock onto the satellites and either calcu-
late its own location or return the measurements to the
server for it to calculate the location.
Autonomous GNSS fix A fix where the GNSS handset receives no assistance data
from a server; also known as a stand-alone fix.
C/A code The C/A code consists of the satellite’s PRN modulated
with the navigation message. It is 1,023 bits long and
repeats each millisecond. Code-division-multiplexing
techniques allow the handset to differentiate between the
satellites, even though they transmit on the same fre-
quency. The C/A code is the PRN with the Modulo-2
addition of the navigation data bits, which are included
in the sequence at 50 bps.
Cartesian coordinate A linear system with the origin at a certain fixed point
system with three axes defined that are perpendicular to each
other. A point in space in the Cartesian coordinate system
is defined relative to the origin and is in the form of (x, y,
z).
Cold start The handset having no prior information about the
GNSS constellation.
Confidence A percentage value that expresses the confidence that the
true location is within the calculated uncertainty. When
the confidence is increased, the size of the uncertainty
area is increased.
Ellipsoid point with The most common representation of a GNSS-based loca-
altitude and uncertainty tion. Latitude and longitude are points on the surface of
ellipse the ellipsoid, altitude is relative to the surface of the ellip-
soid, and the uncertainty is expressed as an ellipse on the
surface of the ellipsoid. The uncertainty ellipse is pro-
vided at a given confidence level.
231
232 Glossary
Ellipsoidal (or geodetic) A system with the origin at a fixed point and with loca-
coordinate system tions defined on the ellipsoid as latitude, longitude, and
height.
Fix The process of determining the location of a handset
from a set of measurements.
GERAN The radio part of GSM/EDGE together with the network
that joins the base stations.
GPS L1 The primary civilian frequency transmitted at 1,575.42
MHz.
Handset A device that is in use by someone wanting to know his or
her location. It could be a cell phone, a handheld com-
puter, or even just a laptop connected to the Internet.
Handset-assisted The handset makes the measurements and returns them
to the server that does the position calculation.
Handset-based The handset makes the measurements and performs the
position calculation.
MS The name for the A-GNSS-enabled handset in a GSM
network.
NAV message The navigation message signal broadcast on GPS L1. The
NAV message allows the handset to determine the status
of the constellation, the satellite’s time of transmission,
its health, its clock correction, its position, and the time
conversion from GPS to UTC.
Octet An octet is 8 bits.
Position calculation A module or element that calculates the location of a
function (PCF) handset, given a set of measurements.
PRN code Each satellite has a unique PRN code sequence which is
1,023 bits in length and provides the method to identify
each individual satellite. Each sequence is a 1,023-bit
gold code.
QoS/QoP The terms quality of service (QoS) and quality of position
(QoP) are often used interchangeably within different
standards to mean the same thing in the context of a loca-
tion calculation. The QoS/QoP define the requirements
for the accuracy and the allowed time for the LS to per-
form a location calculation. For example, the LBA may
request the location of a certain handset with a horizontal
uncertainty of less than 20 meters within a time limit of
30 seconds.
Satellite-based A measurement based on information transmitted from a
measurement satellite.
SET The name for the A-GNSS-enabled handset for SUPL.
Single point A position calculation being performed using a single
positioning (SPP) point in time; it may include measurements form more
than one GNSS frequency (more than one set of signals).
Glossary 233
235
Index
A GBAS, 3
Accuracy, 5, 10–11, 58–59, 117, 122–123 Geodetic coordinates, 20–21, 23–27
Acquisition, 35, 54, 76, 77 Geometric range correction, 126, 132–133
Acquisition assistance, 9, 81–86, 87 Geometry matrix (H), 125, 139, 140, 147, 163
A-GNSS, 1, 5, 6, 9–10, 192–197 GERAN, 64, 90, 92, 185
A-GPS, 1, 63–88 GLONASS, 2, 50, 97, 194, 196, 198, 199
Almanac, 9, 44, 54, 86 GMLC, 9, 65, 72, 74, 91, 92
ASN.1, 91, 95–104, 117 GNSS Reference Server (GRS), 6, 7, 63, 65–70,
Assistance data, 1, 6–8, 9, 63–65, 76–88, 92, 77, 79, 86, 200
197, 198 GPS L1, 37, 38
Assistance data size, 87 GPS L2, 36–37, 38–39, 67, 92
Augmentations, 3, 193, 195, 197 GPS measurement, 5, 45, 92, 98, 114, 122,
127
C GPS time, 39
C/A code, 10, 36, 37, 38, 39, 82, 86, 197 GRIP, 70, 71
CDMA, 2, 3, 9, 72, 91, 194, 195 GSM, 6, 78, 91, 93, 168
CNAV, 37, 38–39, 96
H
Code coverage, 30–31
Code phase, 8, 41, 81–83, 92, 121, 123 Handover word (HOW), 40, 77, 78
Compass, 2, 195 Handset, 2–5, 7, 54, 64, 72, 76, 92
Confidence, 10, 56–58, 75, 143 Handset clock error, 5, 124–125, 134, 140,
Configuration management, 32 143, 149, 163, 169
Coordinate reference frame, 17, 132, 194 Handset-assisted, 1, 76, 81, 92, 121, 153, 167
188
D Handset-based, 1, 76. 92, 185, 198
Differential-GPS (DGPS), 9, 59–60, 69, 86, 87 Hybrid, 150, 167
Dilution of precision (DOP), 59, 123, 146, 202
I
Doppler, 81–84, 121, 146, 187–188
Integrated development environment (IDE), 13
E Integrated time recovery, 163
E2 interface, 65, 73, 75, 91 International GNSS Service (IGS), 53, 183
E9-1-1, 11, 92 IODE, 42, 43, 65, 98
ECEF coordinates, 19–21, 23, 42, 73, 83, 96 Ionosphere, 79, 136, 184
EGNOS, 3, 196, 198 IRNSS, 197
Emergency Services Protocol, 75 Iterative time recovery, 156
Emma, 30
J
Ephemeris, 4, 6, 39, 40, 42, 49, 51, 65, 79,
126 Java, 12–14, 22, 23–32
ESME, 64, 65, 72, 75, 91 Javadoc, 13, 14, 24, 107
JUnit, 23, 28, 110,
G
L
GAD specification, 10, 75, 79, 87, 103, 199
GAGAN, 3, 97, 197, 198 Least squares, 57, 126, 128, 138–143, 149,
Galileo, 2, 10, 92, 96, 194–195, 197, 199, 200 156, 163, 165, 168, 188
237
238 Index
Location information server (LIS), 9, 10, 72, 91 Reference location, 8, 9, 79, 87, 94, 96, 114,
Location integrity, 126, 185–189 199
Location server, 62, 64, 71–73 Reference time, 8, 9, 64, 71, 77–78, 87, 94,
Location-based application (LBA), 8, 64–65, 96, 99, 153, 193
73–75, 185, 187 Residuals, 145, 146, 154, 156, 188
Location-based services, 11 RINEX file format, 50–51, 53, 65, 69, 71,
127, 128, 133, 160
M RRC, 9, 10, 64, 72, 91, 92, 93, 114, 197
Master Control Station, 35, 41, 196 RRLP, 9, 10, 64, 72, 78, 91, 92–114, 197,
Maven, 13, 22, 23, 24, 28, 30, 110 198–201
Measurement errors, 5, 45, 56, 58–59, 143, RRLP Measure position request, 93–96, 98,
183–185 99, 100, 101, 102, 104, 105
Mobile Location Center (MLC), 9, 11, 65, 72, RRLP Measure position response, 93, 95, 98,
73, 74, 91 100
Mobile Location Protocol (MLP), 64, 65, 73, RTT, 6, 115, 116, 168, 173, 177, 179, 185,
74, 92, 185 200
Mobile Positioning Center (MPC), 65, 74, 91
Multipath error (NLOS), 5, 8, 58, 59, 122, S
135 SAS, 9, 64, 72, 91, 114, 115, 168
Satellite clock correction, 4, 41, 59, 65, 126,
N 130–132, 195
NAES, 65, 73, 75, 90 Satellite constellation, 2, 3, 35, 39, 71, 86, 194
NAV message, 4, 9, 37, 38, 39–51, 76, 78, 98, Satellite elevation, 73, 83, 123, 126, 134–136,
124, 127, 132, 187, 195 141
Navigation model, 8, 9, 49, 63, 71, 79, 80, 87, Satellite group delay, 41, 80, 126, 132
96, 200 Satellite health, 4, 38, 41, 65, 126, 129–130
Satellite location, 53, 126, 131, 136
O
Satellite orbit, 2, 3, 4, 36, 41, 80, 183
OSGRS, 70–71 SBAS, 3, 96, 87, 197, 198, 199, 201
P Serving cell, 5, 8, 9, 64, 72, 77, 79, 87, 116
SLP, 9, 10, 72, 76, 91, 92, 146, 197
PCAP, 9, 64, 72, 77, 78, 91, 114–117, 168, SMLC, 9, 64, 72, 91, 92, 93, 94, 95
197 Socket, 110–114
Performance testing, 29 SP3, file format 53
Position calculation, 121–150 Spoofing, 186–189
PRN, 4, 37, 38, 40, 54, 77, 78 SSR, 145, 154, 156, 159
Protocol, 7, 9, 64, 71, 91, 92, 197 Standards, 7, 9–10, 64, 72, 91, 92
Pseudomeasurement, 134 Subframe, 4, 39–46, 47–48, 64, 69, 78
Pseudorange, 54, 121, 123, 124, 125, 128, SUPL, 9, 10, 72, 91, 92, 93, 188, 189
130, 193
Public Safety Answering Point (PSAP), 11, 65, T
75 Telemetry word (TLM), 40, 77, 78
Q Time recovery, 77, 153–166
Time server (NTP), 6, 7, 64, 73, 78, 153
Quality of Position (QoP), 65, 74, 116, 117 Timing Advance (TA), 6, 168, 173, 177
QZSS, 96, 170, 195–196, 198, 199, 201 Troposphere, 5, 58, 126, 137–138, 184, 188
R TTFF, 1, 4, 5, 63, 91
Radio Access Network (RAN), 72, 76, 87 U
Ranging signal, 2, 3, 35, 36, 38, 121 UMTS, 6, 9, 91, 168, 178,
Real-time integrity, 8, 9, 71, 77, 86, 87, 96, Uncertainty, 8, 10, 55, 56–58, 59, 64, 74, 79,
130 82, 103, 143–145
Index 239
Unit test, 22, 23, 27–28, 29, 30, 31, 47, 52, W
110 WAAS, 3, 97, 196, 198
Userplane Location Protocol (ULP), 10, 76, 93 Weight matrix (W), 126, 138, 141, 142
UTC model, 4, 8, 9, 39, 44, 71, 78, 80–81, WGS, 84 10, 17, 18–21, 23–27, 42, 67, 73,
87, 96, 153, 201 127
UTDOA, 6, 173, 179
UTRAN, 64, 72, 78, 91, 114, 168, 173, 177
The GNSS Technology and Applications Series
For further information on these and other Artech House titles, including
previously considered out-of-print books now available through our
In-Print-Forever® (IPF®) program, contact: