matlab gps software toolbox user's guide and reference manual

227
GPS MATLAB GPS SOFTWARE TOOLBOX USER'S GUIDE AND REFERENCE MANUAL -- VERSION 3.01 -- Copyright 1996-2001 by Lupash Consulting. All Rights Reserved Worldwide.

Upload: petre-alex

Post on 28-Dec-2015

215 views

Category:

Documents


8 download

TRANSCRIPT

Page 1: MATLAB GPS Software Toolbox User's Guide and Reference Manual

GPS

MATLAB GPS SOFTWARE TOOLBOX

USER'S GUIDE AND REFERENCE MANUAL

-- VERSION 3.01 --

Copyright 1996-2001 by Lupash Consulting. All Rights Reserved Worldwide.

Page 2: MATLAB GPS Software Toolbox User's Guide and Reference Manual

COPYRIGHT NOTICE

Copyright 1996-2001 by Lupash (LL) Consulting. All Rights Reserved Worldwide.This software and related documentation are fully protected by the United Statescopyright law. No part of this software and publication may be copied or distributed,transmitted, transcribed, stored in a retrieval system, or translated into any human orcomputer language, in any form and by any means, electronic, mechanical, magnetic,manual, or otherwise, or disclosed to third parties without the express writtenpermission of Lupash (LL) Consulting, 2625 Monterey Pl., Fullerton, CA 92833.

TRADEMARK ACKNOWLEDGEMENTS

MATLAB is a registered trademark of The MathWorks, Inc.

IBM Personal System/2, OS/2, and IBM PC/XT/AT/386/486 are trademarks of IBMCorporation.

MS-DOS, Microsoft FORTRAN, Microsoft C/QuickC and Microsoft Pascal aretrademarks of Microsoft Corporation.

Pentium is a registered trademark of Intel Corporation.

DISCLAIMER OF WARRANTY

We have made every effort to verify that GPS TOOLBOX software is working properly.However, the software and manual are sold "as is" and without warranties as toperformance or merchantability. LL Consulting shall have no liability or responsibility ofany kind, including special, indirect or consequential damages, arising out of or resultingfrom such software or the use or modification thereof. In no event shall LL Consulting beliable or responsible for any problems that arise from the use of the GPS TOOLBOXsoftware and manual. This statement shall be construed, interpreted, and governed by thelaws of the state of California.

Page 3: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Preface

- Page iii -

PREFACE

Your Global Positioning System (GPS) engineering support software requirements can bemet efficiently, yet inexpensively, by using the MATLAB GPS Toolbox library ofGPS related m-file modules/programs developed by Lupash Consulting.

This software allows you to perform a variety of mathematical, scientific, and engineeringcalculations related to the GPS applications quickly and easily, and it can help youincrease your productivity and improve your competitive position without effort -- at aprice you can afford.

Known as GPS Toolbox, Lupash Consulting's library of GPS related m-files supports afull range of mathematical and engineering operations required by the implementation ofthe GPS applications. It uses MATLAB environment and is operational on IBM PersonalSystem 2, IBM PC/XT/AT/386/486/Pentium and compatibles.

The current Version 3.x of GPS TOOLBOX library can interface with the entire range ofMathWorks’ toolboxes and by using MATLAB compilers you can generate highperformance C code from MATLAB m-files. GPS Toolbox gives you dozens of functionsfor specific GPS applications, providing an integrated set of tools to speed up yourdevelopment and optimize your designs.

Manual Organization

This User's Guide and Reference Manual documents the architecture, functional designand operational characteristics of GPS Toolbox.

Section 1.0, Getting, Started provides you with general information about the package.

Section 2.0, Architectural Overview and Functional Description, summarizes GPSToolbox architecture and functional setup. Functional Description provides you with astructured, top-down, hierarchical description of the functional modules. Also includedare the library design specifications and list of functions by topics (see Tables 2-1).

Section 3.0, GPS Toolbox Examples, shows you how to use some m-file main programscontained in the GPS Toolbox into your applications; all programs are ready to be used,including input data sets. Furthermore, you can use the examples included herein asstarters for your own programs -- a quick and easy way to develop applications.

Section 4.0, Detailed Specifications for GPS Toolbox m-file modules, gives you, for eachGPS Toolbox m-file/module function listed in alphabetical order, the complete sequenceof calling parameters, functional specifications, operating instructions and other technicaldetails that will help you benefit from this powerful engineering and scientific supportlibrary. Sections 5, Detailed Specifications for GPS Toolbox main programs, follows theformat used in section 4 for documentation of all main programs.

Page 4: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Preface

- Page iv -

Section 6.0 provides you with technical references. Appendix A includes a complete listof functions and input/output files in alphabetical order. Finally, a user registration formis included.

Language Implementation and MATLAB environment

MATLAB is a high performance interactive software environment for scientific andengineering computation and visualization. It is a complete integrated system, wellbeyond “matrix laboratory”, including graphics, programmable modules, a fastinterpreter, many analytical commands, and a possibility to generate high performance C-code from m-files by using a MATLAB compiler. In MATLAB environment problemsolutions are expressed almost exactly as they are written mathematically. In industrialsettings, MATLAB is used for research and to solve practical engineering andmathematically problems.

MATLAB has been acclaimed for many of its features and, in particular, for its ability toallow engineers and scientists to implement algorithms efficiently. It is the environmentof choice for more than 200,000 technical professionals in industry and research aroundthe world.

In order to preserve the clarity and readability of the m-files, we elected to translatealmost literally the software design algorithms into self-documented code. We tried to beconsistent both in the layout of the programs and in the selection of the variable names.Where necessary, comments are added to further increase the readability of the code. Inaddition, the m-files were written such that they can be easily translated into otherlanguages, thus extending usefulness to other programming environments.

Version 3.x of GPS TOOLBOX replaces the earlier Version 2.x and incorporates morethan 200 m-files (modules and programs) as well as reference input/output data files,which greatly expand the capabilities of its predecessor. All m-files are compatible withMATLAB version 4.0 or higher, and most of them are also compatible with version 3.5and Student Edition of MATLAB, exceptions are few main programs

We are confident at this point that the old m-file functions are virtually bug-free, andhope that the newly added m-files (modules and main programs) follow the same pattern.Should we identify any problems, we will keep you updated through our TechnicalAssistance and Product Maintenance service. The source code is royalty free, i.e. the usercan incorporate this software in his/her particular application but is not permitted to resellthe software as is or with changes.

Lawrence Lupash, Ph.D.Lupash (LL) Consulting2625 Monterey PlaceFullerton, CA 92833-2084USA

Page 5: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Table of contents

- Page v-

TABLE OF CONTENTS

Preface ...................................................................................................................... iiiTable of contents ...................................................................................................... v

1.0 Getting started ........................................................................................................1-11.1 Package............................................................................................................1-11.2 Installation. ......................................................................................................1-11.3 How to use the MATLAB GPS Toolbox ........................................................1-2

2.0 Architectural overview and functional description ............................................2-12.1 Library architecture ..........................................................................................2-12.2 Functional highlights........................................................................................2-22.3 Functional description ......................................................................................2-3

2.3.1 GPS related constants and conversion factors .......................................2-42.3.2 Angle transformations............................................................................2-42.3.3 Coordinate transformations ...................................................................2-4 (1) Point transformations ......................................................................2-4 (2) Matrix transformations....................................................................2-5 (3) Vector transformations....................................................................2-52.3.4 Specialized plotting programs ...............................................................2-52.3.5 Specialized statistics related functions ..................................................2-62.3.6 GPS time utilities...................................................................................2-62.3.7 Specialized GPS data processing functions ...........................................2-62.3.8 Trajectory and related utilities ...............................................................2-72.3.9 Satellite position computation ...............................................................2-72.310 Elevation and azimuth determination and satellite visibility................2-82.3.11 DOPs computation, satellite selection and related functions...............2-82.3.12 Special signal processing and Kalman filtering functions...................2-82.3.13 Pseudorange and deltarange determination and related functions .......2-92.3.14 Determination of user’s position and related functions .......................2-92.3.15 RAIM/FDE availability and integrity evaluation and related functions ...........................................................................................................2-10

2.4 List of functions by topics ..............................................................................2-10

3.0 GPS Toolbox Examples .........................................................................................3-13.1 Matrix coordinate transformation generation...................................................3-23.2 Generation of a first order Gauss-Markov process ..........................................3-43.3 Generation of a second order Gauss-Markov process......................................3-63.4 Covariance analysis by using the conventional and alternate conventional Kalman filter formulation................................................................................3-93.5 GPS time related utility transformations ........................................................3-103.6 Read Yuma format almanac file and generate two ASCII data only files......3-123.7 Read RINEX 2 navigation message and generate three data files..................3-133.8 Determination of the WGS-84 geoid height correction .................................3-14

Page 6: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Table of contents

- Page vi

3.9 Generation and plotting of the longitude-latitude WAAS grid ......................3-153.10 Determination of geodesic based on departure and destination points ........3-163.11 Determination of great circle dead reckoning trajectory ..............................3-193.12 Determination of acceleration from the input time/position/velocity data and execution of relevant trajectory plots ....................................................3-203.13 Determination of satellite position based on almanac/ephemeris data.........3-243.12 Determination of azimuth and elevation angles and execution of related plots ..............................................................................................................3-273.15 Determination of DOP quantities and execution of contour plots ...............3-323.16 Satellite selection based on minimum GDOP criteria..................................3-363.17 Determination of iono correction and execution of related graphs ..............3-383.18 Determination of tropospheric delay correction...........................................3-423.19 Determination of user clock errors...............................................................3-433.20 Determination of multipath error .................................................................3-443.21 Determination of user earth rotation error....................................................3-453.22 Computation of position fix through direct and iterative methods ..............3-463.23 Evaluation of weighted least square navigation solution .............................3-483.24 GPS RAIM integrity evaluation ...................................................................3-513.25 Determination of thresholds used in RAIM/FDE evaluations .....................3-533.26 RAIM fault detection availability determination .........................................3-563.27 RAIM fault exclusion availability determination.........................................3-613.28 GPS error budget determination...................................................................3-65

4.0 Detailed specifications for GPS Toolbox m-file modules....................................4-14.01 CEP ................................................................................................................4-14.02 CHI2_DOF .....................................................................................................4-14.03 CONVCON ....................................................................................................4-14.04 DHMAX.........................................................................................................4-24.05 DOP1..............................................................................................................4-34.06 DOP2..............................................................................................................4-34.07 ELEVA...........................................................................................................4-34.08 ELEVAR ........................................................................................................4-44.09 ELEVAZ ........................................................................................................4-44.10 ELIMCOL ......................................................................................................4-54.11 ELIMROW.....................................................................................................4-54.12 FDNT .............................................................................................................4-54.13 FOM ...............................................................................................................4-64.14 FPBIAS_C......................................................................................................4-64.15 FPBIAS_G......................................................................................................4-74.16 GAUSS_1.......................................................................................................4-74.17 GCNAV..........................................................................................................4-84.18 GDOPV ..........................................................................................................4-84.19 GENRN ..........................................................................................................4-94.20 GEODES ........................................................................................................4-94.21 GEOIDH.........................................................................................................4-9

Page 7: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Table of contents

- Page vii

4.22 GMP1 ...........................................................................................................4-104.23 GMP2 ...........................................................................................................4-104.24 GPSCON ......................................................................................................4-114.25 GPSLSEC.....................................................................................................4-114.26 GRIDWAAS ................................................................................................4-124.27 HMAT ..........................................................................................................4-124.28 HMATB .......................................................................................................4-124.29 HMATBC.....................................................................................................4-134.30 HMATC .......................................................................................................4-134.31 HPE ..............................................................................................................4-144.32 IONOC .........................................................................................................4-144.33 IONOCON....................................................................................................4-154.34 KFCOV ........................................................................................................4-154.35 KFCOVA .....................................................................................................4-164.36 MBLLW .......................................................................................................4-174.37 MCUD..........................................................................................................4-174.38 MECEFECI ..................................................................................................4-184.39 MECEFENU ................................................................................................4-184.40 MECEFINS ..................................................................................................4-184.41 MECEFLLW ................................................................................................4-194.42 MECIECEF ..................................................................................................4-194.43 MENUECEF ................................................................................................4-204.44 MENULLW..................................................................................................4-204.45 MINSECEF ..................................................................................................4-204.46 MLLWB .......................................................................................................4-214.47 MLLWECEF................................................................................................4-214.48 MLLWENU..................................................................................................4-224.49 MREAST......................................................................................................4-224.50 MSC2F .........................................................................................................4-224.51 MSF2C .........................................................................................................4-234.52 MUDC2F......................................................................................................4-234.53 MUDD..........................................................................................................4-244.54 MUDF2C......................................................................................................4-244.55 MUDM.........................................................................................................4-244.56 MUDM1.......................................................................................................4-254.57 NCCHI2_10 .................................................................................................4-264.58 NCCHI2_2 ...................................................................................................4-274.59 NCCHI2_3 ...................................................................................................4-274.60 NCCHI2_4 ...................................................................................................4-274.61 NCCHI2_5 ...................................................................................................4-284.62 NCCHI2_6 ...................................................................................................4-284.63 NCCHI2_7 ...................................................................................................4-294.64 NCCHI2_8 ...................................................................................................4-294.65 NCCHI2_9 ...................................................................................................4-294.66 PIONOC .......................................................................................................4-30

Page 8: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Table of contents

- Page viii

4.67 PRADR ........................................................................................................4-304.68 PZ90CON.....................................................................................................4-314.69 QRUPA ........................................................................................................4-324.70 RAIMFD ......................................................................................................4-324.71 RAIMST.......................................................................................................4-334.72 RANGE. .......................................................................................................4-344.73 RMS .............................................................................................................4-344.74 RMS2 ...........................................................................................................4-344.75 RSS...............................................................................................................4-354.76 RSSXY.........................................................................................................4-354.77 RWALK .......................................................................................................4-354.78 SDOP............................................................................................................4-364.79 SELECTD ....................................................................................................4-364.80 SG85CON ....................................................................................................4-374.81 SLOPEMAX ................................................................................................4-374.82 STATUP.......................................................................................................4-384.83 SVPALM......................................................................................................4-384.84 SVPEPH.......................................................................................................4-394.85 SVSEL4........................................................................................................4-394.86 SVSEL5........................................................................................................4-404.87 SVSEL6........................................................................................................4-414.88 SWDOP........................................................................................................4-414.89 TADMSRAD ...............................................................................................4-424.90 TARADDMS ...............................................................................................4-424.91 TECEFGD....................................................................................................4-424.92 TECEFGD2.................................................................................................4-434.93 TGDECEF...................................................................................................4-434.94 TIMETR ......................................................................................................4-444.95 TRAJS .........................................................................................................4-444.96 TROPOC1 ...................................................................................................4-454.97 UCLOCK ....................................................................................................4-454.98 UERCOR.....................................................................................................4-464.99 UPOSD4......................................................................................................4-464.100 UPOSDG....................................................................................................4-474.101 UPOSIT......................................................................................................4-474.102 UVERV ......................................................................................................4-474.103 VBLLW......................................................................................................4-484.104 VECEFECI ..............................................................................................4-484.105 VECEFENU...............................................................................................4-494.106 VECEFGD .................................................................................................4-494.107 VECEFINS.................................................................................................4-504.108 VECEFLLW...............................................................................................4-504.109 VECEFP90................................................................................................4-504.110 VECEFS85................................................................................................4-514.111 VECIECEF................................................................................................4-51

Page 9: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Table of contents

- Page ix

4.112 VENUECEF...............................................................................................4-524.113 VENUGD...................................................................................................4-524.114 VENULLW ................................................................................................4-524.115 VEP ............................................................................................................4-534.116 VGDECEF .................................................................................................4-534.117 VGDENU...................................................................................................4-544.118 VINSECEF.................................................................................................4-544.119 VLLWB......................................................................................................4-554.120 VLLWECEF...............................................................................................4-554.121 VLLWENU ................................................................................................4-564.122 VP90ECEF.................................................................................................4-564.123 VS85ECEF.................................................................................................4-564.124 WDOP1 ......................................................................................................4-574.125 WDOP2 ......................................................................................................4-574.126 WDOPV .....................................................................................................4-584.127 WGS72CON ..............................................................................................4-584.128 WGS84CON ..............................................................................................4-59

5.0 Detailed specifications for GPS Toolbox m-file main programs........................5-15.01 XAMBIG........................................................................................................5-15.02 XATRANS.....................................................................................................5-15.03 XCEPVEP. .....................................................................................................5-25.04 XCON.............................................................................................................5-25.05 XDOP.............................................................................................................5-35.06 XEBUDGET ..................................................................................................5-35.07 XECEF2GD_COMP ......................................................................................5-45.08 XELAZ...........................................................................................................5-55.09 XELIMRC......................................................................................................5-65.10 XFDNT...........................................................................................................5-65.11 XFOM ............................................................................................................5-75.12 XGCDR..........................................................................................................5-75.13 XGCNAV.......................................................................................................5-85.14 XGDOPV .......................................................................................................5-85.15 XGENRN .......................................................................................................5-95.16 XGEODES ...................................................................................................5-105.17 XGEOIDH....................................................................................................5-105.18 XGMP1 ........................................................................................................5-115.19 XGMP2 ........................................................................................................5-125.20 XGPSLSEC..................................................................................................5-125.21 XGPSTIME..................................................................................................5-135.22 XGRIDW .....................................................................................................5-135.23 XHMATALL................................................................................................5-145.24 XHPE ...........................................................................................................5-145.25 XIONOC ......................................................................................................5-155.26 XKFCOV .....................................................................................................5-16

Page 10: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Table of contents

- Page x

5.27 XMAPDOP ..................................................................................................5-175.28 XMISDAT....................................................................................................5-185.29 XMPATH.....................................................................................................5-185.30 XMTRANSF ................................................................................................5-195.31 XMUDDU....................................................................................................5-205.32 XMUD..........................................................................................................5-205.33 XOPCR ........................................................................................................5-215.34 XPBAR.........................................................................................................5-225.35 XPBIAS........................................................................................................5-225.36 XPELAZA....................................................................................................5-235.37 XPELAZS ....................................................................................................5-245.38 XPPFWLS....................................................................................................5-255.39 XPPVA.........................................................................................................5-265.40 XPPVAJ .......................................................................................................5-265.41 XPPRADR ...................................................................................................5-275.42 XPTRANSF .................................................................................................5-285.43 XQRUPA .....................................................................................................5-295.44 XRAIMDA...................................................................................................5-295.45 XRAIMEA ...................................................................................................5-315.46 XRAIMFD....................................................................................................5-325.47 XRAIMST....................................................................................................5-325.48 XREADALM ...............................................................................................5-335.49 XRINEXN....................................................................................................5-345.50 XRWALK ....................................................................................................5-355.51 XSAERR ......................................................................................................5-355.52 XSDOP.........................................................................................................5-365.53 XSLOPE.......................................................................................................5-365.54 XSORTREC.................................................................................................5-375.55 XSTAT.........................................................................................................5-375.56 XSTATC ......................................................................................................5-385.57 XSVPALM...................................................................................................5-385.58 XSVPCOMP ................................................................................................5-395.59 XSVPEPH ....................................................................................................5-405.60 XSVSEL.......................................................................................................5-415.61 XSWDOP.....................................................................................................5-425.62 XTRAJS .......................................................................................................5-425.63 XTROPOC1 .................................................................................................5-435.64 XUCLOCK...................................................................................................5-435.65 XUERCOR...................................................................................................5-445.66 XUPOSD4....................................................................................................5-455.67 XUPOSDG...................................................................................................5-465.68 XUPOSIT .....................................................................................................5-465.69 XVTRANSF.................................................................................................5-475.70 XWDOP .......................................................................................................5-485.71 XWDOPV ....................................................................................................5-49

Page 11: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Table of contents

- Page xi-

5.72 XYP1............................................................................................................5-495.73 XYP1S..........................................................................................................5-505.74 XYP2W ........................................................................................................5-515.75 XYP3W ........................................................................................................5-515.76 XYPC2 .........................................................................................................5-525.77 XYPC2RSS ..................................................................................................5-535.78 XYPM ..........................................................................................................5-535.79 XYPRSS.......................................................................................................5-545.80 XYPRSS2W.................................................................................................5-545.81 XYPPVSTD .................................................................................................5-55

6.0 References ...............................................................................................................6-1

Appendix A. List of functions and input/output files in alphabetical order ........7-1 A.1 List of modules .............................................................................................7-1 A.2 List of main programs ..................................................................................7-4 A.3 List of input files ..........................................................................................7-5 A.4 List of output files ........................................................................................7-7 A.5 List of input and output mat-files .................................................................7-8

Registration form ...........................................................................................................8-1

Page 12: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Table of contents

- Page xii-

Page 13: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 1 Getting Started

- Page 1-1 -

1.0 GETTING STARTED

1.1 Package summary

The GPS TOOLBOX package includes software documentation and program diskette.The documentation consists essentially of the USER'S GUIDE AND REFERENCEMANUAL.

The software, referred as the GPS TOOLBOX, is provided on 3"1/2 diskette. Thefollowing files or subdirectories are included:

• GPSMOD.M; this subdirectory contains the GPS TOOLBOX m-files modules(source code),

• GPSPRG.M; this subdirectory contains the GPS TOOLBOX m-files main programs(source code),

• GPSINP.DAT; this subdirectory contains the GPS TOOLBOX input ASCII data files(*.dat) for main programs,

• GPSOUT.OUT; this subdirectory contains the GPS TOOLBOX output data filesgenerated by executing the main and programs with input data files specified in thesubdirectory GPSINP.DAT

• GPSIO.MAT; this subdirectory contains the GPS TOOLBOX input/output mat-files(*.mat) compressed using PKZIP,

• README.TXT (optional); this file contains notes about current version, includingchanges and upgrades.

The README.TXT file may contain changes and additions, if any, which are notincluded in this manual. If a README.TXT file is included, be sure to read it before youuse the software. In case of conflict between the manual and the README.TXT file, thelatter takes precedence. The GPS TOOLBOX software package version 3.x is fully compatible with earlierversions and can interface with the entire range of MATLAB toolboxes or personalapplication-dependent m-files. At the same time, by using MATLAB compilers one cangenerate high performance C code from MATLAB application-dependent m-files, and,therefore, an efficient executable program can be created by using mixed m-files and C/FORTRAN/ Pascal modules. 1.2 Installation To install GPS TOOLBOX, the first thing you should do is to make a copy of thedistribution diskettes, and store the original diskettes in a safe place. You are free to makebackup copies, however, we ask you not to give any of these copies to anyone else.

Page 14: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 1 Getting Started

- Page 1-2 -

To make the GPS Toolbox m-files accessible to other MATLAB programs copy the fileGPSMOD.M into the desired area. If you want to check directly some examples install the files included in the subdirectoryGPSPRG.M and run one of the main programs listed in this directory; depending on themain program used additional m-files modules maybe required as well as input data fromthe subdirectory GPSINP.DAT. A complete list of main programs and referencedinput/output files is listed in Table 2-1. This software is not copy protected. However, you are authorized to make back-up copiesof the software for your archives only, for the sole purpose of protecting your investmentfrom loss. You are free to move this software from one computer location to another aslong as there is no possibility of it being used at two locations at one time. 1.3 How to use the GPS TOOLBOX In order to use the GPS TOOLBOX software we recommend the following steps: • create a directory called GPSTOOL, and insert this name into path• copy the m-file modules from GPSMOD.M into the directory GPSTOOL• copy the m-file main programs from GPSPRG.M into the directory GPSTOOL• optional, copy the input data files from GPSINP.DAT and GPSMAT.MAT into the

directory GPSTOOL• optional, copy the output data files from GPSOUT.DAT into the directory GPSTOOL

In a specific application program you need to call only a few of the GPS TOOLBOX m-file modules, and only the modules you call are linked to your program.

When linking GPS TOOLBOX m-file modules to your application program, you shouldnot define your own subprograms by the same name as any of the modules used in theGPS TOOLBOX.

When you invoke the GPS TOOLBOX library modules from your applications, you mustuse the same order and type for each argument in the calling sequence as indicated in thismanual.

You can develop multi-language applications. For example, you can compile the desiredm-files with the MATLAB compiler to generate C-modules and then link those moduleswith other application dependent C-programs.

Page 15: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 2 Library architecture

- Page 2-1

2.0 ARCHITECTURAL OVERVIEW AND FUNCTIONAL DESCRIPTION

2.1 Library architecture

Consistent with our modular, structured approach to software development andimplementation, GPS TOOLBOX software has been designed as a system rather than as acollection of me-too functions.

This provides the ability to link your applications only with those m-file modules that arereally needed, thus allowing you to reduce the size of your executable modules. This isdone automatically when using GPS TOOLBOX.

As an added benefit, you can also "cut-and-paste" just a few functions if this is what youneed for your applications.

The major building functions of the GPS TOOLBOX can be divided in the followingcategories:

• GPS related constants and conversion factors• Angle transformations• Coordinate transformations

- Point transformation - Matrix transformation generation - Vector transformation

• Specialized plotting programs• Specialized statistics related functions• GPS time utilities• Specialized GPS data processing functions• Trajectory and related utilities• Satellite position computation• Elevation and azimuth determination, and satellite visibility• DOPs computation, satellite selection and related functions• Special signal processing and Kalman filter functions• Pseudorange and deltarange determination, and related functions• Determination of user’s position and related functions• RAIM/FDE availability and integrity evaluation and related functions The m-files are separated in two categories, namely m-file modules and m-file mainprograms. The m-file modules are elementary blocks that are incorporating independentalgorithms and most of the times do not call other elementary blocks; in general, each m-file module is used by one or more main programs and doesn’t have input/output(read/write) interface. The m-file main programs are used as a high level moduleincorporating a specific task, e.g. computation of Receiver Autonomous IntegrityMonitoring fault detection availability.

Page 16: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 2 Functional highlights

- Page 2-2

The functional specifications of these subsystems are provided in section 2.3, whiledetailed descriptions of each m-file module and m-file main programs are given insections 4 and 5, respectively. 2.2 Functional Highlights GPS Toolbox Version 3.x consists of various functional modules that performmathematical services frequently encountered in GPS related engineering calculations. These m-file modules and m-file main programs, referred also as functions, are written inMATLAB language / environment. GPS Toolbox helps you solve many industrial, scientific, and engineering problemsrelated to GPS quickly and easily. This is because: • GPS Toolbox modules are elementary building blocks, thus giving you the flexibility

to combine them in many ways to fit your specific application's needs • these functions are input/output free, except some utilities, so they can be attached to

other application's input and output modules • an open-ended strategy was followed which means that you can either complement

the GPS Toolbox services with functions of your own or, alternatively, use GPSToolbox modules and programs as add-ons in conjunction with other libraries

• the software is written clearly, without gimmicks, and is well documented, thus

making it easy for you to understand the algorithms and to use the code as a startingpoint for your own programs.

• m-file main programs have associated input data files, and therefore are ready to be

used without any additional user’s effort; for benchmark testing the correspon-dingoutput files are included.

The m-file modules together with main programs are intended for multipurpose use as • a simulation tool. It can generate a realistic simulation for numerous aspects of GPS

applications. • a performance analysis tool. It can execute a variety of data analysis functions

including statistics and graphing. • a starting point for user’s GPS related applications. The user can modify existent m-

files to suit a specific application without the need to implement elementary buildingblocks that are implemented in this toolbox.

Page 17: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 2 Functional description

- Page 2-3

In addition, the effort was made to implement the most efficient algorithms available inthe technical literature. When appropriate, more than one module performs the samemathematical computation by using different methods, so you can select the approach thatbest meets your specific requirements. Here is a summary of the most significant features of GPS Toolbox software: • all m-file modules and programs are written in MATLAB language/environment. • all m-file modules are free of input/output statements (except, of course, for those

utilities that require printed output/graph, if any) • all m-file modules are provided with detailed documentation, including scope, usage,

description of parameters, remarks/notes, references, external Matlab macros used,and date of last update.

• all m-file main programs are provided with detailed documentation, including scope,

usage, list of inputs, list of outputs, references, external Matlab macros used, and dateof last update.

2.3 Functional description

The functions included in the GPS TOOLBOX are divided in several categories, each oneis described in a separate paragraph. Each function contains both m-file modules and m-file main programs.

As naming conventions, the name of a main program starts with the letter “X”, and theinput/output data files associated with a specific main program, when possible, have thesame name except the extensions. The convention used for the extension is as follows:“dat” for input files, “out” for output files, “mat” for input/output mat-files, and “m” form-files.

All m-files are presented in alphabetic order in sections 4 for modules and 5 for mainprograms. A complete list of functions based on subjects is included in section 2.4Section 3 contains numerous representative examples, including detail related to the inputand output files.

Appendix A includes a complete list of all functions, i.e. modules and main programs,and input/output files by alphabetical order.

Overall, there are more than 200 m-files (modules and main programs), and about 100input *.dat files, output *.out files, and input/output *.mat files.

Page 18: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 2 Functional description

- Page 2-4

2.3.1 GPS related constants and conversion factors

This function includes the most frequently used GPS related constants and conversionfactors called by other m-files from GPS Toolbox or by application dependent m-files.The following m-file modules and main programs are included:

• setting the most used conversion constants, see CONVCON,• initialization of the most frequently used GPS constants, of the WGS-72 constants,

and of the WGS-84 constants, see GPSCON, WGS72CON, WGS84CON,• initialization of the most frequently used GLONASS constants included in PZ-90 and

SGS-85,• main program displaying constants and conversion factors specified in the above

listed modules, see XCON.

2.3.2 Angle transformations

This function includes the most frequently used angle transformations called by other m-files from GPS Toolbox or by application dependent m-files. The following m-filemodules and main programs are included:

• conversion of degrees/minutes/seconds to/from radians, see TADMSRAD,TARADDMS,

• main program executing angle transformations specified in the above listed modules,see XATRANSF.

2.3.3 Coordinate transformations

This function includes the most frequently used coordinate transformations called byother m-files from GPS Toolbox or by application dependent m-files. The following m-file modules and main programs are included in three categories:

(1) Point transformations

• transformation of ECEF coordinates to/from geodetic coordinates for a position point,see TECEFGD, TCEFGD2, TGDECEF,

• main program executing point transformations specified above (by selection), seeXPTRANSF.

• main program executing a comparison between two ECEF to geodetic transformationmethods, see XECEF2GD_COMP.

(2) Matrix transformations • transformation matrix of ECEF to/from ENU, of ECEF to/from local level wander

Page 19: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 2 Functional description

- Page 2-5

azimuth, of ECEF to/from INS, of ENU to/from local level wander azimuth, of locallevel wander azimuth to/from GPS body, of ECEF to/from ECI, see MECEFENU,MENUECEF, MECEFLLW, MLLWECEF, MECEFINS, MINSECEF, MENULLW,MLLWENU, MLLWB, MBLLW, MECEFECI, MECIECEF,

• main program generating matrix transformations specified above (by selection), seeXMTRANSF.

(3) Vector transformations • transformation of ECEF frame to/from ENU frame, of ECEF to/from local level

wander azimuth angle frame, of ECEF frame to/from INS frame, of ENU frameto/from local level wander azimuth frame, of local level wander azimuth frameto/from GPS body frame, of ECEF frame to/from geodetic, of ENU to/from geodetic,for a given vector and a reference point/angles, of ECEF frame to/from ECI, ECEFto/from PZ-90, and ECEF to/from SGS-85, see VECEFENU, VENUECEF,VECEFLLW, VLLWECEF, VECEFINS, VINSECEF, VENULLW, VLLWENU,VLLWB, VBLLW, VECEFGD, VGDECEF, VENUGD, VGDECEF, VECEFECI,VECIECEF, VECEFP90, VP90ECEF, VECEFS85, VS85ECEF,

• main program executing vector transformations specified above (by selection), seeXVTRANSF.

2.3.4 Specialized plotting programs

This function includes specialized plotting used independently to graph ASCII data storedin user defined files. In all cases the user can select the input files(s), enter from keyboardthe title, x and y labels, insert the computed statistics on the graph window (whenavailable), and select the manual scaling (when available). The following m-file mainprograms are included:

• execution of a bar graph for a selected column, see XPBAR,• execution of a x-y plot, with or without statistics and manual scaling, see XYP1 and

XYP1S,• execution of a x-y graph for two selected columns in two different windows

(subplots), with statistics, see XYP2W,• execution of a x-y graph for three selected columns in three different windows

(subplots), with statistics, see XYP3W,• execution of a x-y graph of the difference between columns (from two different files),

with statistics, see XYPC2,• execution of a x-y graph of RSS (root sum square) of the difference of three columns

from two different files, with statistics, see XYPC2RSS,• execution of a x-y graph for the selected multiple columns, see XYPM,• execution of a x-y graph of RSS (root sum square) of three selected columns, with

statistics, see XYPRSS,

Page 20: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 2 Functional description

- Page 2-6

• execution of a x-y graph of RSS (root sum square) of selected columns correspondingto position and velocity errors, in two windows (subplots) with statistics, seeXYPRSS2W,

• execution of a x-y graph for a selected column and the associated envelope (standarddeviation), with statistics, see XYPVSTD.

2.3.5 Specialized statistics related functions

This function includes specialized statistics utilities used by other m-files from GPSToolbox or by application dependent m-files, which are not included in the basicMATLAB. The following m-file modules and main programs are included:

• computation of circular error probable and vertical error probable, see CEP, VEP andXCEPVEP,

• computation of Figure-of-merit value based on ICD-059 table, see FOM and XFOM,• computation of root mean square (RMS), root sum square of three/two component

vector sample, computation of running mean, standard deviation and root meansquare for a set of real samples, see RMS, RMS2, RSS, RSSXY, STATUP, andXSTAT,

• determination of mean, standard deviation, and root mean square of the elements of aspecified column, see XSTATC,

• determination of GPS error budget.

2.3.6 GPS time utilities

This function includes GPS time utilities used by other m-files from GPS Toolbox or byapplication dependent m-files. The following m-file modules and main programs areincluded:

• determination of UTC leap seconds value for a specified year between 1980 and 2059,see GPSLSEC, XGPSLSEC,

• determination of GPS time of transmission based on time of measurement (reception),see TIMETR,

• main program executing GPS time related transformations, namely (1) from (year,month, day) to (GPS week, GPS roll number, day of week), (2) from (GPS week, dayof week, GPS roll number) to (day of week, day, month, year), (3) from (day of week,hour, minute, second) to (time of week), (4) from (time of week) to (day of week,hour, minute, second), see XGPSTIME.

2.3.7 Specialized GPS data processing functions

This function includes specialized GPS data processing utilities used by other m-filesfrom GPS Toolbox or by application dependent m-files. The following m-file modulesand main programs are included:

Page 21: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 2 Functional description

- Page 2-7

• elimination of a specified column or row from a matrix, see ELIMCOL, ELIMROW,and XELIMRC,

• selection of the different elements from a specified array, see SELECTD,• storage transformations from one dimensional array to two dimensional array for

symmetric matrices and UD factors, see MSC2F, MSF2C, MUDC2F, and MUDF2C,• main program determining the missing data into a specified column of an input table,

see XMISDAT,• main program reading Yuma almanac data and creating two data files, see

XREADALM,• main program reading RINEX 2 navigation message file and creating three data files,

see XRINEXN,• main program sorting the records based on the elements of a specified column (in

ascending order), see XSORTREC.

2.3.8 Trajectory and related utilities

This function includes trajectory related utilities used by other m-files from GPS Toolboxor by application dependent m-files, as well as several main programs related to greatcircle navigation and dead reckoning. The following modules and main programs areincluded:

• determination of great circle navigation position, velocity and acceleration, seeGCNAV and XGCNAV,

• determination of great circle dead reckoning trajectory, see XGCDR,• determination of geodetic data for a specified departure-destination pair, see

GEODES and XGEODES,• determination of WGS-84 geoid height correction, see GEOIDH and XGEOIDH,• generation of longitude-latitude WAAS grid, see GRIDWAAS and XGRIDW,• computation of the horizontal position error when latitude/longitude for two points

are specified, see HPE and XHPE,• determination of vehicle trajectory in straight segment with constant speed, see

TRAJS and XTRAJS,• main program determining acceleration from position/velocity data and plotting all

relevant trajectory information, see XPPVA,• main program determining acceleration and jerk from position and velocity data, and

plotting all relevant trajectory information, see XPPVA..

2.3.9 Satellite position computation

This function includes the m-files used in the computation of the satellites ECEF positionbased on almanac or ephemeris data. The following m-file modules and main programsare included:

Page 22: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 2 Functional description

- Page 2-8

• computation of ECEF satellites position based on satellites almanac data, seeSVPALM and XSVPALM,

• computation of ECEF satellites position based on satellites ephemeris data, seeSVPEPH and XSVPEPH,

• main program determining RSS satellite position difference based on ephemeris andalmanac data, and executing the corresponding graph., see XSVCOMP.

2.3.10 Elevation and azimuth determination and satellite visibility

This function includes the most commonly used GPS utilities for azimuth and elevationdetermination, satellites visibility called by other m-files from GPS Toolbox or byapplication dependent m-files as well as main programs plotting the azimuth-elevationangles repartition. The following m-file modules and main programs are included:

• computation of elevation angle, azimuth angle, unit line-of-sight vector and range, seeELEVA, ELEVAR, ELEVAZ, RANGE, UVERV,

• main programs determining and plotting azimuth and elevation angles for a specifiedsatellite or for all visible satellites (sky-plot), see XELAZ, XPELAZA, XPELAZS.

2.3.11 DOPs computation, satellite selection and related functions

This function includes the m-files used in the computation of the dilution of precision(DOP) quantities, the weighted dilution of precision (WDOP) quantities, and the satellitesselection based on minimum geometric dilution of precision (GDOP). The following m-file modules and main programs are included:

• computation of DOP quantities, see DOP1, DOP2, and XDOP1, XDOP2,• approximate computation of GDOP, see GDOPV and XGDOPV,• computation of weighted DOP quantities, see WDOP1, WDOP2, WDOPV, and

XWDOP1, XWDOP2, XWDOPV,• selection of a set of four, five or six best satellites based on minimum geometric

dilution of precision, see SVSEL4, SVSEL5, SVSEL6 and XSVSEL,• determination of observation matrix based on line-of-sights, baro and clock

measurements, see HMAT, HMATB, HMATBC, HMATC and HMATALL,• main program determining the repartition of number of visible satellites and the

corresponding DOPs for a specified geographical area, see XMAPDOP.

2.3.12 Special signal processing and Kalman filter functions

This function includes the m-files used in the generation of random number sequenceswith normal distribution, mean and standard deviation specified, generation of randomwalk sequences, generation of first and second order Gauss-Markov sequences, utilitiesrelated to the implementation of weighted least square iterative method and discrete

Page 23: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 2 Functional description

- Page 2-9

Kalman filter U-D mechanization, and Kalman filter covariance analysis. The followingm-file modules and main programs are included:

• generation of random number sequences with normal distribution, mean and standarddistribution specified, and random walk sequences, see GENRN, RWALK, andXGENRN, XRWALK,

• generation of first and second order Gauss-Markov sequences, see GMP1, GMP2, andXGMP1, XGMP2,

• implementation of utilities related to weighted least square iterative method andKalman filter U-D mechanization, see MCUD, MREAST, MUDD, MUDM,MUDM1, and XMUDDU, XMUDM,

• implementation of Kalman filter covariance analysis, see KFCOV, KFCOVA, andXKFCOV.

2.3.13 Pseudorange and deltarange determination and related functions

This function includes the m-files used in the determination of pseudorange anddeltarange. The following m-file modules and main programs are included:

• Determination of L1 iono correction by using Klobuchar model, see IONOC,IONOCON, and XIONOC,

• computation of pseudorange measurement corrected for ionospheric effects whenpseudoranges measured on L1/L2 are available, see PIONOC,

• determination of tropospheric correction, see TRPOC1 and XTROPOC1,• determination of user bias and drift, see UCLOCK and XUCLOCK,• determination of user earth rotation correction vector, see UERCOR and XUERCOR,• determination of pseudorange and accumulated delta range, see PRADR and

XPRADR,• main program generating and saving the multipath pseudorange errors, see XMPATH,• main program generating SA errors, see XSAERR.

2.3.14 Determination of user’s position and related functions

This function includes the m-files used in the determination of the user’s position whenfour or more satellite positions and the corresponding pseudoranges are known. Thefollowing m-file modules and main programs are included:

• computation of user’s position based on a direct method, see UPOSD4, UPOSDG,and XUPOSD4, XUPOSDG,

• computation of user’s position based on an iterative method, see UPOSIT andXUPOSIT,

• main program determining position fixes using weighted least squares algorithmwhen the user is stationary, see XPFWLSS.

Page 24: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 2 List of functions by topics

- Page 2-10

2.3.15 RAIM/FDE availability and integrity evaluation and related functions

This function includes the m-files used in the determination of the availability andintegrity; the baseline algorithms for Receiver Autonomous Integrity Monitoring (RAIM)failure detection are implemented. The following m-file modules and main programs areincluded:

• determination of probability density function for (1) normal Gaussian distribution,(2) Chi-square distribution with specified degree of freedom, (3) non-central Chi-square distribution with specified degree of freedom, see GAUSS_1, CHI2_DOF, andNCCHIS2_K,

• RAIM integrity failure detection and isolation utilities, see DHMAX, RAIMST,SLOPEMAX, QRUPA, and XQRUPA, XRAIMST, XOPCR, XSLOPE,

• RAIM integrity failure detection and exclusion, see RAIMFD and XRAIMFD,• Determination of sub-dilution of precision (sub-DOP) and sub-weighted dilution of

precision (sub-WDOP), see SDOP, SWDOP, and XSDOP, XSWDOP,• determination of fault detection normalized thresholds, see FDNT, and XFDNT,• determination of parity bias by using Gaussian distribution for degree of freedom

(dof) = 1, and Chi-square distribution for dof > 1, see FBIAS_C, FBIAS_G, andXPBIAS,

• main program determining the RAIM fault detection availability, see XRAIMDA,• main program determining the RAIM fault exclusion availability, see XRAIMEA.

2.4 List of functions by topics

The following table, Table 2-1, includes a complete list of functions (modules and mainprograms) by topics.

Table 2-1.GPS related constants and conversion factors

convcon most used conversion constants

gpscon most used GPS constants

pz90con most used PZ-90 constants

sgs85con most used SGS-85 constants

wgs72con most used WGS-72 constants

wgs84con most used WGS-84 constants

xcon main program displaying constants specified in macros convcon, gpscon,pz90con, sgs85con, wgs72con, and wgs84con

Page 25: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 2 List of functions by topics

- Page 2-11

Angle transformations

tadmsrad degrees/minutes/seconds to radians

taraddms radians to degrees/minutes/seconds

xatransf main program executing angle transformations from/todegrees/minutes/seconds to/from radians (by selection)

Coordinate transformations - Point transformation

tecefgd ECEF to geodetic coordinates (direct method)

tecefgd2 ECEF to geodetic coordinates (iterative method)

tgdecef geodetic to ECEF coordinates

xptransf main program executing transformations from/to ECEF/geodetic to/fromgeodetic/ECEF coordinates

xecef2gd_comp main program executing comparison between the two ECEF to geodetictransformation methods

Coordinate transformations - Matrix transformation

mbllw GPS body to LLW (Local Level Wander azimuth)

mecefeci ECEF (Earth Centered Earth Fixed) to ECI (Earth Centered Inertial)

mecefenu ECEF (Earth Centered Earth Fixed) to ENU (East, North, Up)

mecefins ECEF (Earth Centered Earth Fixed) to INS (Wander / North, West, Up)

mecefllw ECEF (Earth Centered Earth Fixed) to (Local Level Wander azimuth)

meciecef ECI (Earth Centered Inertial) to ECEF (Earth Centered Earth Fixed) )

menuecef ENU (East, North, Up) to ECEF (Earth Centered Earth Fixed)

menullw ENU (East, North, Up) to LLW (Local Level Wander azimuth)

minsecef INS (Wander / North, West, Up) to ECEF (Earth Centered Earth Fixed)

mllwb LLW (Local Level Wander azimuth) to GPS body

mllwecef LLW (Local Level Wander azimuth) to ECEF (Earth Centered Earth Fixed)

mllwenu LLW (Local Level Wander azimuth) to ENU (East North Up)

xmtransf main program generating matrix transformations specified in the abovementioned list (by selection)

Coordinate transformations - Vector transformation

vbllw GPS body to LLW (Local Level Wander azimuth)

Page 26: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 2 List of functions by topics

- Page 2-12

vecefeci ECEF (Earth Centered Earth Fixed) to ECI (Earth Centered Inertial)

vecefenu ECEF (Earth Centered Earth Fixed) to ENU (East, North, Up)

vecefgd ECEF (Earth Centered Earth Fixed) to Geodetic (latitude, longitude, altitude)for a given position vector and a reference point

vecefins ECEF (Earth Centered Earth Fixed) to INS (Wander / North, West, Up)

vecefllw ECEF (Earth Centered Earth Fixed) to LLW (Local Level Wander azimuth)

vecefp90 ECEF (Earth Centered Earth Fixed) to PZ-90 (Parametri Zemli 1990)

vecefs85 ECEF (Earth Centered Earth Fixed) to SGS-85 (Soviet Geodetic System1985)

veciecef ECI (Earth Centered Inertial) to ECEF (Earth Centered Earth Fixed) )

venuecef ENU (East, North, Up) to ECEF (Earth Centered Earth Fixed)

venugd ENU (East, North, Up) to Geodetic (latitude, longitude, altitude) for a givenposition vector and a reference point

venullw ENU (East, North, Up) to LLW (Local Level Wander azimuth)

vgdecefGeodetic (latitude, longitude, altitude) to ECEF (Earth Centered Earth Fixed),for a given position vector specified by the external points in geodeticcoordinates

vgdenu Geodetic (latitude, longitude, altitude) to ENU (East, North, Up) for a givenposition vector specified by the external points in geodetic coordinates

vinsecef INS (Wander / North, West, Up) to ECEF (Earth Centered Earth Fixed)

vllwb LLW (Local Level Wander azimuth) to GPS body

vllwecef LLW (Local Level Wander azimuth) to ECEF (Earth Centered Earth Fixed)

vllwenu LLW (Local Level Wander azimuth) to ENU (East North Up)

vp90ecef PZ-90 (Parametri Zemli 1990) to ECEF (Earth Centered Earth Fixed)

vs85ecef SGS-85 (Soviet Geodetic System 1985) to ECEF (Earth Centered EarthFixed)

xvtransf main program executing vector transformations specified in the abovementioned list (by selection)

Specialized plotting programs

xpbar bar graph for a selected column

xyp1 x-y graph for a selected column

xyp1s x-y graph for a selected column, with statistics

xyp2w x-y graph for two selected columns in two different windows/subplots, withstatistics

xyp3w x-y graph for three selected columns in three different windows/subplots, withstatistics

xypc2 x-y graph of the difference between columns (from different files), withstatistics

Page 27: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 2 List of functions by topics

- Page 2-13

xypc2rss x-y graph for RSS (root sum square) of the difference of three columns fromtwo files, with statistics

xypm x-y graph for the selected multiple columns

xyprss x-y graph for RSS (root sum square) of three selected columns, withstatistics

xyprss2w x-y graph for RSS (root sum square) of three selected columns correspon-ding to position and velocity errors, in two windows/subplots, with statistics

xypvstd x-y graph for a selected column and the associated envelope (standarddeviation), with statistics

Specialized statistics related functions

cep circular error probable (CEP)

fom figure of merit determination based on ICD-059 table

rms root mean square (RMS) of a sample

rms2 modified root mean square (RMS) of a sample (mean of the sample isassumed to be zero)

rss root sum square (RSS) of a three component vector sample

rssxy root sum square (RSS) of a two component vector sample

vep vertical error probable (VEP)

statup running mean, standard deviation and root mean square (rms)

xcepvep main program determining the CEP or VEP of a specified array

xebudget Main program determining GPS error budget

xfom main program plotting the figure of merit versus estimated position error for aspecified position error range

xstat main program testing the macros: rms, rss, rssxy, and statup

xstatc main program determining the mean, standard deviation and rms of theelements of a specified column

Specialized signal processing and Kalman filter functions

genrn random numbers with normal (Gaussian) distribution, with mean andstandard deviation specified

gmp1 first order Gauss-Markov sequence

gmp2 second order Gauss-Markov sequence

Page 28: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 2 List of functions by topics

- Page 2-14

kfcov Kalman filter covariance matrix by using conventional formulation

kfcova Kalman filter covariance matrix by using alternate conventional formulation

mcud reconstruction of a real symmetric matrix from its U-D factors

mreast measurement reasonableness test for a scalar measurement

mudd decomposition of a real symmetric positive (semi)definite matrix into its U-Dfactors

mudm measurement updating process of discrete Kalman filter U-Dimplementation, when measurement is an input when the state is updated

mudm1 measurement updating process of discrete Kalman filter U-D implemen-tation, when measurement residual is an input when the state is updated

rwalk random walk process

xgenrnmain program generating the random numbers with normal (Gaussian)distribution and plotting the generated sequence, histogram, and thenormalized auto-correlation sequence

xgmp1 main program generating first order Gauss-Markov sequence and plottingthe generated sequence and the normalized auto-correlation sequence

xgmp2main program generating second order Gauss-Markov sequence andplotting the generated sequence and the normalized auto-correlationsequence

xkfcov main program performing the covariance analysis by using the conventionalor alternate conventional Kalman filter formulation

xmuddu main program executing the decomposition and reconstruction of a realsymmetric positive (semi)definite matrix into and from its U-D factors

xmudm main program testing the measurement updating process of discreteKalman filter U-D implementation

xrwalk main program generating the random walk process and plotting thegenerated sequence and the normalized auto-correlation sequence

GPS Time Utilities

gpslsec UTC leap seconds value for a specified year between 1980 and 2059

timetr determination of GPS time of transmission based on time of measurement(reception)

xgpslsec main program determining UTC leap seconds value for a specified yearbetween 1980 and 2059

xgpstime main program executing GPS time related transformations

Page 29: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 2 List of functions by topics

- Page 2-15

Specialized GPS related data processing functions

elimcol elimination of a specified column of a two dimensional array

elimrow elimination of a specified row of a two dimensional array

msc2fsymmetric matrix storage transformation from compact form (uppertriangular part, column-wise, one-dimensional array) to full form (allelements, two-dimensional array)

msf2csymmetric matrix storage transformation from full form (all elements, two-dimensional array) to compact form (upper triangular part, column-wise,one-dimensional array)

mudc2fU-D factors storage transformation from compact form (upper triangularpart, column-wise, one-dimensional array) to full U and D matrices (allelements, two-dimensional array)

mudf2cU-D factors storage transformation from full U and D matrices (all elements,two-dimensional array) to compact form (upper triangular part, column-wise,one-dimensional array)

selectd selection of the different elements from a specified array

xelimrc main program testing the elimination of a specified row/column (see macroselimrow and elimcol)

xmisdat main program determining the missing data into a specified column of aninput table

xreadalm main program reading Yuma almanac data and creating two data files

xrinexn main program reading RINEX 2 navigation message file and creating threedata files

xsortrec main program sorting the records based on the elements of a specifiedcolumn (in ascending order)

Trajectory and related utilities

gcnav great circle navigation position, velocity, acceleration

geodes geodetic data for a specified departure-destination pair

geoidh WGS-84 geoid height correction

gridwaas generation of longitude-latitude WAAS grid

hpe horizontal position error (range) when latitude and longitude of two pointsare specified

trajs vehicle trajectory in straight segment with constant speed

xgcdr main program determining great circle dead reckoning trajectory

Page 30: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 2 List of functions by topics

- Page 2-16

xgcnav main program determining great circle navigation position, velocity andacceleration

xgeodes main program determining geodesic when the departure and destinationpoints are specified

xgeoidh main program determining WGS-84 geoid height correction, and executinga contour map

xgridw main program plotting the longitude-latitude WAAS grid

xhpe main program determining the horizontal position error (range)

xppva main program determining acceleration from position/velocity data, andplotting all relevant trajectory information

xppvaj main program determining acceleration and jerk from position and velocitydata, and plotting all relevant trajectory information

xtrajs main program determining the vehicle trajectory with straight segment andconstant speed

Satellite position computation

svpalm ECEF satellite position based on almanac data

svpeph ECEF satellite position based on ephemeris data

xsvpalm main program determining ECEF satellite position based on almanac data

xsvpcomp main program determining RSS satellite position difference based onephemeris and almanac data, and executing the corresponding graph

xsvpeph main program determining ECEF satellite position based on ephemeris data

Elevation and azimuth determination, and satellite visibility

eleva elevation angle and the ECEF unit line-of-sight vector

elevar elevation angle, the ECEF unit line-of-sight vector, and the range

elevaz elevation angle, azimuth angle, the ECEF unit line-of-sight vector, and range

range range between two position points

uverv unit vertical vector for a given ECEF position vector

xelaz main program determining elevation and azimuth angles for specified users,time interval, and all satellites in view

Page 31: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 2 List of functions by topics

- Page 2-17

xpelaza main program executing the azimuth-elevation plot for all satellites in view,and the number of visible satellites plot

xpelazsmain program executing graphs related to elevation and azimuth angles fora specified satellite and selected user (input file can be generated byxelaz.m)

DOPs computation, satellite selection and related functions

dop1 dilution of precision (DOP) quantities when at least 3 line-of-sight unitvectors are specified

dop2 dilution of precision (DOP) quantities when 4 line-of-sight unit vectors arespecified

gdopv approximate geometric dilution of precision (GDOP) when four line-of-sight unit vectors are specified

hmat H matrix based on line-of-sight measurements

hmatb H matrix based on line-of-sight and baro measurements

hmatbc H matrix based on line-of-sight, baro and clock measurements

hmatc H matrix based on line-of-sight and clock measurements

svsel4 selection of a set of 4 satellites based on minimum GDOP

svsel5 selection of a set of 5 satellites based on minimum GDOP

svsel6 selection of a set of 6 satellites based on minimum GDOP

wdop1 weighted dilution of precision (WDOP) quantities when at least 3 line-of-sight unit vectors and the corresponding weighting factors are specified

wdop2 weighted dilution of precision (WDOP) quantities when 4 line-of-sight unitvectors and the corresponding weighting factors are specified

wdopv weighted dilution of precision (WDOP) quantities when 4 line-of-sight unitvectors and the corresponding weighting factors are specified

xdop main program determining dilution of precision (DOP) quantities by using 2methods

xgdopv main program determining an approximate value of the geometric dilution ofprecision (GDOP)

xhmatall main program testing the construction of the H matrix based on line-of-sight,baro and clock measurements

xmapdop main program determining repartition of number of visible satellites and thecorresponding DOPs for a specified geographical area

Page 32: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 2 List of functions by topics

- Page 2-18

xsvsel main program executing the selection of 4, 5 or 6 satellites based onminimum GDOP, and the computation of the corresponding DOP quantities

xwdopmain program computing the weighted dilution of precision (WDOP)quantities when at least 3 line-of-sight unit vectors and the correspondingweighting factors are specified

xwdopvmain program computing the weighted dilution of precision (WDOP)quantities when 4 line-of-sight unit vectors and the corresponding weightingfactors are specified

Pseudorange and Delta range determination and related functions

ionoc L1 iono correction computation by using Klobuchar model

ionocon setting of Klobuchar model iono constants

pionoc pseudorange measurement corrected for ionospheric effects based onL1/L2 measured pseudoranges

pradr pseudorange and accumulated delta range

tropoc1 tropospheric correction by using a simplified model

uclock user clock bias and drift

uercor user earth rotation correction vector

xambig main program generating ambiguity numbers

xionoc main program determining iono corrections by using Klobuchar model

xmpath main program generating and saving the multipath pseudorange errors

xpradr main program generating pseudorange and accumulated delta range

xsaerr main program generating SA errors

xtropoc1 main program generating tropospheric delay contours for a specifiedlocation

xuclock main program generating user clock bias and drift

xuercor main program generating and plotting the magnitude of the earth rotationcorrection vector for a specified longitude/latitude grid

Page 33: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 2 List of functions by topics

- Page 2-19

Determination of user's position and related functions

uspos4 position fix determination by using Bancroft's algorithm when 4measurements are known

uposdg position fix determination by using Bancroft's algorithm when at least 4measurements are known

uposit position fix determination by using an iterative method when at least 4measurements are known

xpfwlss main program determining position fixes using weighted least squaresalgorithm when the user is stationary

xuposd4 main program determining the user's position fix by using a direct methodwhen 4 measurements are known

xuposdg main program determining the user's position fix by using a direct methodwhen at least 4 measurements are known

xuposit main program determining the user's position fix by using an iterativemethod when at least 4 measurements are know

RAIM/FDE availability and integrity evaluation and related functions

chi2_dof probability density function of Chi-square distribution with dof degrees offreedom

dhmax delta_h_max computation (used in RAIM constant alarm rate algorithm)

fdnt fault detection normalized thresholds

fpbias_c parity bias (pbiasb) for Chi-square distribution with degree of freedomgreater than 1

fpbias_g parity bias (pbiasb) for Gauss distribution with degree of freedom equals to1

gauss_1 probability density function for the normal Gaussian distribution

ncchis2_k probability density function for the non-central Chi-square distribution, wherek is 2 to 10 for the degree of freedom 2 to 10 (9 macros)

qrupa Q-R updating algorithm of the measurement matrix when a new clockmeasurement is added

raimfd RAIM availability and fault detection by using the parity vector algorithm (onestep implementation)

Page 34: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 2 List of functions by topics

- Page 2-20

raimst RAIM availability and fault detection by using the standard (constant alarmrate) algorithm

sdop sub-dilution of precision (sub-DOP) quantities

slopemax slopemax computation (used in RAIM constant alarm rate algorithm)

swdop sub-weighted dilution of precision (sub-WDOP) quantities

xfdnt main program computing the fault detection normalized thresholds

xopcr main program comparing four different implementations of RAIM decisionvariable computation

xpbiasmain program computing the value of the parity bias for 10 degrees offreedom (dof) by using Gaussian distribution for dof = 1 and Chi-squaredistribution for dof >1

xqrupa main program testing the Q-R updating algorithm of the measurementmatrix when a new clock measurement is added

xraimda main program determining the RAIM fault detection availability for a userselected or defined set of input data

xraimea main program determining the RAIM fault exclusion availability for a userselected or defined set of input data

xraimfd main program determining RAIM availability and fault detection by using theparity vector algorithm

xraimst main program determining RAIM availability and fault detection by using thestandard (constant alarm rate) algorithm

xsdop main program determining sub-dilution of precision (sub-DOP) quantities

xslope main program determining slopemax and delta_h_max for RAIM baselinestandard (constant alarm rate) algorithm

xswdop main program determining sub-weighted dilution of precision (sub-WDOP)quantities

Appendix A includes a complete list of modules, main programs and input/output files inalphabetical order.

Page 35: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-1 -

3.0 GPS TOOLBOX EXAMPLES

This section presents illustrative examples of how GPS TOOLBOX m-files can be usedto solve typical problems encountered in GPS applications. You may wish to study theseexample programs for ideas on how GPS TOOLBOX m-file modules and programs canbe used to implement your own GPS application. Also, you may find them of somepractical value and modify them for your own use. It is worth mentioning that all m-fileprograms have reference input/output data, therefore a quick check of a selected m-fileprogram can be executed without delay.

The m-file example programs can be found in MATLAB source code in the directoryGPSPRG.M, but most of the time they require additional m-file modules listed in thedirectory GPSMOD.M. For easy identification, all programs have names starting withthe letter ”x”, and the next few letters coincide (most of the time) with the name of themain module used by the program; for example the program XGMP1 is using GMP1 asthe main module. The reference input/output data files are listed in the directoriesGPSINP.DAT, GPSIO.MAT and GPSOUT.OUT.

We recommend a full installation of the GPS Toolbox software - see chapter 1 - beforetrying to run a selected example program. For a simple reference Table 2-1 presents allm-file modules and main programs included in this package.

In this section we are presenting several representative main programs as follows:

1. Matrix coordinate transformation generation, see XMTRANSF2. Generation of a first order Gauss-Markov process, see XGMP13. Generation of a second order Gauss-Markov process, see XGMP24. Covariance analysis by using conventional or alternate conventional Kalman filter

formulation, see XKFCOV5. GPS time related utility transformations, see XGPSTIME6. Read Yuma format almanac file and generate two ASCII data only files, see

XREADALM7. Read RINEX 2 navigation message file and generate three data files, see XRINEXN8. Determination of the WGS-84 geoid height correction, see XGEOIDH9. Generation and plotting of the longitude-latitude WAAS grid, see XGRIDW10. Determination of geodesic based on departure and destination points, see XGEODES11. Determination of great circle dead reckoning trajectory, see XGCDR12. Determination of acceleration from the input time/position/velocity data and

execution of relevant trajectory plots, see XPPVA13. Determination of satellite position based on almanac/ephemeris data, see XSVPALM,

XSVPEPH and XSVCOMP14. Determination of azimuth an elevation angles and execution of related plots, see

XELAZ.M, XPELAZS and XELAZA15. Determination of DOP quantities and related contour plots, see XDOP and

XMAPDOP16. Satellites selection based on minimum GDOP criteria, see XSVSEL17. Determination of iono correction and execution of related graphs, see XIONOC

Page 36: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-2 -

18. Determination of troposphere delay correction, see XTROPOC19. Determination of user clock errors, see XUCLOCK20. Determination of multipath error, see XMPATH21. Determination of the user earth rotation correction error, see XUERCOR22. Computation of the position fix through direct and iterative methods, see XUPOSD4,

XUPOSDG, and XUPOSIT23. Evaluation of weighted least square navigation solution, see XPFWLSS24. RAIM integrity evaluation, see XRAIMST and XRAIMFD25. Determination of thresholds used in RAIM/FDE evaluations, see XFDNT and

XPBIAS26. RAIM Fault detection availability determination, see XRAIMDA27. RAIM Fault exclusion availability determination, see XRAIMEA28. GPS error budged determination.

3.1 Matrix coordinate transformation generation

The m-file program XMTRANSF.M constructs the following coordinate transformationmatrices (see also Figure 3-1):

1) from ECEF to ENU coordinates 2) from ENU to ECEF coordinates 3) from ECEF to LLWA coordinates 4) from LLWA to ECEF coordinates 5) from ECEF to INS coordinates 6) from INS to ECEF coordinates 7) from ENU to LLWA coordinates.8) from LLWA to ENU coordinates 9) from LLWA to GPS body coordinates10) from GPS body to LLWA coordinates

Page 37: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-3 -

11) from ECEF to ECI coordinates12) from ECI to ECEF coordinates

The main program is asking the user to enter the following input data from the keyboard:- name of the output file if selected (the default is the screen)- select the coordinate transformation (see 1 to 12 on the above mentioned list)- for the selected transformation enter the following input data: 1) For the ECEF/ENU to ENU/ECEF transformation: - latitude, in radians - latitude, in radians 2) F or the ECEF/LLWA to LLWA/ECEF transformation: - latitude, in radians - longitude, in radians - wander azimuth angle, in radians 3) For the ECEF/INS to INS/ECEF transformation: - latitude, in radians - longitude, in radians - wander azimuth angle, in radians 4) For the ENU/LLWA to LLWA/ENU transformation: - wander azimuth angle, in radians 5) For the LLWA/GPS Body to GPS Body/LLWA transformation: - yaw angle, in radians - pitch angle, in radians - roll angle, in radians 6) For the ECEF/ENU to ENU/ECEF transformation:

- time elapsed since reference time, in seconds

The results are saved into a specified output file or displayed on screen; the resultscontain the selected input data and the resulting coordinate transformation matrix. Forexample, by selecting the transformations from ECEF to LLWA, from ECEF to ENU,and from ENU to LLWA, we obtain the following results:

************************************************************************

***** Input data ***** latitude (rad.) = 0.500000000000 longitude (rad.) = 0.700000000000 wander azimuth (rad.) = 0.300000000000

***** ECEF to LLWA transformation matrix ***** -0.7238075 0.6394089 0.2593434 -0.1599281 -0.5210862 0.8383866 0.6712122 0.5653542 0.4794255

************************************************************************************************************************************************

***** Input data ***** latitude (rad.) = 0.500000000000 longitude (rad.) = 0.700000000000

***** ECEF to ENU transformation matrix *****

Page 38: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-4 -

-0.6442177 0.7648422 0.0000000 -0.3666849 -0.3088544 0.8775826 0.6712122 0.5653542 0.4794255

************************************************************************************************************************************************

***** Input data ***** wander azimuth (rad.) = 0.300000000000

***** ENU to LLWA transformation matrix ***** 0.9553365 0.2955202 0.0000000 -0.2955202 0.9553365 0.0000000 0.0000000 0.0000000 1.0000000

************************************************************************

It is worth mentioning that results verification can be made by multiplying the last twotransformations, and the result of this computation should equal the first transformation.

3.2 Generation of a first order Gauss-Markov process

The m-file program XGMP1.M generates a first order Gauss-Markov process datasequence by using the following formula

x_new = exp(- beta * deltat) * x_old + w

where

beta is the inverse of the correlation timedeltat is the time stepx_old is the old (previous) value of first order Gauss-Markov processx_new is the new value of the first order Gauss-Markov processw is a normally distributed random number with zero mean and standard

deviation equals sigma_x * sqrt(1.-exp(-2.*beta*deltat))sigma_x is the standard deviation of the process

The main program XGMP1 is asking to enter the following input data from the keyboard:- name of the output data file- total number of steps used in the generation of first order Gauss-Markov process.

In addition, the main program has hard-coded the default input data, which can be easilymodified, or entered from the keyboard (through a question-answer approach):- initial seed value for random number generation- value of the constant beta , 1/beta is the correlation time- value of the constant deltat , time step

Page 39: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-5 -

0 100 200 300 400 500 600-20

-15

-10

-5

0

5

10First order Gauss-Markov process - with 512 time sequences

Firs

t ord

er G

auss

-Mar

kov

sequ

ence

T ime sequence

mean = -2.652 ; st.dev. = 6.21 ; rms = 6.753

-6 0 0 -4 0 0 -2 0 0 0 2 0 0 4 0 0 6 0 0-0 .2

0

0 .2

0 .4

0 .6

0 .8

1F irs t o rd e r G a u ss -M a rko v p ro ce s s - w ith 5 1 2 tim e s e q u e n c e s

No

rma

lize

d a

uto

-co

rre

latio

n s

eq

ue

nce

S e q u e n ce la g

Figure 3-2. First order Gauss-Markov process.

Page 40: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-6 -

- value of the standard deviation of the process sigma_x- initial value of the process x_old- umber of steps after which the data are saved in the output file

The output file should contain sequentially for each step saved the value of the first orderGauss-Markov process. The graphs presented in Figure 3-2 are generated by selecting 512time sequences and the default data specified in the m-file main program XGMP1.M.

The correctness of the output data can be checked with a program which computes thenormalized auto-correlation function, for example XCOR from Matlab ® SignalProcessing Toolbox..

The input data can also be entered from a special input data file by reading the datasequentially.

3.3 Generation of a second order Gauss-Markov process

The m-file program XGMP2.M generates a second order Gauss-Markov process datasequence.

The power spectral density function is given by

Φ(w) = c**2 / (w**4 + w0**4)

where w is frequency in radians/sec., w0 is the natural frequency in radians/second, andc**2 is a constant in meters**2.

The process is described by the following second order linear differential equation:

!!x p + 2 * beta * w0 * !x p + w0**2 * xp = c * W

where W is the white Gaussian noise with unit power spectral density, and beta is adamping factor (less than 1).

The main program XGMP2 is asking to enter the following input data from the keyboard:- name of the output data file- total number of steps used in the generation of second order Gauss-Markov process.

In addition, the main program has hard-coded the following input data, which can beeasily modified to be entered from the keyboard (through a question-answer approach), orfrom a special input data file (by reading the data sequentially):

Page 41: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-7 -

0 100 200 300 400 500 600-35

-30

-25

-20

-15

-10

-5

0

5

10Second order Gauss-Markov process - first state component

Firs

t sta

te c

ompo

nent

Time sequence (Total sequence length = 512)

mean = -10.25 ; st.dev. = 11.35 ; rms = 15.3

-600 -400 -200 0 200 400 600-0.2

0

0.2

0.4

0.6

0.8

1Second order Gauss-Markov process - first state component

Nor

mal

ized

aut

o-co

rrel

atio

n se

quen

ce

Sequence lag (Total sequence length = 512)

Figure 3-3.1. Second order Gauss-Markov process - first state component.

Page 42: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-8 -

0 100 200 300 400 500 600-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6Second order G auss-M arkov process - second state com ponent

Sec

ond

stat

e co

mpo

nent

T im e sequence (Total sequence length = 512)

m ean = -0.003864 ; s t.dev. = 0.2283 ; rm s = 0.2283

-600 -400 -200 0 200 400 600-0.4

-0.2

0

0.2

0.4

0.6

0.8

1Second order Gauss-Markov process - second state component

Nor

mal

ized

aut

o-co

rrel

atio

n se

quen

ce

Sequence lag (Total sequence length = 512)

Figure 3-3.2. Second order Gauss-Markov process - second state component.

Page 43: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-9 -

- initial seed value for random number generation- value of the natural frequency w0, in radians/second- value of the damping factor beta- value of the constant csq , c**2, in meters**2- value of the constant time step, deltat, in seconds- number of steps after which the data are saved in the output file.

Sequentially, for each step saved the output file should contain the values of the secondorder Gauss-Markov process. The graphs presented in Figures 3-3.1 and 3-3.2 aregenerated by selecting 512 time sequences and the default data specified in the m-filemain program XGMP2.M; the default data are simulating a S/A process as specified in[2]. Figure 3-3.1 shows the time sequence and the corresponding normalized auto-correlation sequence for the first state component, while Figure 3-3.2 presents the samequantities for the second state component.

The correctness of the output data can be checked with a program which computes thenormalized auto-correlation function, for example XCOR from Matlab ® SignalProcessing Toolbox.

3.4 Covariance analysis by using the conventional or alternate conventional Kalman filter formulation

The m-file program XKFCOV.M performs covariance analysis by using the conventionalor alternate conventional Kalman filter formulation. It is assumed that the system is time-invariant; however, with few changes the program can be extended to time-varyingsystem

The main program XKFCOV is asking to enter the following data from keyboard:- number of steps to be processed (nstep)- selection of the variant to be used (1 for conventional, and 2 for alternate

conventional)- selection of the input data from a selected input data file or the default input data set.

The structure of the input file (see for example the file XKFCOV1.dat) is as follows:-- first row contains the values for state dimension (n) and measurement dimension

(m)-- next n rows contain the corresponding rows of the transition matrix (phi)-- next n rows contain the corresponding rows of the process noise matrix (q)-- next m rows contain the corresponding rows of the observation matrix (h)-- next m rows contain the corresponding rows of the measurement noise matrix (r)-- next n rows contain the corresponding rows of the initial covariance matrix

(depending on the variant used)- index of the state covariance to be saved or/and plotted- name of the output file, if the generated data are saved.

The output file contains the generated data (optional); at each time step the following dataare stored: step number, standard deviation after and before measurement incorporation.

Page 44: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-10 -

The graph of the selected state standard deviation versus time sequence is provided – seeFigure 3-4.1 when the default data is used.

Figure 3-4. Kalman filter covariance analysis.

3.5 GPS time related utility transformations

The m-file program XGPSTIME performs the following GPS time related transforma-tions:1. From (year, month, day) to (GPS week, GPS roll number, day of week),2. From (GPS week, GPS roll number, day of week) to (year, month, day),3. From (day of week, hour, minute, second) to (time of week),4. From (time of week) to (day of week, hour, minute, second).

The program is asking the user to enter the input data from the keyboard, and the resultscan be saved into a specified output file or are displayed on screen. For example, byselecting the transformations 1 and 3 we can find the following results displayed onscreen:

» xgpstime

Do you want to save the results? (y/n)[n] -->

Select: 1 --> (year, month, day) to (GPS week, GPS roll number, day of week)

0 2 4 6 8 10 12 14 16 18 200

1

2

3

4

5

6

7

8

9

10

11Selected Standard Deviation versus Time sequence (for state 1)

Sel

ecte

d S

tand

ard

Dev

iatio

n

Time sequence

Page 45: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-11 -

2 --> (GPS week, day of week, GPS roll number) to (day of week, day, month, year) 3 --> (day of week, hour, minute, second) to time of week 4 --> time of week to (day of week, hour, minute, second)

Make the selection --> 1

***************************************************************

Specify the year, e.g. 1999, --> 2000Specify the month, e.g. 1, --> 10Specify the day, e.g. 28, --> 29

gpsweeek = 62, gps roll number = 1, day of week = 0

***************************************************************

Do you want another computation? (y/n)[n] --> y

Select: 1 --> (year, month, day) to (GPS week, GPS roll number, day of week) 2 --> (GPS week, day of week, GPS roll number) to (day of week, day, month, year) 3 --> (day of week, hour, minute, second) to time of week 4 --> time of week to (day of week, hour, minute, second)

Make the selection --> 3

***************************************************************

Specify day of week (0 to 6), e.g. 2, --> 6Specify hour (0 to 23), e.g. 5, --> 12Specify minute (0 to 59), e.g. 34, --> 40Specify second (0 to 60), e.g. 46, --> 56

time of week = 564056

***************************************************************

Do you want another computation? (y/n)[n] -->

End of the program XGPSTIME

»

Also by using the program XGPSTME the data related to the GPS week roll number fromTable 3-5 can be generated.

Page 46: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-12 -

GPS week Rollnumber Date of Start of GPS week 0 Date of End of GPS week 1023

0 Sunday, January 6, 1980 Saturday, August 21,1999

1 Sunday, August 22, 1999 Saturday, April 6, 2019

2 Sunday, April 7, 2019 Saturday, November 20, 2038

3 Sunday, November 21, 2038 Saturday, July 6, 2058

4 Sunday, July 7, 2058 Saturday, February 19, 22078

Table 3-5. Selected GPS Fundamental Dates

3.6 Read Yuma format almanac file and generate two ASCII data only files

The m-file program XREADALM can be used to read the Yuma format almanac inputfile and to generate two ASCII data only files (no text description of parameters), namely

1) First file is saving all data contain in the Yuma format input file into a specified file –all data only (no text description of parameters), in the same order as the originalYuma format input file; each record contains the data related to a satellite. The resultis a data table with 13 columns and number of rows equals to the number of satellites.

2) Second file is saving a “reduced” almanac set from the Yuma format input file intoanother specified data only (no text description of parameters). Each record containsthe data related to a healthy satellite (9 parameters) in the following order:- satellite id number- satellite time of applicability (toa), in seconds- satellite semimajor axis (a), in meters- satellite eccentricity (e)- satellite orbital inclination (I_0), in radians- satellite right ascension at toa (OMEGA_0), in radians- satellite argument of perigee (omega), in radians- satellite mean anomaly (M_0), in radians- satellite rate of right ascension (OMEGA_DOT), radians/ second

For simplicity, in this manual, we are adopting the following naming convention:• The name of all three files (Yuma format input file and two generated files) is formed

as the abbreviation of “week”, i.e. “wk” follows by the week number, e.g. “wk749”.Note that we assume that the user is not trying to utilize the same week with differentroll number.

• The extensions are as follows:• “yum” for the Yuma format almanac input,

Page 47: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-13 -

• “alm” for the first output file with complete Yuma data (but no text description ofparameters), with 13 columns,

• “dat” for the second output file with “reduced” Yuma data (but no text descriptionof parameters), with 9 columns.

For example, by selecting the Yuma format input file wk749.yum the following aredisplayed on screen:

» xreadalm

Specify the Yuma format almanac input data file, e.g. wk749.yum --> wk749.yum

Specify the output filename for the complete almanac, e.g. wk749.alm for wk749.yum --> wk749.alm

Specify the output filename for the reduced almanac, e.g. wk749.dat for wk749.yum --> wk749.dat

Number of satellites in the almanac = 26

End of program XREADALM

»

3.7 Read RINEX 2 navigation message file and generate three data files

The m-file program XRINEXN can be used to read a RINEX 2 navigation message fileand write the data into three output data files; one output data file contains the completenavigation information (in fact the portion related to each satellite data), while the othertwo output files contain the reduced ephemeris and reduced almanac data, respectively.

Each record of the output file containing reduced ephemeris data includes the followingdata (in this order): svprn, toe, smaxis, ecc, i0, Omega0, omega, M0, OmegaDot, deltan,idot, cic, cis, crc, crs, cuc, cus (17 columns).

Each record of the output file containing reduced almanac data includes the followingdata (in this order): svprn, toe, smaxis, ecc, i0, Omega0, omega, M0, OmegaDot (9columns).

For example, by selecting the RINEX 2 navigation file RINEXNAV.99n as input file ansthe name of the three output files – see XRINEXN1.out, XRINEXN2.out, andXRINEXN3.out - the following are displayed on screen:

» xrinexn

Specify the name of the RINEX 2 navigation, e.g. rinexnav.99n --> rinexnav.99n

Specify the output filename for the complete data --> xrinexn1.out

Page 48: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-14 -

Specify the output filename for the reduced ephemeris --> xrinexn2.out

Specify the output filename for the reduced almanac --> xrinexn3.out

Number of satellites = 9

End of the program XRINEXN

»

3.8 Determination of the WGS-84 geoid height correction

The m-file program XGEOID determines the WGS-84 geoid height correction for aspecified location given by latitude and longitude, and, optional, the worldwide WGS-84geoid height correction contour map is plotted. The input database file for the WGS-84geoid height correction, tgeoid84.dat, can be replaced with a database file correspondingto another geoid.

For example, by selecting the location corresponding to the latitude = -1.2 radians andlongitude = 0.5 radians, and the option to plot the worldwide WGS-84 geoid heightcorrection contour map – see Figure 3-8, the following results are obtained:

Figure 3-8. WGS-84 geoid height correction

0 50 100 150 200 250 300 350

-80

-60

-40

-20

0

20

40

60

80

Longitude, in degrees

Latit

ude,

in d

egre

es

WGS-84 Geoid Height Correction (in meters)

-60

-60-60

-50

-50

-50

-50

-40-40

-40-40

-40

-40

-30

-30-30

-30

-20

-20

-10

-10-10

-10

0

10

10

10

20

2020

20

2

20

20

20

30

30

30

3030

40

4040

40

40

50

50 50

5

50

60

60

60

Page 49: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-15 -

» xgeoidh

Do you want to save the generated data? (y/n)[y] n

Enter latitude in radians ( -pi/2 to pi/2 ) --> -1.2Enter longitude in radians ( 0 to 2*pi ) --> 0.5

********************************************************

*** COMPUTATION OF WGS-84 GEOID HEIGHT CORRECTION ****

***** Input data ******

Latitude in radians --> -1.2000000Longitude in radians --> 0.5000000

***** Output data *****

Geoid height correction in meters = 21.18207

********************************************************

Do you want another computation? (y/n)[n]

Do you want to map the WGS-84 geoid height correction? (y/n)[y]

End of the program XGEOIDH

»

3.9 Generation and plotting of the longitude-latitude WAAS grid

The m-file program XGRIDW generates and plots the longitude-latitude WAAS grid asspecified in the document RTCA/DO-229, for a total of 2353 space points. The generateddata can be saved (optional) into a mat-file called fgridw.mat. The program can be easilychanged to generate and plot the WAAS grid points into a specified latitude-longitudearea.

The commands and the results – see Figure 3-9 - are as follows:

» xgridw

Do you to save the generated grid data (y/n)[n]? y

The Latitutde-Longitude WAAS grid is saved in file fgridw.mat

End of the program XGRIDW

»

Page 50: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-16 -

Figure 3.9. WAAS Longitude-Latitude grid.

3.10 Determination of geodesic based on departure and destination points

The m-file program XGEODES determines geodetic when the latitude and longitude ofthe departure and destination points are specified; WGS-84 earth model is used. Thelatitude/longitude in degrees for the departure and destination points can be entered fromthe keyboard or read from a specified input data file (as a sequence of waypoints). Foreach departure-destination pair the range, departure bearing and destination bearing aredetermined.

For example if the input data file xgeodes1.dat is used the following results are obtainedon the screen, and the plot of the trajectory is presented in Figure 3-10:

» xgeodes

Do you want to use the default data? (y/n)[n] -->

Do you want to enter the data from keyboard? (y/n)[n] -->

Specify the input data filename, e.g. xgeodes1.dat --> xgeodes1.dat

Do you want to save the generated data? (y/n)[y] -->

Specify the output filename --> xgeodes1.out

Do you want to plot the waypoints? (y/n)[y] -->

Page 51: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-17 -

Place the text with total range on the graph; Press <Enter> or <Return> key to start ...

Press <Enter> or <Return> key to continue ...

End of the program XGEODES.M

»

Figure 3-10 : Longitude-latitude of the selected waypoints with the geodesic distance.

The output data files xgeodes1.out contains the following information:

************************************************************

*****Input data 1Departure latitude = 3.73319315700000e+001 degreesDeparture longitude = 4.00554434300000e+001 degreesDestination latitude = 2.61285665100000e+001 degreesDestination longitude = 4.14765298000000e+001 degrees

*****Output data 1Range = 1.24949951092708e+006 metersDeparture bearing = 1.73427328245473e+002 degreesDestination bearing = 1.74178332666459e+002 degrees

************************************************************

************************************************************

*****Input data 2Departure latitude = 2.61285665100000e+001 degreesDeparture longitude = 4.14765298000000e+001 degreesDestination latitude = 2.87277324300000e+001 degreesDestination longitude = 4.23409216200000e+001 degrees

40 40.5 41 41.5 42 42.5 43 43.5 44 44.5 4526

28

30

32

34

36

38Longitude - Latitude plot of the selected waypoints (with geodesic distance)

Longitude, in degrees

Latit

ude,

in d

egre

es

Total range = 2272693.6056 meters

Page 52: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-18 -

*****Output data 2Range = 3.00424492794101e+005 metersDeparture bearing = 1.63306311690213e+001 degreesDestination bearing = 1.67289098732353e+001 degrees

************************************************************

************************************************************

*****Input data 3Departure latitude = 2.87277324300000e+001 degreesDeparture longitude = 4.23409216200000e+001 degreesDestination latitude = 3.00273481100000e+001 degreesDestination longitude = 4.33762019200000e+001 degrees

*****Output data 3Range = 1.75647115063086e+005 metersDeparture bearing = 3.46515496093302e+001 degreesDestination bearing = 3.51594623160438e+001 degrees

************************************************************

************************************************************

*****Input data 4Departure latitude = 3.00273481100000e+001 degreesDeparture longitude = 4.33762019200000e+001 degreesDestination latitude = 3.12563819300000e+001 degreesDestination longitude = 4.48926152700000e+001 degrees

*****Output data 4Range = 1.99232530315795e+005 metersDeparture bearing = 4.64680459167103e+001 degreesDestination bearing = 4.72409947915694e+001 degrees

************************************************************

************************************************************

*****Input data 5Departure latitude = 3.12563819300000e+001 degreesDeparture longitude = 4.48926152700000e+001 degreesDestination latitude = 3.35329182400000e+001 degreesDestination longitude = 4.23481053200000e+001 degrees

*****Output data 5Range = 3.47889956483015e+005 metersDeparture bearing = -4.28048445472051e+001 degreesDestination bearing = -4.41684910005959e+001 degrees

************************************************************

Page 53: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-19 -

3.11 Determination of great circle dead reckoning trajectory

The m-file program XGCDR determines great circle dead reckoning trajectory assuminga spherical earth with radius equals to the local radius and constant altitude; WGS-84constants are used. The following input data, from keyboard, are required:- initial latitude, in radians- initial longitude, in radians- altitude, in meters- heading, in radians- speed, in meters/second- initial time, in seconds- time step, in seconds- number of steps

At the same time a default input data set is provided.

For example if the default input data set is used the following results are obtained on thescreen, and the plot of the great circle dead reckoning trajectory, with the total rangevalue, is presented in Figure 3-11.

Figure 3-11: Great circle dead reckoning trajectory.

-2.06 -2.059 -2.058 -2.057 -2.056 -2.055 -2.054 -2.053 -2.0520.59

0.6

0.61

0.62

0.63

0.64

0.65

0.66

0.67

0.68

0.69

Longitude, in radians

Latit

ude,

in ra

dian

s

Great circle dead reckoning trajectory

Total range = 597040.1734 meters

Page 54: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-20 -

» xgcdr

Do you want to use the default data? (y/n)[n] y

Do you want to save the generated data? (y/n)[y] n

*****************************************************************************

*****Initial conditions:Latitude (radians) = 0.59341195Longitude (radians) = -2.05948852Altitude (meters) = 5000.00000000Heading (radians) = 0.05000000Speed (meters/second) = 200.00000000Time_init (seconds) = 0.00000000Time_step (seconds) = 300.00000000Number of time steps = 10

*****Great Circle Dead Reckoning Trajectory

Time Latitude Longitude Altitude Vel_N Vel_E Distance (sec) (rad) (rad) (m) (m/sec) (m/sec) (m) 0.000 0.59341195 -2.05948852 5000.000 199.750 9.996 0.000 300.000 0.60279007 -2.05891882 5000.000 199.747 10.060 59679.933 600.000 0.61216803 -2.05834172 5000.000 199.744 10.126 59685.194 900.000 0.62154584 -2.05775696 5000.000 199.740 10.193 59690.492 1200.000 0.63092349 -2.05716430 5000.000 199.737 10.263 59695.826 1500.000 0.64030096 -2.05656347 5000.000 199.733 10.334 59701.194 1800.000 0.64967826 -2.05595417 5000.000 199.729 10.407 59706.593 2100.000 0.65905538 -2.05533614 5000.000 199.725 10.482 59712.023 2400.000 0.66843231 -2.05470906 5000.000 199.721 10.559 59717.481 2700.000 0.67780905 -2.05407262 5000.000 199.717 10.639 59722.965 3000.000 0.68718558 -2.05342650 5000.000 199.712 10.720 59728.473

*****************************************************************************

Do you want to plot the trajectory? (y/n)[y]

Place the text with total range on the graph; Press <Enter> or <Return> key to start ...

Press <Enter> or <Return> key to continue ...

End of the program XGCDR.M

»

3.12 Determination of acceleration from the input time/position/velocitydata and execution of relevant trajectory plots

The m-file program XPPVA determines acceleration from the input time/position/velocity data and executes relevant trajectory plots. Each record of the ASCII input datafile contains the following data:- time, in seconds- latitude, in radians

Page 55: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-21 -

- longitude, in radians- altitude, in meters- East velocity component, in meters/second- North velocity component, in meters/second- Up velocity component, in meters/secondThere are two default input data files, namely posvelmd.dat and posvelhd.dat for mediumand high dynamics scenario, respectively.

Next, we illustrate the use of the medium dynamics input file, posvelmd.dat, and theobtained plots – see Figures 3-12.1 to 3-12.5.

» xppva

Do you want to use the default data file(s)? (y/n)[y]

Enter: 1 for the medium dynamics file posvelmd.dat 2 for the high dynamics file posvelhd.datMake selection --> 1

Enter Scenario name, e.g. Low/Medium/High Dynamics Scenario --> Medium Dynamics Scenario

End of the program XPPVA

»

Figure 3-12.1. Trajectory Latitude/Longitude/Altitude

0 200 400 600 800 1000 1200 1400 1600 1800 200032

33

34

35Medium Dynamics Scenario - Trajectory Latitude/Longitude/Altitude versus Time

Latit

ude,

in d

egre

es

0 200 400 600 800 1000 1200 1400 1600 1800 2000-118

-117

-116

-115

Long

itude

, in

degr

ees

0 200 400 600 800 1000 1200 1400 1600 1800 20000

2000

4000

6000

Alti

tude

, in

met

ers

Time, in seconds

Page 56: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-22 -

Figure 3-12.2. Trajectory Latitude versus Longitude

Figure 3-12.3. Trajectory East/North/Up Velocity

-118 -117.5 -117 -116.5 -116 -115.5 -11532.8

33

33.2

33.4

33.6

33.8

34

34.2Medium Dynamics Scenario - Trajectory Latitude versus Longitude

Longitude, in degrees

Latit

ude,

in d

egre

es

0 200 400 600 800 1000 1200 1400 1600 1800 2000-500

0

500Medium Dynamics Scenario - Trajectory East/North/Up Velocity versus Time

Eas

t Vel

ocity

, in

m/s

0 200 400 600 800 1000 1200 1400 1600 1800 2000-500

0

500

Nor

th V

eloc

ity, i

n m

/s

0 200 400 600 800 1000 1200 1400 1600 1800 2000-200

0

200

Up

Vel

ocity

, in

m/s

Time, in seconds

Page 57: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-23 -

Figure 3-12.4. Trajectory East/North/Up Acceleration

Figure 3-12.5. Trajectory Velocity/Acceleration magnitude

0 200 400 600 800 1000 1200 1400 1600 1800 2000-50

0

50Medium Dynamics Scenario - Trajectory East/North/Up Acceleration versus Time

Eas

t Acc

eler

atio

n, in

m/s

2

0 200 400 600 800 1000 1200 1400 1600 1800 2000-50

0

50

Nor

th A

ccel

erat

ion,

in m

/s2

0 200 400 600 800 1000 1200 1400 1600 1800 2000-50

0

50

Up

Acc

eler

atio

n, in

m/s

2

Time, in seconds

0 200 400 600 800 1000 1200 1400 1600 1800 20000

100

200

300

400

500Medium Dynamics Scenario - Trajectory Velocity Magnitude versus Time

Vel

ocity

Mag

nitu

de, i

n m

/s

0 200 400 600 800 1000 1200 1400 1600 1800 20000

10

20

30

40Medium Dynamics Scenario - Trajectory Acceleration Magnitude versus Time

Time, in seconds

Acc

eler

atio

n M

agni

tude

, in

m/s

2

Page 58: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-24 -

3.13 Determination of satellite position based on almanac/ephemeris data

The m-file programs XSVPALM and XSVPEPH can be used to determine ECEF satelliteposition based on almanac and ephemeris data, respectively. The almanac input data fileshould have the same structure like the ASCII file generated by the programXREADALM , i.e. 9 columns corresponding to the “reduced” almanac data set, see forexample the file wk749.dat for the week 749 almanac data . The ephemeris input data fileshould have the same structure like the file generated by the program XRINEX2 relatedto the ephemeris data, i.e. 17 columns corresponding to the “reduced” ephemeris data set.For completeness we are including next the format for almanac/ ephemeris input data file,namely• For the almanac input data file, each record contains the data for a specified satellite

in the following order: - satellite number - toa, reference time applicability, in seconds - smaxis (a), satellite semi-major axis, in meters - ecc (e), satellite eccentricity - izero (I_0), inclination angle at reference time, in radians - razero (OMEGA_0), right ascension at reference time, in radians (longitude of ascending node of orbit plane at weekly epoch) - argper (omega), argument of perigee, in radians - mzero (M_0), mean anomaly at reference time, in radians - radot (OMEGA_DOT), rate of right ascension, in radians/second

• For the ephemeris input data file, each record contains the data for a specified satellitein the following order:

- satellite number - toe, reference time ephemeris, in seconds - smaxis (a), satellite semi-major axis, in meters - ecc (e), satellite eccentricity - izero (I_0), inclination angle at reference time, in radians - razero (OMEGA_0), right ascension at reference time, in radians (longitude of ascending node of orbit plane at weekly epoch) - argper (omega), argument of perigee, in radians - mzero (M_0), mean anomaly at reference time, in radians - radot (OMEGA_DOT), rate of right ascension, in radians/second - deln (delta_n), mean motion difference from computed value, in radians/second - idot (I_DOT), rate of inclination angle, in radians/second - cic, amplitude of the cosine harmonic correction term to the angle of inclination, in radians - cis, amplitude of the sine harmonic correction term to the angle of inclination, in radians - crc, amplitude of the cosine harmonic correction term to the orbit radius, in meters - crs, amplitude of the sine harmonic correction term to the orbit radius, in meters - cuc, amplitude of the cosine harmonic correction term to the argument of latitude, in radians - cus, amplitude of the sine harmonic correction term to the argument of latitude, in radians

Note that the macros svpalm.m and svpeph.m do not have the satellite number value asinput, and the counting of the satellite number should be done before or after calling thesemacros. For example, by using the program XSVPALM with the options: 1) use defaultdata, 2) do not save the generated data into a specified file, the following output isdisplayed on screen

Page 59: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-25 -

» xsvpalm

Do you want to use the default data? (y/n)[y]

Do you want to save the generated data? (y/n)[y] n

***************************************************************

*****Simulation time = 2.3820500e+005 seconds

*****Almanac data for satellite # 1toa = 2.44800000000000e+005 secondssmaxis = 2.65603600409000e+007 metersecc = 5.28036116157000e-003izero = 9.70306409202000e-001 radiansrazero = -3.09805209344000e+000 radiansargper = 2.88898057517000e+000 radiansmzero = -7.84710884484000e-001 radiansradot = -7.84889836669000e-009 radians/second

ECEF position for satellite # 1 based on almanac datax-component = 1.30432112750496e+007 metersy-component = -1.19327165501914e+007 metersz-component = 1.98564725885978e+007 meters

***************************************************************

End of the program XSVPALM

»

For example, by using the program XSVEPH with the options: 1) use default data, 2) donot save the generated data into a specified file, the following output is displayed onscreen.

» xsvpeph

Do you want to use the default data? (y/n)[y]

Do you want to save the generated data? (y/n)[y] n

******************************************************************

*****Simulation time = 2.3820500e+005 seconds

*****Satellite ephemeris data for satellite 1toe = 1.00000000000000e+000 secondssmaxis = 2.44800000000000e+005 metersecc = 2.65603600409000e+007izero = 5.28036116157000e-003 radiansrazero = 9.70306409202000e-001 radiansargper = -3.09805209344000e+000 radiansmzero = 2.88898057517000e+000 radiansradot = -7.84710884484000e-001 radians/seconddeln = -7.84889836669000e-009 radians/second

Page 60: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-26 -

idot = 4.22624746874000e-009 radians/secondcic = -5.71452370000000e-012 radianscis = 3.72529029846000e-008 radianscrc = -2.42143869400000e-008 meterscrs = 1.76593750000000e+002 meterscuc = -7.20937500000000e+001 radianscus = -3.73087823391000e-006 radians

ECEF position for the selected satellite 1 based on ephemeris datax-component = 1.30430014347412e+007 metersy-component = -1.19330503602754e+007 metersz-component = 1.98561896412499e+007 meters

******************************************************************

End of the program XSVPEPH

»

By using the program XSVPCOMP a comparison between the satellite position based onalmanac and ephemeris data can be determined. For example, by using the default dataset, the RSS satellite position difference can be as high as about 175 meters and as low asabout 87 meters – see Figure 3-13 – with the average of about 137 meters. This resultemphasis the importance of using complete ephemeris data when a precise satelliteposition is needed.

» xsvpcomp

Do you want to use the default data? (y/n)[y]

Specify number of steps -- > 1200

Specify the time-step, in seconds, e.g. 10. --> 30

Place the text with statistics on the graph; Press <Enter> or <Return> key to start ...

Press <Enter> or <Return> key to continue ...

Do you want to save the generated data? (y/n)[y]

Specify the output filename based on ephemeris computation --> xsvcompe.out

Specify the output filename based on almanac computation --> xsvcompa.out

End of the program XSVPCOMP

»

Page 61: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-27 -

Figure 3-13. RSS satellite position difference based on almanac and ephemeris data.

3.14 Determination of azimuth and elevation angles and execution ofrelated plots

The m-file programs XELAZ, XPELAZS and XPELAZA can be used to determineelevation and azimuth angles and to execute related plots, namely: azimuth and elevationangles versus time sequence for a specified user’s location, azimuth-elevation (skyplot)for a specified satellite and user’s position, number of visible satellites versus timesequence for a specified location, and azimuth-elevation (skyplot) for all satellites andspecified user’s position.

Below we are presenting an example that first uses the program XELAZ to generateelevation data, azimuth data and number of visible satellites for specified user locations;it then plots the desired graphs by using the program XPELAZS for a specified satellite.

The program XELAZ is asking the user to enter the following input data:- almanac data; the default file is wk749.dat. The input almanac data file can be created

as specified in section 3.13.- geographic location(s) for the test; the default data file is xelaz1.dat. The data can also

be entered from the keyboard by specifying latitude in radians, longitude in radiansand altitude above the ellipsoid in meters

- elevation mask angle limit; the default value is 0. degrees- simulation time (GPS time of week); the default value is 0.

0 200 400 600 800 1000 120080

90

100

110

120

130

140

150

160

170

180RSS Satellite position difference based on ephemeris and almanac versus Time step number

RS

S S

atel

lite

posi

tion

diffe

renc

e, in

met

ers

Time step number; initial time (tow) = 375300 second(s) and time step = 30 second(s)

mean = 137.8169 ; st.dev. = 30.8801 ; rms = 141.2342

Page 62: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-28 -

- time step; the default value is 120 seconds- number of time samples; the default value is 360- name of the output file; the default is xelaz1.out.Other parameters are initialized only by default.

The specified output data file contains for each time step and for each visible satellite thefollowing data: 1) time step number, 2) user's position index, 3) number of visiblesatellites, 4) index of visible satellite, 5) elevation angle, 6) azimuth angle. This outputfile can be used as an input file for the program XPELAZS, which executes plots relatedto above-listed quantities.

The program XPELAZS is asking to enter the following input data:- name of the input file; the default is xelaz1.out (i.e. the file generated by the program

XELAZ). The file contains for each time step and for each visible satellite thefollowing data: 1) time step number, 2) user's position index, 3) number of visiblesatellites, 4) index of visible satellite, 5) elevation angle, in radians, 6) azimuth angle,in radians

- selected time step in seconds (same value used by the program XELAZ) - fromkeyboard; the default is 120 seconds

- selected satellite index to be analyzed - from keyboard (the available indices aredisplayed on screen)

- selected user's location index to be analyzed - from keyboard (the available indicesare displayed on screen)

- selected graph type (from the menu). The menu contains the following options: 1) Number of visible satellites versus Time sequence, 2) Elevation angle versus Time sequence for a selected satellite, 3) Azimuth angle versus Time sequence for a selected satellite, 4) Elevation and azimuth angles versus Time sequence for a selected satellite, 5) Exit program.

The programs XELAZ and XPGELAZ were executed successively with the specifieddefault input data. Figures 3-14.1 through 3-14.4 show the obtained number of visiblesatellites, elevation angle, azimuth angle, and elevation and azimuth angles versus timesequence, respectively.

The program XPELAZA is executing azimuth-elevation skyplot and number of visiblesatellites versus time step plot for all visible satellites. For example, by using the defaultdata set the following is displayed on the screen:

» xpelaza

Enter almanac data - the default is data file wk749.datDo you want to use the default data file? (y/n)[y] -->There are 25 satellites in the wk749.dat almanac

Enter geographic location dataDo you want to use a data file? (y/n)[y] -->

Page 63: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-29 -

0 50 100 150 200 250 300 350 4008

8.5

9

9.5

10

10.5

11Number of visible satellites for User # 1

Num

ber o

f vis

ible

sat

ellit

es

Time sequence (Time step = 120 seconds)

Figure 3-14.1. Elevation and azimuth angles evaluation. Number of visible satellites.

0 50 100 150 200 250 300 350 4000

5

10

15

20

25

30

35Elevation angle for SV # 9 and User # 1

Ele

vatio

n an

gle

in d

egre

es

Time sequence (Time step = 120 seconds)

Figure 3-14.2. Elevation and azimuth angles evaluation. Elevation angle.

Page 64: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-30 -

0 50 100 150 200 250 300 350 4000

20

40

60

80

100

120

140

160

180Azimuth angle for SV # 9 and User # 1

Azi

mut

h an

gle

in d

egre

es

Time sequence (Time step = 120 seconds)

Figure 3-14.3. Elevation and azimuth angles evaluation. Azimuth angle.

0 50 100 150 200 250 300 350 4000

20

40

60

80

100

120

140

160

180Elevation and Azimuth angles for SV # 9 and User # 1

Ele

vatio

n an

d az

imut

h an

gles

in d

egre

es

Time sequence (Time step = 120 seconds)

Figure 3-14.4. Elevation and azimuth angles evaluation. Elevation and azimuth angles.

Page 65: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-31 -

Enter name of the location data file - the default is xelaz1.datUse the default data file? (y/n)[y] -->

Enter elevation mask angle limit - the default value is 5. degreesDo you want to use the default value? (y/n)[y] -->

Enter simulation time (GPS time of week) - the default value is 0.Do you want to use the default value? (y/n)[y] -->

Enter time step - the default value is 120 secondsDo you want to use the default value? (y/n)[y] -->

Enter number of time samples - the default value is 60Do you want to use the default value? (y/n)[y] -->

End of the program XPELAZA

»

and Figure 3-14.5 shows the corresponding skyplot.

Figure 3-14.5. Azimuth-elevation skyplot for all visible satellites.

Basically we recommend using the programs XELAZ and XPELAZS when a detailedanalysis of individual satellite is required, while for all satellites together analysis theprogram XPELAZA is useful.

Azimuth-Elevation plot for 60 Time sequences (Time step = 120 seconds)

EastWest

North

South

60

30

0

24

7

1415

18

19

27

29

Location: lat = 0.0087266 rad, lon = 0.01309 rad, alt = 1235 mSimulation start time (tow) = 0 sec.Almanac = wk749.dat

Page 66: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-32 -

3.15 Determination of DOP quantities and execution of contour plots

The programs XDOP and XWDOP are used for the determination of dilution of precision(DOP) and weighted dilution of precision (WDOP) quantities. To determine DOP orWDOP quantities the line-of-sight (LOS) unit vectors and the weighting factors, in thecase of WDOP, are required as inputs.

For example, by using the program XDOP with the 7 line-of-sight unit vectors specifiedby the input data file geom7.dat the following result is displayed on screen:

» xdop

Do you want to save the generated data? (y/n)[n] -->

Select the macro to be used: --> 1 for dop1.m (when at least 3 LOS measurements) --> 2 for dop2.m (when only 4 LOS measurements)Make selection --> 1

Specify the input filename (with extension), e.g. geom4.dat --> geom7.dat

***** Input data ******

LOS # 1 --> 0.0778800 -0.6017930 0.7947552LOS # 2 --> 0.1730016 -0.9665970 -0.1891052LOS # 3 --> -0.8457427 -0.4893909 -0.2126402LOS # 4 --> -0.5385451 -0.2338803 0.8094870LOS # 5 --> 0.4345836 -0.7366578 -0.5181432LOS # 6 --> 0.7052152 -0.5433383 0.4554723LOS # 7 --> -0.8973768 0.3366878 0.2852302

***** Results from the macro DOP1.m *****

Geometric Dilution of Precision (GDOP) = 2.1733Position Dilution of Precision (PDOP) = 1.9564Horizontal Dilution of Precision (HDOP) = 1.7499Vertical Dilution of Precision (VDOP) = 0.8749Time Dilution of Precision (TDOP) = 0.9464

***************************************************

Do you want another computation? (y/n)[n] -->

End of program XDOP

»

For example, by using the program XWDOP with the 7 line-of-sight unit vectorsspecified by the input data file geom7.dat and the weighting factors entered fromkeyboard as (1. 1.2 0.8 1. 1.2 1.1 1.) the following result is displayed on screen:

» xwdop

Do you want to save the generated data? (y/n)[n] -->

Page 67: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-33 -

Select the macro to be used: --> 1 for wdop1.m (when at least 3 LOS measurements) --> 2 for wdop2.m (when only 4 LOS measurements)Make selection --> 1

Specify the input filename (with extension) --> geom7.dat

Enter the weighting factor for LOS # 1: 1Enter the weighting factor for LOS # 2: 1.2Enter the weighting factor for LOS # 3: 0.8Enter the weighting factor for LOS # 4: 1Enter the weighting factor for LOS # 5: 1.2Enter the weighting factor for LOS # 6: 1.1Enter the weighting factor for LOS # 7: 1

***** Input data ****************************************

LOS # 1 --> 0.0778800 -0.6017930 0.7947552 with the weighting factor --> 1.0000000LOS # 2 --> 0.1730016 -0.9665970 -0.1891052 with the weighting factor --> 1.2000000LOS # 3 --> -0.8457427 -0.4893909 -0.2126402 with the weighting factor --> 0.8000000LOS # 4 --> -0.5385451 -0.2338803 0.8094870 with the weighting factor --> 1.0000000LOS # 5 --> 0.4345836 -0.7366578 -0.5181432 with the weighting factor --> 1.2000000LOS # 6 --> 0.7052152 -0.5433383 0.4554723 with the weighting factor --> 1.1000000LOS # 7 --> -0.8973768 0.3366878 0.2852302 with the weighting factor --> 1.0000000

***** Results from the macro WDOP1.m *******************

Weighted Geometric Dilution of Precision (WGDOP) = 2.1382Weighted Position Dilution of Precision (WPDOP) = 1.9310Weighted Horizontal Dilution of Precision (WHDOP)= 1.7334Weighted Vertical Dilution of Precision (WVDOP) = 0.8508Weighted Time Dilution of Precision (WTDOP) = 0.9182

************************************************************

Do you want another computation? (y/n)[n] -->

End of the program XWDOP

»

Note that both programs XDOP and XWDOP have an option to use two different macrosdepending of the number of LOS are available; the second selection is possible only when4 LOS are available, while the first selection is available when 3 or more LOS areavailable.

Page 68: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-34 -

Finally, the program XMAPDOP can be used to determine the repartition of the numberof visible satellites and the corresponding DOPs for a specified geographical area. Theprogram XMAPDOP is asking the user to enter the following input data:- name of the input almanac data file; the default data file is- wk749.dat. The almanac input data file can be created as specified in

section 3.13.- geographic locations for the test; the default is data file

map01.dat. The first record of the file should contain the latitudelimits while the second record should contain the longitude limits,both in degrees

- elevation angle limit; the default value is 5 degrees- simulation time (GPS time of week), in seconds; the default value

is 0.- selection of xdop to be plotted- number of time samples and time step value, in seconds (if more

than one time step is selected)- name of the output file for satellite visibility statistics

(optional)- other parameters are initialized by default; the default latitude-

longitude grid is 25 by 41 (default)

By using the default input data set and the selection of GDOP as a criteria for the analysisof data the following results are displayed on screen:

» xmapdop

Enter almanac data file - the default is data file wk749.datDo you want to use the default data file? (y/n)[y] -->

Enter geographic location data - the default is the data file map01.datDo you want to use the default data file? (y/n)[y]

Enter elevation angle limit - the default value is 5 degreesDo you want to use the default value? (y/n)[y]

Enter simulation time (GPS time of week), in seconds - the default is 0.Do you want to use the default value? (y/n)[y]

Select xdop to be plottedEnter 1 for gdopEnter 2 for pdopEnter 3 for hdopEnter 4 for vdopEnter 5 for tdopMake selection --> 1

Enter number of time samples - the default value is 1Do you want to use the default value? (y/n)[y]

Do you want to save the visibility statistics? (y/n)[y]Specify the filename for satellite visibility statistics --> xmapdop1.out

***** Computation in progress for time sample = 1

Page 69: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-35 -

Figure 3-15.1 GDOP values contour map.

Figure 3-15.2 Number of visible satellites contour plot.

-6 -4 -2 0 2 4 6 8 10 1242

43

44

45

46

47

48

49

50

51

52

Longitude, in degrees

Latit

ude,

in d

egre

es

GDOP versus longitude-latitude grid, for wk749.dat at time-of-week = 0

1.5

1.6

1.6

1.7

1.7

1.8

1.8

1.9

1.9

2

2

-6 -4 -2 0 2 4 6 8 10 1242

43

44

45

46

47

48

49

50

51

52Number of visible satellites versus longitude-latitude grid, for wk749.dat at time-of-week = 0

Longitude, in degrees

Latit

ude,

in d

egre

es

88

9

Page 70: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-36 -

Include the geographic map? (y/n)[y] --> n

Plot the visible satellite contour? (y/n)[y] -->

Include the geographic map? (y/n)[y] -->

End of the program XMAPDOP

»

The obtained contour plots are presented in Figures 3-15.1 and 3-15.2 for GDOP valuesand number of visible satellites, respectively. The satellite visibility statistics saved in theselected file xmapdop1.out is as follows:***********************************************************************

XMAPDOP - RESULTS

************************************************************************Almanac: wk749.datTime of week: 0.00Geographic area:- longitude (in degrees): -7.00 to 13.00- latitude (in degrees): 42.00 to 52.00Number of space-time points analyzed = 1025*************************************************************************

SUMMARY - SATELLITE VISIBILITY STATISTICS

Number of cases with <5 visible satellites = 0, percentage = 0.00Number of cases with 5 visible satellites = 0, percentage = 0.00Number of cases with 6 visible satellites = 0, percentage = 0.00Number of cases with 7 visible satellites = 166, percentage = 16.20Number of cases with 8 visible satellites = 389, percentage = 37.95Number of cases with 9 visible satellites = 470, percentage = 45.85Number of cases with 10 visible satellites = 0, percentage = 0.00Number of cases with 11 visible satellites = 0, percentage = 0.00Number of cases with >11 visible satellites = 0, percentage = 0.00

***********************************************************************

3.16 Satellite selection based on minimum GDOP criteria

The program XSVSEL can be used to select the best 4, 5 or 6 satellites based onminimum GDOP criteria. The DOPs quantities are determined by using the m-filemodule DOP1.M.

The program XSVSEL requires the user to enter from keyboard the following input data:• name of the input filename; the default is XSVSEL1.DAT• name of the output filename; the default is XSVSEL.OUT• number of the satellites to be selected.

The output data are as follows:• number of satellites available• number of satellites to be used• indices of the selected satellites• dilution of precision (DOP) values for the selected satellites set, i.e. GDOP, PDOP,

HDOP, VDOP, and TDOP.

Page 71: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-37 -

When the default data are used (see data file XSEVSEL1.DAT), the results for theselection with 4, 5 and 6 satellites are presented in Figure 3-16.1. For comparison, whenall seven satellites are used, the results of the computation of DOP values, by using theprogram XDOP1, are presented in Figure 3-16.2.

Number of satellites available = 7Number of satellites to be used = 4Indices of the selected satellites = 1 3 5 7GDOP = 2.745PDOP = 2.488HDOP = 2.254VDOP = 1.054TDOP = 1.159

****************************************************************************************************************************

Number of satellites available = 7Number of satellites to be used = 5Indices of the selected satellites = 1 3 5 6 7GDOP = 2.453PDOP = 2.252HDOP = 2.000VDOP = 1.036TDOP = 0.973

****************************************************************************************************************************

Number of satellites available = 7Number of satellites to be used = 6Indices of the selected satellites = 1 2 3 5 6 7GDOP = 2.288PDOP = 2.081HDOP = 1.806VDOP = 1.034TDOP = 0.952

**************************************************************Figure 3-16.1. Satellites selection based on minimum GDOP; 4, 5, and 6 satellites

selection from 7 satellites available.

******************************************************************* Input data ******

LOS # 1 --> 0.0778800 -0.6017930 0.7947552LOS # 2 --> 0.1730016 -0.9665970 -0.1891052LOS # 3 --> -0.8457427 -0.4893909 -0.2126402LOS # 4 --> -0.5385451 -0.2338803 0.8094870LOS # 5 --> 0.4345836 -0.7366578 -0.5181432LOS # 6 --> 0.7052152 -0.5433383 0.4554723

Page 72: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-38 -

LOS # 7 --> -0.8973768 0.3366878 0.2852302

***** Results from the macro XDOP1.m *****

Geometric Dilution of Precision (GDOP) = 2.1733Position Dilution of Precision (PDOP) = 1.9564Horizontal Dilution of Precision (HDOP) = 1.7499Vertical Dilution of Precision (VDOP) = 0.8749Time Dilution of Precision (TDOP) = 0.9464

**************************************************************Figure 3-16.2. Satellites selection based on minimum GDOP;all satellites selection

from 7 satellites available.

3.17 Determination of iono correction and execution of related graphs

The m-file program XIONOC is used to determine the iono correction and to executeseveral related plots. The macro IONOC computes L1 iono correction for a specified userby using Klobuchar model, and macro IONOCON sets the Klobuchar model ionoconstants alpha and beta. The program XIONOC executes four plots related to the ionocorrection, namely• plot of number of visible satellites versus time sample number• 3-D plot of iono correction versus time sample number• plot of iono correction versus satellite id for a selected time sample number (the value

is set to 0. when the satellite is not visible)• plot of iono correction versus time sample number for a selected satellite (from the

list of visible satellites),and, optional, the generated data can be saved into a specified file.

For example, by using the default data set and selecting 20 time samples the following isdisplayed on screen:

» xionoc

Enter almanac data - the default is data file wk749.datDo you want to use the default data file? (y/n)[y] -->

Enter geographic location data - the default is the data file locat1.datDo you want to use the default data file? (y/n)[y]

Enter elevation angle limit - the default value is 5 degreesDo you want to use the default value? (y/n)[y]

Enter initial simulation time (GPS time of week), in seconds - the default is 0.Do you want to use the default value? (y/n)[y]

Enter number of time samples - the default value is 10Do you want to use the default value? (y/n)[y] nEnter number of time samples --> 20

Enter time step - the default value is 300.Do you want to use the default value? (y/n)[y]

Page 73: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-39 -

***** Computation in progress for time sample = 1***** Computation in progress for time sample = 2***** Computation in progress for time sample = 3***** Computation in progress for time sample = 4***** Computation in progress for time sample = 5***** Computation in progress for time sample = 6***** Computation in progress for time sample = 7***** Computation in progress for time sample = 8***** Computation in progress for time sample = 9***** Computation in progress for time sample = 10***** Computation in progress for time sample = 11***** Computation in progress for time sample = 12***** Computation in progress for time sample = 13***** Computation in progress for time sample = 14***** Computation in progress for time sample = 15***** Computation in progress for time sample = 16***** Computation in progress for time sample = 17***** Computation in progress for time sample = 18***** Computation in progress for time sample = 19***** Computation in progress for time sample = 20

Do you want to save the iono correction data? (y/n)[n] y

Do you want to use the default file, xionoc1.out? (y/n)[y]

Number of time sample available = 20Select the time sample number to be analyzed --> 20

The following satellites are in the almanac: 1 2 4 5 6 7 9 12 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 31Select the satellite id --> 5

End of the program XIONOC

»

The resulted plots are presented in Figures 3-17.1 to 3-17.4. The obtained data can besaved into a specified output data file.

Page 74: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-40 -

Figure 3-17.1 Number of visible satellites versus time sample number

Figure 3-17.2 Iono correction versus time sample and satellite id

2 4 6 8 10 12 14 16 18 203

4

5

6

7

8

9

10

11

12

Time sample number (time step = 300 seconds, start time tow = 0 seconds)

Num

ber o

f vis

ible

sat

ellit

es

Number of visible satellites versus Time sample number (almanac wk749.dat)

Page 75: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-41 -

Figure 3-17.3 Iono correction versus satellite id, for a specified time sample

Figure 3-17.4 Iono correction versus time sample number for a specified satellite

5 10 15 20 25 30

0

2

4

6

8

10

12

14

16

Satellite number (almanac wk749.dat)

Iono

cor

rect

ion,

in m

eter

s (0

if s

atel

lite

is n

ot v

isib

le)

Iono correction versus Satellite number, for Time sample # 20

0 2 4 6 8 10 12 14 16 18 204.4

4.6

4.8

5

5.2

5.4

5.6

5.8

6

Time sample number (time step = 300 seconds, start time tow = 0 seconds)

Iono

cor

rect

ion,

in m

eter

s

Iono correction versus Time sample number, for satellte # 5 (almanac wk749.dat)

Page 76: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-42 -

3.18 Determination of troposphere delay correction

The program XTROPOC1 determines troposphere delay contour graph for a specifiedlatitude-longitude location, elevation angle, and altitude range by using a simplifiedmodel; WGS-84 geoid heights are used. The resulted contour graph depends on altitudeabove WGS-84 ellipsoid and elevation angle.

For example, by using the default file tgeoid84.dat for the WGS-84 geoid heights, andlatitude/longitude entry from the keyboard the following is displayed on screen:

» xtropoc1

Enter latitude, in degrees --> 32.12345Enter longitude, in degrees --> -118.12345

Do you want to execute another computation/plot? (y/n)[n] -->

End of the program XTROPOC1

»

and the resulted contour graph is presented in Figure 3-18.

Figure 3-18. Troposphere delay for a specified latitude/longitude location

0. 2000. 4000. 6000. 8000. 0

10

20

30

40

50

60

70

80

90

104

3

2

1.5

1

0.8

Altitude, in meters

Ele

vatio

n A

ngle

, in

degr

ees

Tropo Delay Contours (meters), for lat=32.1234 deg.,lon=-118.1235 deg.

Page 77: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-43 -

3.19 Determination of user clock errors

The program XUCLOCK generates, saves and plots the user clock bias and drift for aspecified number of receivers and time steps, by using a simplified second order model[8].

The user has to enter the following data from the keyboard:- maximum number of users (receivers), nru (default is 6)- number of time steps to be generated, nrsteps (default is 1800)- time step value, in seconds (default is 1 second)- white noise spectral density amplitude (Sb) for the first component corresponding to clock bias, in seconds- white noise spectral density amplitude (Sd) for the second component corresponding to clock drift, in second/second- random number seed value (default is 0)- selection of the storage data file - mat-files: ucbfile.mat and ucdfile.mat - selected name for two ASCII data files - none, no storage (default)- selection of user clock bias and drift plots from generated data- some application specific parameters are initialized by default (see Sb and Sd for a clock with crystal oscillator)

If the default data are used then the user clock bias and drift for the user 2 are presented inFigure 3-19.

Figure 3-19. User clock bias and drift errors versus time step number

0 200 400 600 800 1000 1200 1400 1600 1800-3

-2

-1

0

1x 104

Use

r clo

ck b

ias,

in m

eter

s

User clock bias versus Time step, for user 2

mean = -9115.1801 ; st.dev. = 7267.3293 ; rms = 11657.6406

0 200 400 600 800 1000 1200 1400 1600 1800-30

-20

-10

0

10

Time step number (time step = 1second(s))Use

r clo

ck d

rift,

in m

eter

s/se

cond User clock drift versus Time step, for user 2

mean = -12.3784 ; st.dev. = 5.8504 ; rms = 13.6913

Page 78: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-44 -

3.20 Determination of multipath error

The program XMPATH generates, saves and plots the multipath pseudorange errors for aspecified number of satellites and time steps, by using a method presented in [25], [28],[29].

The user has to enter the following data from the keyboard:- maximum number of satellites used, nrsv (default is 12)- number of time steps to be generated, nrstep (default is 1800)- random number seed value (default is 0)- selection of the storage data file - mpfile.mat - selected name for ASCII data file- none, no storage (default)- selection of multipath plots from generated data- satellite(s) number for which the generated data is plotted- application specific parameters are initialized by default (see sigma, order and wn) and time step is 1 second

For example, by using the default data, the multipath pseudorange error for satellitenumber 5 is presented in Figure 3-20. The output file xmpath1.out contains multipathdata for 6 different satellites.

Figure 3-20. Multipath error versus time step number

0 200 400 600 800 1000 1200 1400 1600 1800-4

-3

-2

-1

0

1

2

3

4

5

6

Time step number

Mul

tipat

h ps

eudo

rang

e er

rors

, in

met

ers

Multipath pseudorange errors versus Time step, for satellite number 5

mean = 0.3101 ; st.dev. = 1.2443 ; rms = 1.2824

Page 79: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-45 -

3.21 Determination of user earth rotation correction error

The program XUERCOR generates the user earth rotation correction vector and plots thevector magnitude for a specified latitude-longitude grid; the vector is computed onlywhen the satellite is visible, i.e. when the elevation angle is greater or equal to theelevation mask angle.

The user has to enter the following data from the keyboard:- name of the input almanac data file; the default is data file wk749.dat. The almanac input data file can be created as specified in 3.13.- elevation mask angle, in degrees; the default value is 5 degrees- simulation time, time of week, in seconds; the default value is 0.- index of the selected satellite (prn)- longitude/latitude/altitude grid by default (longitude and latitude by 10 degrees from 0 to 360, and -90 to 90, respectively, and altitude is always 0 meters); the grid can be easily modified- option to save the generated data in the file ercor.mat

For example, by using the default data, the magnitude of the earth rotation correctionvector is presented in Figure 3-21.

Figure 3-21. Multipath error versus time step number

A similar program can be created to plot the magnitude of the earth rotation correctionvector versus time for a specified location.

Page 80: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-46 -

3.22 Computation of position fix through direct and iterative methods

The m-file programs XUPOSD4, XUPOSDG and XUPOSIT are used to determine theuser’s ECEF position when at least four satellites positions and the correspondingpseudoranges are known.

The programs XUPOSD4 and XUPOSDG are using a direct method [5], [9], while theprogram XUPOSIT is implementing an iterative method. The program XUPOSD4requires four satellites positions and the corresponding pseudoranges, while XUPOSDGcan use four or more measurements in order to determine the user’s position fix. It isworth mentioning that the program XUPOSDG (and the m-file module UPOSDG.M) canbe indirectly used to evaluate the compatibility of the measurements when there are morethan four available.

The main programs XUPOSD4 and XUPOSDG require you to enter the following inputdata from the keyboard :- name of the output data file if selected, otherwise the results are displayed on screen- name of the ASCII input data file; each row contains three components of the ECEF satellites position and the corresponding pseudorange

The main program XUPOSIT requires an additional entry from keyboard, namely- initial user’s position in ECEF; the default value is (0. 0. 0.).

As an example all three programs were run with the input data file SV4POSR.DAT, andthe default initialization for the user’s position required by the program XUPOSIT wasselected.

As expected the results are identical for the programs XUPOSD4 and XUPOSDG - seeFigure 3-22.1, while the program XUPOSIT produces the same results after the fourthiteration - see Figure 3-22.2. For additional test results one can examine the filexuposdg.out where different input data files are used, i.e. sv*posr.dat and sv*bposr.dat.

******************************** INPUT DATA ********************************

For SV # 1 ***** ECEF position (in meters) : -19123734.8458861 4796367.7619305 17869429.2812209 ***** Pseudorange (in meters) : 23909742.7976553

For SV # 2 ***** ECEF position (in meters) : -8193159.7590035 -23701864.0154019 8895653.7904103 ***** Pseudorange (in meters) : 20573499.7833666

For SV # 3 ***** ECEF position (in meters) : -9484186.0430210 -11984566.8851433 21782085.5906154 ***** Pseudorange (in meters) :

Page 81: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-47 -

20856075.2284462

For SV # 4 ***** ECEF position (in meters) : 14919884.5916690 -8641808.9140306 20267093.1182708 ***** Pseudorange (in meters) : 24459299.8736929

******************************* RESULTS *************************************

Computed ECEF user"s position (in meters) : -2485034.2627931 -4673669.7053273 3546446.5637510

Computed user"s clock bias measured in units of distance (in meters) : 0.00000000256114

*******************************************************************************

Figure 3-22.1. Determination of user’s position by using a direct method

******************************** INPUT DATA ********************************

For SV # 1 ***** ECEF position (in meters) : -19123734.8458861 4796367.7619305 17869429.2812209 ***** Pseudorange (in meters) : 23909742.7976553

For SV # 2 ***** ECEF position (in meters) : -8193159.7590035 -23701864.0154019 8895653.7904103 ***** Pseudorange (in meters) : 20573499.7833666

For SV # 3 ***** ECEF position (in meters) : -9484186.0430210 -11984566.8851433 21782085.5906154 ***** Pseudorange (in meters) : 20856075.2284462

For SV # 4 ***** ECEF position (in meters) : 14919884.5916690 -8641808.9140306 20267093.1182708 ***** Pseudorange (in meters) : 24459299.8736929

Initial user"s ECEF position (in meters) : 0.0000000 0.0000000 0.0000000

******************************* RESULTS *************************************

***** After iteration = 1Computed ECEF user"s position (in meters) : -2910941.9754610 -5543114.2074126 4165091.1910825

Computed user"s clock bias measured in units of distance (in meters) : 1190745.07862144500000

Page 82: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-48 -

***** After iteration = 2Computed ECEF user"s position (in meters) : -2494496.7367185 -4695642.2333165 3558422.3347400

Computed user"s clock bias measured in units of distance (in meters) : 29912.18300978350000

***** After iteration = 3Computed ECEF user"s position (in meters) : -2485039.1049969 -4673682.1099747 3546449.0004498

Computed user"s clock bias measured in units of distance (in meters) : 14.34086189510712

***** After iteration = 4Computed ECEF user"s position (in meters) : -2485034.2627939 -4673669.7053299 3546446.5637488

Computed user"s clock bias measured in units of distance (in meters) : 0.00000208603516

***** After iteration = 5Computed ECEF user"s position (in meters) : -2485034.2627931 -4673669.7053273 3546446.5637510

Computed user"s clock bias measured in units of distance (in meters) : -0.00000000371302

*******************************************************************************

Figure 3-22.2. Determination of user’s position by using an iterative method

3.23 Evaluation of weighted least square navigation solution

The program XPFWLS determines the position fix using the weighted least squarealgorithm when the user is stationary; the pseudoranges are generated by adding a randomnumber generated error to the truth range. The program computes the horizontal (East-North) position error, East/North/Up position error versus time step, and the magnitudesof horizontal/vertical/3-dimensional position error versus time.

The user has to enter the following data from the keyboard:- name of the almanac input data file; the default is data file wk749.dat. The almanac input data file can be created as specified in 3.13.- user's true position (latitude, longitude and altitude) entered from keyboard or a specified data file- elevation mask angle limit in degrees; the default is 5. degrees- selection of the measurement standard deviation; the default is 33 meters for SPS and 6 meters for PPS; at the same time specific uniformly distributed weighted factors are selected for up to 33 satellite measurements- simulation time (GPS time of week); the default value is 0.- number of time steps- time step, in seconds- name of the output file (optional)

Page 83: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-49 -

- selection of the graph- other parameters are initialized by default

For example, by using the following input data from the keyboard:

» xpfwls

Enter almanac data file - the default is data file wk749.datDo you want to use the default data file? (y/n)[y]

Enter user"s true position from keyboard? (y/n)[y]

Enter latitude, in degrees --> 37Enter longitude, in degrees --> -122Enter altitude, in meters --> 100

Enter elevation angle limit; the default value is 5. degreesDo you want to use the default value? (y/n)[y]

Enter GPS receiver type : 1 --> SPS with Selective Availability On 2 --> SPS with Selective Availability OffMake the selection --> 2

Enter initial simulation time (GPS time of week); the default value is 0.Do you want to use the default value? (y/n)[y]

Enter number of time steps, e.g. 50 --> 50

Enter time step, in seconds, e.g. 60 --> 60

Do you want to save the generated data? (y/n)[n]

Do you want to execute the graphs? (y/n)[y]

Execute the horizontal position error graph ...Select the mouse position to insert statistics text on the graph...Press a key to start ...

End of the program XPFWLS

»

and the resulted graphs are presented in Figures 3-23.1 to 3-23.3.

The program can be modified to include the following cases:- non-stationary user with a prescribed trajectory,- pseudoranges generated by using the iono/tropo errors, user clock bias and drift

errors, multipath errors, user earth rotation error, and random errors due topseudorange.

Page 84: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-50 -

Figure 3-23.1. Weighted Least Squares Position Fix – Horizontal position error

Figure 3-23.2. Weighted Least Squares Position Fix – East/North/Up position error

-20 -15 -10 -5 0 5 10 15 20-20

-15

-10

-5

0

5

10

15

20Weighted Least Squares Position Fix - Horizontal Position Error - for SPS with SA Off

Nor

th P

ositi

on E

rror,

in m

eter

s

East Position Error, in meters

mean = 4.6734 ; st.dev. = 2.5148 ; rms = 5.3071

0 5 10 15 20 25 30 35 40 45 50-20

-10

0

10Weighted Least Squares Position Fix - East/North/Up Position Error - for SPS with SA Off

Eas

t, in

met

ers

mean = 0.087313 ; st.dev. = 4.2743 ; rms = 4.2752

0 5 10 15 20 25 30 35 40 45 50-10

0

10

Nor

th, i

n m

eter

s

mean = -0.30377 ; st.dev. = 3.1999 ; rms = 3.2142

0 5 10 15 20 25 30 35 40 45 50-20

0

20

Up,

in m

eter

s

Time step number (time step = 60 seconds, almanac = wk749.dat)

mean = 1.2942 ; st.dev. = 7.4466 ; rms = 7.5582

Page 85: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-51 -

Figure 3-23.3. Weighted Least Squares Position Fix – Magnitude of position errors

3.24 GPS RAIM integrity evaluation

The m-file programs XRAIMST.M and XRAIMFD.M can be used to evaluate GPSRAIM for a specified set of input data. The program XRAIMST implements the baselinestandard constant alarm rate algorithm [7] and determines availability and failure flags,while the program XRAIMFD implements the fault detection part of the fault detectionand exclusion algorithm presented in [23]. Both programs can be expanded to include theisolation/exclusion portion of the algorithms, respectively, as well as to include RAIMevaluation for a dynamic scenario. At this time, for clarity of the presentation, we decidedto incorporate only the fault detection portions.

The program XRAIMST requires to enter from keyboard the following input data:- name of the data file containing line-of-sight unit vectors, each vector is stored in

another row (it should be 3 columns); a complete set of default values with 7 line-of-sight vectors are specified

- name of the data file containing errors in true ranges, a set of default values is specified- name of the output file (optional); the default is the screen.Values of the threshold and approximate radial error protected ceilings are automaticallyselected from a table specified in [7] for non-precision approach flight case.

The output file contains the values of the selected input data set and the status of theoutput flags, i.e. availability flag and test statistic/failure flag. The results obtained byusing the default values with the program XRAIMST are presented in Figure 3-24.1.

0 5 10 15 20 25 30 35 40 45 500

5

10

15Weighted Least Squares Position Fix - Magnitude of Position Errors - for SPS with SA Off

Hor

izon

tal,

in m

eter

s

mean = 4.6734 ; st.dev. = 2.5148 ; rms = 5.3071

0 5 10 15 20 25 30 35 40 45 500

10

20

Ver

tical

, in

met

ers

mean = 5.9995 ; st.dev. = 4.5201 ; rms = 7.5117

0 5 10 15 20 25 30 35 40 45 500

10

20

3-D

imen

sion

al, i

n m

eter

s

Time step number (time step = 60 seconds, almanac = wk749.dat)

mean = 8.2945 ; st.dev. = 3.9458 ; rms = 9.1852

Page 86: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-52 -

**************************************************************

***** Input data ******

LOS # 1 --> 0.0778799 -0.6017930 0.7947552LOS # 2 --> 0.1730016 -0.9665970 -0.1891052LOS # 3 --> -0.8457427 -0.4893909 -0.2126402LOS # 4 --> -0.5385451 -0.2338803 0.8094870LOS # 5 --> 0.4345836 -0.7366578 -0.5181432LOS # 6 --> 0.7052152 -0.5433383 0.4554723LOS # 7 --> -0.8973768 0.3366878 0.2852302

Non-Precision Approach - threshold (in meters) = 90.00000Non-Precision Approach - ARP ceiling (in meters) = 353.00000

Range error # 1 (in meters) --> 35.00000Range error # 2 (in meters) --> 30.00000Range error # 3 (in meters) --> 37.00000Range error # 4 (in meters) --> 36.00000Range error # 5 (in meters) --> 36.00000Range error # 6 (in meters) --> 39.00000Range error # 7 (in meters) --> 40.00000

***** Results by using XRAIMST ******

Availability flag --> InadmissibleTest statistic --> No failure

**************************************************************

Figure 3-24.1. GPS RAIM integrity evaluation by using m-file program XRAIMST.

The program XRAIMFD requires to enter from keyboard the following input data:- name of the data file containing line-of-sight unit vectors, each vector is stored in

another row (it should be 3 columns); a complete set of default values with 7 line-of-sight vectors are specified

- number of steps to be executed; the default is 1- number of measurements for each step; the default is 7- name of the output file (optional); the default is the screen.The probability of false alarm, probability of missed detection and standard deviation ofmeasurement noise are automatically selected as 0.0000667, 0.001, and 33.3 meters,respectively. The input data file XRAIMFD1.DAT contains input data for three steps with7, 6 and 5 measurements, respectively.

The output file contains the values of the selected input data set and the status of theoutput flags, i.e. false alarm, true alarm, missed detection, normal operation andunavailable, at each time step. The results obtained by using the default values with theprogram XRAIMFD are presented below in Figure 3-24.2.

**************************************************************

***** Input data ******

LOS # 1 --> 0.0778799 -0.6017930 0.7947552

Page 87: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-53 -

LOS # 2 --> 0.1730016 -0.9665970 -0.1891052LOS # 3 --> -0.8457427 -0.4893909 -0.2126402LOS # 4 --> -0.5385451 -0.2338803 0.8094870LOS # 5 --> 0.4345836 -0.7366578 -0.5181432LOS # 6 --> 0.7052152 -0.5433383 0.4554723LOS # 7 --> -0.8973768 0.3366878 0.2852302

Probability of false alarm = 0.0000667Probability of missed detection = 0.0010000Standard deviation of measurement noise (in meters) = 33.30

***** Results by using XRAIMFD ******

*** Step = 1 ***False Alarm Flag = 0True Alarm Flag = 1Missed Detection Flag = 0Normal Operation Flag = 0Unavailable Flag = 0

**************************************************************

Figure 3-24.2. GPS RAIM integrity evaluation by using m-file program XRAIMFD.

3.25 Determination of thresholds used in RAIM/FDE evaluations

The program XFDNT determines the fault detection normalized thresholds for a specifiedprobability of false alarm and degree of freedom from 1 to 16, by using the methodpresented in [ ]. For the first degree of freedom case a Gaussian distribution is considered,while for higher degree of freedom cases a Chi-square distribution are assumed. For theRAIM with constant false alarm thresholds [26], the unnormalized test statistic thresholdscan be determined as follows:test statistic thresholds = (normalized thresholds)*(std. deviation of measurement error)

For example, by selecting 6.666667e-5 as probability of false alarm and xfdnt2.out asoutput file, the following is displayed on the screen:

» xfdnt

Enter the probability of false alarmDo you want to use the default data 3.3333e-7? (y/n)[n] -->Enter the false alarm tolerance --> 6.666667e-5

Enter the output desired (output file or on screen)Do you want to display the results on screen? (y/n)[n] -->

Specify the output filename --> xfdnt2.out

Computation in progress for degree of freedom = 1Computation in progress for degree of freedom = 2

Page 88: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-54 -

Computation in progress for degree of freedom = 3Computation in progress for degree of freedom = 4Computation in progress for degree of freedom = 5Computation in progress for degree of freedom = 6Computation in progress for degree of freedom = 7Computation in progress for degree of freedom = 8Computation in progress for degree of freedom = 9Computation in progress for degree of freedom = 10Computation in progress for degree of freedom = 11Computation in progress for degree of freedom = 12Computation in progress for degree of freedom = 13Computation in progress for degree of freedom = 14Computation in progress for degree of freedom = 15Computation in progress for degree of freedom = 16

End of the program XFDNT

»

The output file xfdnt2.out contains the following information:

***************************************************************

*** COMPUTATION OF FAULT DETECTION NORMALIZED THRESHOLDS ****** for RAIM with constant false alarm ***

***************************************************************

***** Input data *****

Probability of false alarm = 6.666667e-005

***** Results by using XFDNT *****

Degree of freedom = 1 ==> Normalized threshold = 3.98792Degree of freedom = 2 ==> Normalized threshold = 4.38539Degree of freedom = 3 ==> Normalized threshold = 4.68560Degree of freedom = 4 ==> Normalized threshold = 4.93879Degree of freedom = 5 ==> Normalized threshold = 5.16259Degree of freedom = 6 ==> Normalized threshold = 5.36564Degree of freedom = 7 ==> Normalized threshold = 5.55301Degree of freedom = 8 ==> Normalized threshold = 5.72792Degree of freedom = 9 ==> Normalized threshold = 5.89265Degree of freedom = 10 ==> Normalized threshold = 6.04884Degree of freedom = 11 ==> Normalized threshold = 6.19770Degree of freedom = 12 ==> Normalized threshold = 6.34020Degree of freedom = 13 ==> Normalized threshold = 6.47710Degree of freedom = 14 ==> Normalized threshold = 6.60904Degree of freedom = 15 ==> Normalized threshold = 6.73654Degree of freedom = 16 ==> Normalized threshold = 6.86000

***************************************************************

The file xfdnt1.out contains the results when the probability of false alarm is 3.3333e-7.

The program XPBIAS determines the value of parity bias threshold for the 5measurements case (Gaussian distribution) and degree of freedom is 1, and for the 6 andup to 14 measurements (Chi-square distribution) and degrees of freedom 2 to 10. As inputdata the program requires the entry of the probability of missed detection (default value is0.001) and the set of fault detection normalized thresholds for degrees of freedom 1 to 10

Page 89: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-55 -

(determined by the program XFDNT). The program implements the algorithm presentedin [26].

For example, by selecting the default values for the probability of false alarm andprobability of missed detection, i.e. 3.3333e-7 and 0.001, respectively, the following isdisplayed on the screen:

» xpbias

Enter the data for the precomputed threshold table tdDo you want to use the default data for pfa = 3.3333e-7? (y/n) --> y

Enter value for the probability of missed detection (pmd)Use the default data, pmd = 0.001 ? (y/n) --> y

Enter the output desired (output file or on screen)Do you want to display the results on screen? (y/n) --> y

***** For dof = 1 *****Use default for initial guess for pbiasb? (y/n) --> y

***** For dof = 2 *****Use default for initial guess for lambda? (y/n) --> y

***** For dof = 3 *****Use default for initial guess for lambda? (y/n) --> y

***** For dof = 4 *****Use default for initial guess for lambda? (y/n) --> y

***** For dof = 5 *****Use default for initial guess for lambda? (y/n) --> y

***** For dof = 6 *****Use default for initial guess for lambda? (y/n) --> y

***** For dof = 7 *****Use default for initial guess for lambda? (y/n) --> y

***** For dof = 8 *****Use default for initial guess for lambda? (y/n) --> y

***** For dof = 9 *****Use default for initial guess for lambda? (y/n) --> y

***** For dof = 10 *****Use default for initial guess for lambda? (y/n) --> y

****************************************************************

Page 90: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-56 -

*** COMPUTATION OF FAULT DETECTION PARITY BIAS THRESHOLDS **** for RAIM with constant false alarm

***** Input data *****

When dof = 1 , td = 5.1038300When dof = 2 , td = 5.4615200When dof = 3 , td = 5.7385400When dof = 4 , td = 5.9752200When dof = 5 , td = 6.1862800When dof = 6 , td = 6.3790000When dof = 7 , td = 6.5577400When dof = 8 , td = 6.7251400When dof = 9 , td = 6.8835400When dof = 10 , td = 7.0338300

Probability of false alarm = 3.333300e-007

Probability of missed detection = 1.000000e-003

***** Results by using XPBIAS *****

When dof = 1 , Normalized pbiasb = 8.1940634When dof = 2 , Normalized pbiasb = 8.4785881When dof = 3 , Normalized pbiasb = 8.6876348When dof = 4 , Normalized pbiasb = 8.8598829When dof = 5 , Normalized pbiasb = 9.0092513When dof = 6 , Normalized pbiasb = 9.1425071When dof = 7 , Normalized pbiasb = 9.2636820When dof = 8 , Normalized pbiasb = 9.3751593When dof = 9 , Normalized pbiasb = 9.4790950When dof = 10 , Normalized pbiasb = 9.5761994

****************************************************************

End of the program XPBIAS

»

The files xpbias1.out and xpbias2.out contain the results when the probability of falsealarm is 3.3333e-7 and 6.66667e-5, respectively; the probability of missed detection isselected as 0.001.

3.26 RAIM Fault detection availability determination

The program XRAIMDA determines RAIM fault detection availability for the case of all-in-view satellites based on a constant false alarm rate algorithm [7], [27]. The user canexecute the program by using the default set of input data or by using a selected set ofinput data. The program requires the following input data:- name of the input almanac data file; the default is data file

svprime.dat. The input data file can be created as specified in 3.13.- geographic locations for the test; the default is data file mops24.dat. Each record contains the data related to a location in the following order: latitude (degrees), longitude (degrees), altitude (meters)

Page 91: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-57 -

- elevation mask angle limit in degrees; the default is 5. degrees- GPS receiver type: Standard Position System (SPS) with SA on, SPS without SA, or user's selected standard deviation of measurement error, in meters- phase-of-flight (Non-Precision Approach, Terminal, En-Route, Oceanic and user defined HAL)- probability of false alarm, probability of missed detection, and the corresponding pbias thresholds; default values are provided- initial simulation time (GPS time of week); the default value is 0.- number of time steps; default value is 48 [1]- time increment, in seconds; default value is 1800 [1]- name of the statistics output file, the default is the screen- name of the output file containing unavailable cases (optional)- selection of the bar graph of visible satellites (optional)- selection of the histogram plot of horizontal protection level (HPL) repartition (optional)- other parameters are initialized by default

It is worth mentioning that the fault detection thresholds are those determined by usingprograms XFDNT and XPBIAS, and the files svprime.dat and mops.dat contain dataspecified in [1], [2]. For example, by using the default input data set with the selectionsfor SPS with SA on, Non-Precision Approach, pfa = 6.6667e-5 and pmd = 0.001, andsaving the results in files xraimda1.out and xraimda2.out, the following is displayed onscreen:» xraimda

Enter almanac data file - the default is datafile svprime.datDo you want to use the default datafile? (y/n)[y]

Enter geographic location data - the default is the datafile mops24.datDo you want to use the default datafile? (y/n)[y]

Enter elevation mask angle limit - the default value is 5. degreesDo you want to use the default value? (y/n)[y]

Enter GPS receiver type : 1 --> Standard Position System (SPS) with SA On 2 --> Standard Position System (SPS) with SA Off 3 --> User defined Std. Dev. of measurement errorsMake the selection --> 1

Select phase-of-flight: 1 --> Non-Precision Approach (NPA) 2 --> Terminal 3 --> En Route 4 --> Oceanic 5 --> User definedMake the selection --> 1

Enter values for pfa, pmd and pbiasb: 1 --> For pfa = 6.6667e-5 and pmd = 0.001 2 --> For pfa = 3.3333e-7 and pmd = 0.001 3 --> Enter the user defined valuesMake the selection --> 1

Enter initial simulation time (GPS time of week) - the default value is 0.Do you want to use the default value? (y/n)[y]

Enter number of time samples - the default value is 48

Page 92: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-58 -

Do you want to use the default value? (y/n)[y]

Enter time increment value, in seconds - the default value is 1800Do you want to use the default value? (y/n)[y]

Do you want to save the statistics? (y/n)[n] y

Specify the statistics output filename (with extension) --> xraimda1.out

Do you want to save the unavailable cases? (y/n)[n] y

Specify the RAIM unavailable output filename (with extension) --> xraimda2.out

***** Computation in progress for time sample = 1***** Computation in progress for time sample = 2***** Computation in progress for time sample = 3***** Computation in progress for time sample = 4***** Computation in progress for time sample = 5***** Computation in progress for time sample = 6***** Computation in progress for time sample = 7***** Computation in progress for time sample = 8***** Computation in progress for time sample = 9***** Computation in progress for time sample = 10***** Computation in progress for time sample = 11***** Computation in progress for time sample = 12***** Computation in progress for time sample = 13***** Computation in progress for time sample = 14***** Computation in progress for time sample = 15***** Computation in progress for time sample = 16***** Computation in progress for time sample = 17***** Computation in progress for time sample = 18***** Computation in progress for time sample = 19***** Computation in progress for time sample = 20***** Computation in progress for time sample = 21***** Computation in progress for time sample = 22***** Computation in progress for time sample = 23***** Computation in progress for time sample = 24***** Computation in progress for time sample = 25***** Computation in progress for time sample = 26***** Computation in progress for time sample = 27***** Computation in progress for time sample = 28***** Computation in progress for time sample = 29***** Computation in progress for time sample = 30***** Computation in progress for time sample = 31***** Computation in progress for time sample = 32***** Computation in progress for time sample = 33***** Computation in progress for time sample = 34***** Computation in progress for time sample = 35***** Computation in progress for time sample = 36***** Computation in progress for time sample = 37***** Computation in progress for time sample = 38***** Computation in progress for time sample = 39***** Computation in progress for time sample = 40***** Computation in progress for time sample = 41***** Computation in progress for time sample = 42***** Computation in progress for time sample = 43***** Computation in progress for time sample = 44***** Computation in progress for time sample = 45

Page 93: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-59 -

***** Computation in progress for time sample = 46***** Computation in progress for time sample = 47***** Computation in progress for time sample = 48

Bar plot - Number of cases versus Number of visible satellitesDo you want to execute the bar graph? (y/n)[y] n

Histogram plot - Number of cases versus Horizontal protection levelDo you want to execute the histogram plot? (y/n)[y]

End of the program XRAIMDA

»

The overall statistics – see file xraimda1.out – is presented in Figure 3-26.1 and thehorizontal protection level histogram for all available cases is shown in Figures 3-26.2

****************************************************************

RAIM FAULT DETECTION AVAILABILITY TEST SUMMARY

For Non-Precision Approach with All-In-View satellites:- horizontal alarm limit (meters): 555.600- GPS receiver mode: SPS with SA On- almanac: svprime.dat- number of satellites in constellation = 24- number of locations: 24- number of time samples: 48- time increment (seconds): 1800- std. dev. of pseudorange error (meters): 33.300- elevation angle limit (degrees): 5.0000- probability of false alarm: 6.6667000e-005- probability of missed detection: 1.0000000e-003- total space-time sample points: 1152

RAIM fault detection available = 1129, percentage: 98.00347RAIM fault detection unavailable = 23, percentage: 1.99653

Repartition of RAIM fault detection available/unavailable cases:- when < 5 visible satellites: 0 available, 0 unavailable- when 5 visible satellites: 0 available, 3 unavailable- when 6 visible satellites: 33 available, 10 unavailable- when 7 visible satellites: 310 available, 10 unavailable- when 8 visible satellites: 441 available, 0 unavailable- when 9 visible satellites: 276 available, 0 unavailable- when 10 visible satellites: 64 available, 0 unavailable- when 11 visible satellites: 5 available, 0 unavailable- when 12 visible satellites: 0 available, 0 unavailable

****************************************************************

SATELLITE VISIBILITY STATISICS

Number of cases with < 5 visible satellites = 0Number of cases with 5 visible satellites = 3Number of cases with 6 visible satellites = 43Number of cases with 7 visible satellites = 320Number of cases with 8 visible satellites = 441Number of cases with 9 visible satellites = 276Number of cases with 10 visible satellites = 64Number of cases with 11 visible satellites = 5Number of cases with 12 visible satellites = 0

Page 94: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-60 -

****************************************************************Figure 3-26.1. Fault detection availability statistics summary

Figure 3-26.2. Horizontal protection level histogram of all available cases

Table 3-26 summarizes the RAIM fault detection availability results from the executionof the program XRAIMDA with different input data for phase of flight, probability offalse alarm (pfa), probability of missed detection (pmd), and standard deviation ofmeasurement errors (see SA on with 33.3 meters and SA off with 6.5 meters). Thehorizontal alarm level (HAL) for each phase of flight is 0.3, 1, 2 and 4 nautical miles forthe Non-Precision Approach, Terminal, En-Route and Oceanic, respectively [1], [2], [30].

0 50 100 150 200 250 300 350 400 450 500 550 600 650 7000

50

100

150

200

250

300

350

Horizontal protection level, in meters

Num

ber o

f cas

es

Non-Precision Approach phase of flight - Horizontal protection level histogram of available cases

min = 98.0217, max = 540.9906, mean = 235.1782 meters

Page 95: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-61 -

Table 3-26. RAIM Fault detection availability

pfa = 6.6667e-5, pmd = 0.001 pfa = 3.3333e-7, pmd = 0.001

Phase of flightSA On

(st. dev. = 33.3 m)SA Off

(st. dev. = 6.5 m)SA On

(st. dev. = 33.3 m)SA Off

(st. dev. = 6.5 m)

Non-PrecisionApproach 98.003 99.913 97.135 99.913

Terminal 99.913 99.913 99.826 99.913

En-Route 99.913 100.000 99.913 100.000

Oceanic 99.913 100.000 99.913 100.000

3.27 RAIM Fault exclusion availability determination

The program XRAIMEA determines RAIM fault exclusion availability for the case of all-in-view satellites based on a constant false alarm rate algorithm [7], [27]. The user canexecute the program by using the default set of input data or by using a selected set ofinput data. The program requires the following input data:- name of the input almanac data file; the default is data file

svprime.dat.- geographic locations for the test; the default is data file mops24. dat. Each record contains the data related to a location in the following order: latitude (degrees), longitude (degrees), altitude (meters)- elevation mask angle limit in degrees; the default is 5. degrees- GPS receiver type: Standard Position System (SPS) with SA on, SPS without SA, or user's selected standard deviation of measurement error, in meters- phase-of-flight (Non-Precision Approach, Terminal, En-Route, Oceanic and user defined HAL)- probability of false alarm, probability of missed detection, and the corresponding pbias thresholds; default values are provided- initial simulation time (GPS time of week); the default value is 0.- number of time steps; default value is 48 [1]- time increment, in seconds; default value is 1800 [1]- name of the statistics output file, the default is the screen- name of the output file containing unavailable cases (optional)- selection of the bar graph of visible satellites (optional)- selection of the histogram plot of horizontal exclusion level (HEL) repartition (optional)- other parameters are initialized by default

Again, it is worth mentioning that the fault detection thresholds are those determined byusing programs XFDNT and XPBIAS, and the files svprime.dat and mops.dat containdata specified in [1], [2]. For example, by using the default input data set with theselections for SPS with SA on, Non-Precision Approach, pfa = 6.6667e-5 and pmd =0.001, and saving the results in files xraimea1.out and xraimea2.out, the following isdisplayed on screen:

Page 96: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-62 -

» xraimea

Enter almanac data file - the default is datafile svprime.datDo you want to use the default datafile? (y/n)[y]

Enter geographic location data - the default is the datafile mops24.datDo you want to use the default datafile? (y/n)[y]

Enter elevation mask angle limit - the default value is 5. degreesDo you want to use the default value? (y/n)[y]

Enter GPS receiver type : 1 --> Standard Position System (SPS) with SA On 2 --> Standard Position System (SPS) with SA Off 3 --> User defined Std. Dev. of measurement errorsMake the selection --> 1

Select phase-of-flight: 1 --> Non-Precision Approach (NPA) 2 --> Terminal 3 --> En Route 4 --> Oceanic 5 --> User definedMake the selection --> 1

Enter values for pfa, pmd and pbiasb: 1 --> For pfa = 6.6667e-5 and pmd = 0.001 2 --> For pfa = 3.3333e-7 and pmd = 0.001 3 --> Enter the user defined valuesMake the selection --> 1

Enter initial simulation time (GPS time of week) - the default value is 0.Do you want to use the default value? (y/n)[y]

Enter number of time samples - the default value is 48Do you want to use the default value? (y/n)[y]

Enter time increment value, in seconds - the default value is 1800Do you want to use the default value? (y/n)[y]

Do you want to save the statistics? (y/n)[n] y

Specify the statistics output filename (with extension) --> xraimea1.out

Do you want to save the unavailable cases? (y/n)[n] y

Specify the RAIM unavailable output filename (with extension) --> xraimea2.out

***** Computation in progress for time sample = 1***** Computation in progress for time sample = 2***** Computation in progress for time sample = 3***** Computation in progress for time sample = 4***** Computation in progress for time sample = 5***** Computation in progress for time sample = 6***** Computation in progress for time sample = 7***** Computation in progress for time sample = 8

Page 97: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-63 -

***** Computation in progress for time sample = 9***** Computation in progress for time sample = 10***** Computation in progress for time sample = 11***** Computation in progress for time sample = 12***** Computation in progress for time sample = 13***** Computation in progress for time sample = 14***** Computation in progress for time sample = 15***** Computation in progress for time sample = 16***** Computation in progress for time sample = 17***** Computation in progress for time sample = 18***** Computation in progress for time sample = 19***** Computation in progress for time sample = 20***** Computation in progress for time sample = 21***** Computation in progress for time sample = 22***** Computation in progress for time sample = 23***** Computation in progress for time sample = 24***** Computation in progress for time sample = 25***** Computation in progress for time sample = 26***** Computation in progress for time sample = 27***** Computation in progress for time sample = 28***** Computation in progress for time sample = 29***** Computation in progress for time sample = 30***** Computation in progress for time sample = 31***** Computation in progress for time sample = 32***** Computation in progress for time sample = 33***** Computation in progress for time sample = 34***** Computation in progress for time sample = 35***** Computation in progress for time sample = 36***** Computation in progress for time sample = 37***** Computation in progress for time sample = 38***** Computation in progress for time sample = 39***** Computation in progress for time sample = 40***** Computation in progress for time sample = 41***** Computation in progress for time sample = 42***** Computation in progress for time sample = 43***** Computation in progress for time sample = 44***** Computation in progress for time sample = 45***** Computation in progress for time sample = 46***** Computation in progress for time sample = 47***** Computation in progress for time sample = 48

Bar plot - Number of cases versus Number of visible satellitesDo you want to execute the bar graph? (y/n)[y] n

Histogram plot - Number of cases versus Horizontal exclusion levelDo you want to execute the histogram plot? (y/n)[y]

End of the program XRAIMEA

»

The overall statistics – see file xraimda1.out – is presented in Figure 3-27.1 and thehorizontal protection level histogram for all available cases is shown in Figures 3-27.2****************************************************************

RAIM FAULT EXCLUSION AVAILABILITY TEST SUMMARY

Page 98: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-64 -

For Non-Precision Approach with All-In-View satellites:- horizontal alarm limit (HAL) (meters): 555.600- GPS receiver mode: SPS with SA On- almanac: svprime.dat- number of satellites in constellation = 24- number of locations: 24- number of time samples: 48- time increment (seconds): 1800- std. dev. of pseudorange error (meters): 33.300- elevation mask angle limit (degrees): 5.0000- probability of false alarm: 6.6667000e-005- probability of missed detection: 1.0000000e-003- total space-time sample points: 1152

RAIM fault exclusion available = 716, percentage: 62.15278RAIM fault exclusion unavailable = 436, percentage: 37.84722

Repartition of RAIM fault exclusion available/unavailable cases:- when < 5 visible satellites: 0 available, 0 unavailable- when 5 visible satellites: 0 available, 3 unavailable- when 6 visible satellites: 0 available, 43 unavailable- when 7 visible satellites: 52 available, 268 unavailable- when 8 visible satellites: 326 available, 115 unavailable- when 9 visible satellites: 269 available, 7 unavailable- when 10 visible satellites: 64 available, 0 unavailable- when 11 visible satellites: 5 available, 0 unavailable- when 12 visible satellites: 0 available, 0 unavailable

****************************************************************

SATELLITE VISIBILITY STATISICS

Number of cases with < 5 visible satellites = 0Number of cases with 5 visible satellites = 3Number of cases with 6 visible satellites = 43Number of cases with 7 visible satellites = 320Number of cases with 8 visible satellites = 441Number of cases with 9 visible satellites = 276Number of cases with 10 visible satellites = 64Number of cases with 11 visible satellites = 5Number of cases with 12 visible satellites = 0

Figure 3-27.1. Fault exclusion availability statistics summary

Table 3-27 summarizes the RAIM fault exclusion availability results from the executionof the program XRAIMEA with different input data for phase of flight, probability offalse alarm (pfa), probability of missed detection (pmd), and standard deviation ofmeasurement errors (see SA on with 33.3 meters and SA off with 6.5 meters). Asexpected note that the fault exclusion availability is lower than the fault detectionavailability – by comparing the results from Tables 3-26.1 and 3-27.1.

60

80

100

120

140

160

Num

ber o

f cas

es

Non-Precision Approach phase of flight - Horizontal exclusion level histogram of available cases

min = 159.6839, max = 555.1524, mean = 370.9029 meters

Page 99: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-65 -

Figure 3-27.2. Horizontal exclusion level histogram of all available cases

Table 3-27 RAIM Fault exclusion availability

pfa = 6.6667e-5, pmd = 0.001 pfa = 3.3333e-7, pmd = 0.001

Phase of flightSA On

(st. dev. = 33.3 m)SA Off

(st. dev. = 6.5 m)SA On

(st. dev. = 33.3 m)SA Off

(st. dev. = 6.5 m)

Non-PrecisionApproach 62.153 96.788 51.823 96.528

Terminal 95.139 98.785 94.097 98.611

En-Route 97.483 99.219 97.222 99.132

Oceanic 98.611 99.392 98.524 99.306

3.28 GPS error budget determination

The program XEBUDGET determines GPS error budget for a specified input data set.The user should enter from keyboard the following input data: (1) space segment error,(2) control segment error, (3) user segment, tropo error, (4) user segment, iono error, (5)user segment, multipath error, (6) user segment, receiver error, (7) PDOP value, (8)HDOP value, (9) VDOP value, (10) TDOP value.

For example, by using the default data the following is displayed on screen:

» xebudget

Do you want to use the default data set? (y/n)[y] -->

Enter the output desired (output file or on screen)Do you want to display the results on screen? (y/n)[y] -->

Page 100: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 3 GPS Toolbox Examples

- Page 3-66 -

****************************************************************************

***** COMPUTATION OF ERROR BUDGET *****

****************************************************************************

***** Input data ******

Space space segment error (meters, 1-sigma) = 1.900Space control segment error (meters, 1-sigma) = 3.500User segmnent, tropo error (meters, 1-sigma) = 2.000User segmnent, iono error (meters, 1-sigma) = 5.000User segmnent, multipath error (meters, 1-sigma) = 1.400User segmnent, receiver error (meters, 1-sigma) = 3.000

PDOP = 2.1800HDOP = 1.3600VDOP = 1.7000TDOP = 0.9500

***** Results by using XEBUDGET ******

URE (User Range Error), in meters = 3.9825UEE (User Equipment Error), in meters = 6.3214UERE (User Equivalent Range Error), in meters = 7.4713

SEP (Spherical Error Probable), 3-D 50 percentage, in meters = 14.4648CEP (Circular Error Probable, 2-D 50 percentage, in meters = 8.4590LEP (Linear Error Probable), Vertical 50 percentage, in meters = 8.5669Time Error (50 percentage), in nanoseconds = 15.798

3-D (Spherical) Position Error (95 percentage), in meters = 26.2882-D (Horizontal) Position Error (95 percentage), in meters = 20.322Actual 2-D (Horizontal) Position Error (95 percentage), in meters = 17.587Vertical Position Error (95 percentage), in meters = 25.402Actual Vertical Position Error (95 percentage), in meters = 25.296Time Error (95 percentage), in nanoseconds = 46.845Actual Time Error (95 percentage), in nanoseconds = 46.648

****************************************************************************

End of the program XEBUDGET

»

Page 101: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 CEP, CHI2_DOF, CONVCON

- Page 4-1 -

4.0 DETAILED SPECIFICATIONS FOR M-FILE MODULES

4.01 CEP.M

Scope:This MATLAB module computes the value of the circular error probable (CEP).

Usage: xycep = cep(x,y)

Description of parameters:x - input, error vector containing the errors on x axisy - input, error vector containing the errors on y axisxycep - output, CEP value

Remark:The components of the input vectors and the output CEP value should have the same unit.

4.02 CHI2_DOF.M

Scope:This MATLAB macro computes the probability density function of the chi-squaredistribution with dof degrees of freedom.

Usage: xoutput = chi2_dof(x,y)

Description of parameters:X - input, scalar independent variabledo - input, scalar, degree of freedom (dof), global variablexoutpu - output, computed probability density function

Remark:The computed function is equivalent to the state derivative of the chi-square distributionwith dof degrees of freedom.

4.03 CONVCON.M

Scope:This MATLAB module sets the most used conversion constants as global variables.

Usage: convcon

Description of global parameters:sem_rad - output, conversion factor from semicircles to radiansrad_sem - output, conversion factor from radians to semicircles

Page 102: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 DHMAX

- Page 4-2 -

deg_rad - output, conversion factor from degrees to radiansrad_deg - output, conversion factor from radians to degreesdeg_mrad - output, conversion factor from degrees to milliradiansmrad_deg - output, conversion factor from milliradians to degreesussf_m - output, conversion factor from US survey foot to meterm_ussf - output, conversion factor from meter to US survey feetif_m - output, conversion factor from international foot to metersm_if - output, conversion factor from meter to international feetnmile_m - output, conversion factor from international nautical mile to metersm_nmile - output, conversion factor from meter to international nautical milessmile_m - output, conversion factor from international statute mile to metersm_smile - output, conversion factor from meter to international statute milessmile_if - output, conversion factor from international statute mile to international

feetif_smile - output, conversion factor from international foot to international statute

miles

Remarks:Some useful SI prefixes and values:kilo = 10^3, mega = 10^6, giga = 10^9, tera = 10^12, peta = 10^15, exa = 10^18,milli = 10^(-3), micro = 10^(-6), nano = 10^(-9), pico = 10^(-12), femto = 10^(-15),atto = 10^(-18).

4.04 DHMAX.M

Scope:This MATLAB macro determines delta_h_max used in the Receiver AutonomousIntegrity Monitoring (RAIM) computation [27]. It is assumed that at least five line-of-sight unit vectors are specified as input.

Usage: xoutput = dhmax(g)

Description of parameters:g - input, line-of-sight unit vectors, each vector is stored in another row (it

should be 3 columns)xoutput - output, delta_h_max

Remark:The connection between ARP (Approximate Radial-error Protected) and delta_h_max isas follows

ARP = sqrt(n-4) * delta_h_max * thresholdwhere n is the number of measurements used, and threshold is the pre-computednormalized detection threshold [7].

References: [7], [27]

Page 103: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 DOP1, DOP2, ELEVA

- Page 4-3 -

4.05 DOP1.M

Scope:This MATLAB module computes dilution of precision (DOP) quantities when at leastthree line-of-sight (LOS) unit vectors are specified, by using a direct method.

Usage: dops = dop1(g)

Description of parameters:g - input, line-of-sight unit vectors, each vector is stored in another row (it should

be 3 columns)dops - output, dilution of precision quantities

dops(1) = geometric dilution of precision (GDOP) dops(2) = position dilution of precision (PDOP) dops(3) = horizontal dilution of precision (HDOP) dops(4) = vertical dilution of precision (VDOP) dops(5) = time dilution of precision (TDOP)

Remark:When less than four line-of-sight unit vectors are specified the computation is not fullysignificant, and it is conducted by using a pseudoinverse matrix instead of an inversematrix.

4.06 DOP2.M

Scope:This MATLAB module computes dilution of precision (DOP) quantities when four line-of-sight unit vectors are specified, by using a direct method.

Usage: dops = dop2(g)

Description of parameters:g - input, line-of-sight unit vectors, each vector is stored in another row (it should

be 3 columns)dops - output, dilution of precision quantities

dops(1) = geometric dilution of precision (GDOP) dops(2) = position dilution of precision (PDOP) dops(3) = horizontal dilution of precision (HDOP) dops(4) = vertical dilution of precision (VDOP) dops(5) = time dilution of precision (TDOP)

4.07 ELEVA.M

Scope:

Page 104: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 ELEVAR, E;EVAZ

- Page 4-4 -

This MATLAB module computes the elevation angle and the unit line-of-sight vector,when the ECEF user and satellite positions are known; WGS-84 constants are used.

Usage: [eangle,ulos] = eleva(user,sv)

Description of parameters:user - input, ECEF user position vectorsv - input, ECEF satellite position vectoreangle - output, elevation angle in radiansulos - output, unit line-of-sight vector

Remark:The components of the input vectors should have the same unit, e.g. meter, foot.

External Matlab modules used: uverv, wgs84con

4.08 ELEVAR.M

Scope:This MATLAB module computes the elevation angle, the unit line-of-sight vector and therange, when the ECEF user and satellite positions are known; WGS-84 constants areused.

Usage: [eangle,ulos,range] = elevar(user,sv)

Description of parameters:user - input, ECEF user position vectorsv - input, ECEF satellite position vectoreangle - output, elevation angle in radiansulos - output, unit line-of-sight vectorrange - output, range from user to satellite

Remark:The components of the input vectors and the range should have the same units, e.g. meter,foot.

External Matlab modules used: uverv, wgs84con.

4.09 ELEVAZ.M

Scope:This MATLAB module computes the elevation angle, the azimuth angle, the unit line-of-sight vector and the range, when the ECEF user and satellite positions are known; WGS-84 constants are used.

Page 105: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 ELIMCOL, ELIMROW, FDNT

- Page 4-5 -

Usage: [eangle,az,ulos,range] = elevaz(user,sv)

Description of parameters:user - input, ECEF user position vectorsv - input, ECEF satellite position vectoreangle - output, elevation angle in radiansaz - output, azimuth angle in radiansulos - output, unit line-of-sightrange - output, range from user to satellite

Remark:The components of the input vectors and the range should have the same unit, e.g. meter,foot.

External Matlab modules used: tecefgd, vecefenu, wgs84con.

4.10 ELIMCOL.M

Scope:This MATLAB module eliminates a specified column from a two-dimensional matrix.

Usage: y = elimcol(x,k)

Description of parameters:x - input, initial two-dimensional matrixk - input, index of the column to be eliminated from the input matrix xy - output, resultant matrix

4.11 ELIMROW.M

Scope:This MATLAB module eliminates a specified row from a two-dimensional matrix.

Usage: y = elimrow(x,k)

Description of parameters:x - input, initial two-dimensional matrixk - input, index of the row to be eliminated from the input matrix xy - output, resultant matrix

4.12 FDNT

Scope:This MATLAB macro determines a fault detection normalized threshold used in the

Page 106: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 FOM, FPBIAS_C

- Page 4-6 -

Receiver Autonomous Integrity Monitoring (RAIM) computation, for specified falsealarm and degree of freedom.

Usage: xoutput = fdnt(fa_tol)

Description of parameters:dof - input, degrees-of-freedom for chi-square distribution, in this case is the

number of satellites available - 4, global variablefa_tol - input, false alarm tolerancexoutput - output, fault detection normalized threshold

Remark:When the degree of freedom is 1 a Gaussian distribution is used, otherwise a chi-squaredistribution is assumed.

References: [7], [27]

External Matlab modules used: chi2_dof, gauss_1

4.13 FOM

Scope:This MATLAB macro sets the figure of merit value based on ICD-059 table.

Usage: xfom = fom(epe)

Description of parameters:epe - input, estimated position error, in metersxfom - output, figure of merit value

Remark:If an incorrect negative value is entered, i.e. epe < 0, than the figure of merit is set as -1.

4.14 FPBIAS_C

Scope:This MATLAB macro computes the value of a function used to determine the parity bias(pbiasb) for the (dof+4) satellite case with Chi-square distribution [26], when the degree-of-freedom (dof) is between 2 and 10.

Usage: xoutput = fpbias_c(x)

Description of parameters:x - input, scalar independent variable (lambda)a - input, global constant, normalized Chi-square threshold, (dof dependent)

Page 107: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 FPBIAS_G, GAUSS_1

- Page 4-7 -

dof - input, global constant, degree of freedom (2 <= dof <= 8)pmd - input, global constant, probability of missed detectionxoutput - output, computed value of the function; when x = pbiasb then the value of the residual is 0.

Remark:The value of a (normalized Chi-square threshold) is dof dependent and can be a prioridetermined by using the program xfdnt.

Reference: [26]

External Matlab macros used: ncchi2_2.m, ncchi2_3.m, ncchi2_4.m, ncchi2_5.m,ncchi2_6.m, ncchi2_7.m, ncchi2_8.m, ncchi2_9.m, ncchi2_10.m

4.15 FPBIAS_G

Scope:This MATLAB macro computes the value of a function used to determine the parity bias(pbiasb) for the 5 satellite case with Gaussian distribution [26].

Usage: xoutput = fpbias_g(x)

Description of parameters:x - input, scalar independent variablepmd - input, global constant, probability of missed detectiontd - input, global constant, normalized thresholdxoutput - output, computed value of the function; when x = pbiasb then the value of the expression is 0.

Remark:The value of td (fault detection normalized threshold) can be a priori determined by usingthe program XFDNT.

Reference: [26]

4.16 GAUSS_1

Scope:This MATLAB macro computes the probability density function of the normal Gaussiandistribution.

Usage: xoutput = gauss_1(x,y)

Page 108: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 GCNAV, GDOPV

- Page 4-8 -

Description of parameters:x - input, scalar independent variabley - input, scalar dependent variablexoutput - output, computed probability density function

Remark:This macro can be used for the computation of the integral of the probability densityfunction.

4.17 GCNAV

Scope:This MATLAB macro computes the great circle navigation position, velocity, andacceleration when the ECEF initial position and velocity are specified; WGS-84 constantsare used.

Usage: [pgcm,vgcm,agcm] = gcnav(p0,v0,deltat,nsteps)

Description of parameters:p0 - input, ECEF position vector, the components are in metersv0 - input, ECEF velocity vector, the components are in \meters/seconddeltat - input, time step, in secondsnsteps - input, number of step desiredpgcm - output, ECEF great circle position, the components are in meters;

pgcm(k,:) is the k-th time step valuevgcm - output, great circle velocity, the components are in meters/second;

vgcm(k,:) is the k-th time step valueagcm - output, great circle acceleration, the components are in meters/second^2;

agcm(k,:) is the k-th time step value

External Matlab macros used: uverv, wgs84con

4.18 GDOPV

Scope:This MATLAB module computes an approximate value of the geometric dilution ofprecision (GDOP) when at least four line-of-sight unit vectors are specified, by using anapproximate geometric method [18].

Usage: x = gdopv(g)

Description of parameters:g - input, line-of-sight unit vectors, each vector is stored in another row (it should

be 3 columns)x - output, approximate value of the geometric dilution of precision

Reference: [18]

Page 109: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 GENRN, GEODES, GEOIDH

- Page 4-9 -

4.19 GENRN

Scope:This MATLAB macro generates random numbers with normal (Gaussian) distribution,with mean and standard deviation specified.

Usage: x = genrn(n,xmean,xstd,iseed) when the seed is reset to iseedx = genrn(n,xmean,xstd)

Description of parameters:n - input, number of random numbers to be generatedxmean - input, specified meanxstd - input, specified standard deviationiseed - input, initial value of the seed (optional); if it is specified the seed is reset to

iseed valuex - output, random numbers with specified mean and standard deviation, vector

with n elements

4.20 GEODES

Scope:This MATLAB macro computes geodetic data for a specified departure-destination pair;WGS-84 earth model is considered.

Usage: [range,bearing1,bearing2] = geodes(lat1,lon1,lat2,lon2)

Description of parameters:lat1 - input, departure point latitude, in degreeslon1 - input, departure point longitude, in degreeslat2 - input, departure point latitude, in degreeslon2 - input, departure point longitude, in degreesrange - output, range, in metersbearing1 - output, departure bearing, in degreesbearing2 - output, destination bearing, in degrees

Remark:The macros wgs84con and convcon should be called before using the macro geodes inorder to initialized the global variables used.

Reference: [1]

4.21 GEOIDH

Scope:

Page 110: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 GMP1, GMP2

- Page 4-10 -

This MATLAB macro computes the WGS-84 geoid height correction for the currentlocation specified by latitude and longitude.

Usage: xoutput = geoidh(lat,lon,tgeoid)

Description of parameters:lat - input, latitude in radians, - pi/2 to pi/2lon - input, longitude in radians, 0 to 2*pi (automatically adjustable -2*pi to 4*pi)tgeoid - input, geoid heights table (in meters) for a 19 by 36 Latitude/Longitude grid;

the latitudes go northward from -90 to 90 degrees, and longitudes go eastward from 0 to 350 degrees

xoutput - output, geoid height correction in meters

Reference: [31]

4.22 GMP1

Scope:This MATLAB module generates first order Gauss-Markov sequence.

Usage: x = gmp1(nstep,beta,sigx,deltat,iseed)x = gmp1(nstep,beta,sigx,deltat) when the seed is not reset

Description of parameters:nstep - input, number of steps of the Gauss-Markov processbeta - input, parameter of the Gauss-Markov process, 1/beta is the correlation time

in secondssigx - input, standard deviation of the Gauss-Markov process xdeltat - input, time step in secondsiseed - input, initial value of the seed (optional); if it is specified the seed is reset to

iseed valuex - output, computed value of the Gauss-Markov process x, vector with nstep

elements

External Matlab modules used: genrn

4.23 GMP2

Scope:This MATLAB module generates second order Gauss-Markov sequence.

Usage: [xp,xv] = gmp2(nstep,w0,beta,csq,deltat,iseed)[xp,xv] = gmp2(nstep,w0,beta,csq,deltat) when the seed is not reset

Page 111: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 GPSCON, GPSLSEC

- Page 4-11 -

Description of parameters:nstep - input, number of steps of the Gauss-Markov processw0 - input, natural frequency in radians/secondbeta - input, damping factor which is less than 1.csq - input, constant c**2 in meters**2deltat - input, time step in secondsiseed - input, initial value of the seed (optional); if it is specified the seed is reset to

iseed valuexp - output, computed value of the second order Gauss-Markov process - first

state component xp, vector with nstep elementsxv - output, computed value of the second order Gauss-Markov process - second

state component xv, vector with nstep elements

External Matlab modules used: genrn

4.24 GPSCON

Scope:This MATLAB module sets the most used GPS constants as global variables.

Usage: gpscon

Description of global parameters:f0 - output, fundamental frequency, in MhzfL1 - output, L1 frequency, in MHz (154*f0)fL2 - output, L2 frequency, in MHz (120*f0)lambdaL1 - output, L1 carrier wavelength, in meterslambdaL2 - output, L2 carrier wavelength, in metersfca_code - output, coarse/acquisition code (bit rate in Hz)fp_code - output, precision code (bit rate in Hz)fL1pL2 - output, L1 + L2 frequency, in Mhz (274*f0)fL1mL2 - output, L1 - L2 frequency, in Mhz (34*f0)lambdaL1pL2 - output, L1 + L2 wavelength, in meterslambdaL1mL2 - output, L1 - L2 wavelength, in meterssecpmin - output, number of seconds per minutesecph - output, number of seconds per hoursecpday - output, number of seconds per daysecpweek - output, number of seconds per weeksecphday - output, number of seconds per half daysecphweek - output, number of seconds per half week

4.25 GPSLSEC

Scope:

Page 112: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 GRIDWAAS, HMAT, HMATB

- Page 4-12 -

This MATLAB macros determines the UTC leap seconds value for a specified yearbetween 1980 and 2059; after the year 1999 the leap second value is only an estimate.

Usage: xoutput = gpslsec(year)

Description of parameters:year - input, year (between 1980 and 2059)xoutput - output, UTC leap seconds value the result is set to -1 for out of range inputs

4.26 GRIDWAAS

Scope:This MATLAB macro generates latitude-longitude WAAS grid specified in [30].

Usage: [lat,lon] = gridwaas

Description of parameters:lat - output, latitude in degrees (for 2353 points)lon - output, longitude in degrees (for 2353 points)

Reference: [30]

4.27 HMAT

Scope:This MATLAB macro constructs the H matrix (based on line-of-sight measurements),when the user's position and the position of satellites are known.

Usage: [houtput,ier] = hmat(svpos,upos)

Description of parameters:svpos - input, four ECEF satellite positions, each row contains the three component

for a satellite, all components are in metersupos - input/output, ECEF user's position, the components are in metershoutput - output, H matrix (based on line-of-sight measurement)ier - output, index of error

= 0 no error = 1 error, see the measurement dimensions

Remark:At least 4 measurements are required for the construction of H matrix.

4.28 HMATB

Scope:

Page 113: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 HMATBC, HMATC

- Page 4-13 -

This MATLAB macro constructs the H matrix (based on line-of-sight and baromeasurements), when the user's position, the satellites position and baro are known.

Usage: [houtput,ier] = hmatb(svpos,upos)

Description of parameters:svpos - input, four ECEF satellite positions, each row contains the three component

for a satellite, all components are in metersupos - input/output, ECEF user's position, the components are in metershoutput - output, H matrix (based on line-of-sight and baro measurements)ier - output, index of error

= 0 no error = 1 error, see the measurement dimensions

Remark:At least 4 measurements are required for the construction of H matrix.

4.29 HMATBC

Scope:This MATLAB macro constructs the H matrix (based on line-of-sight, baro and clockmeasurements), when the user's position, the satellites position, baro and clock areknown.

Usage: [houtput,ier] = hmatbc(svpos,upos)

Description of parameters:svpos - input, four ECEF satellite positions, each row contains the three component

for a satellite, all components are in metersupos - input/output, ECEF user's position, the components are in metershoutput - output, H matrix (based on line-of-sights, baro and clock measurements)ier - output, index of error

= 0 no error = 1 error, see the measurement dimensions

Remark:At least 4 measurements are required for the construction of H matrix.

4.30 HMATC

Scope:This MATLAB macro constructs the H matrix (based on line-of-sight and clockmeasurements), when the user's position, the satellites position and clock are known.

Usage: [houtput,ier] = hmatc(svpos,upos)

Page 114: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 HPE, IONOC

- Page 4-14 -

Description of parameters:svpos - input, four ECEF satellite positions, each row contains the three component

for a satellite, all components are in metersupos - input/output, ECEF user's position, the components are in metershoutput - output, H matrix (based on line-of-sight and clock measurements)ier - output, index of error

= 0 no error = 1 error, see the measurement dimensions

Remark:At least 4 measurements are required for the construction of H matrix.

4.31 HPE

Scope:This MATLAB module computes the horizontal position error when latitude andlongitude for two points are given; WGS-84 constants are used.

Usage: x = hpe(lat1,lon1,lat2,lon2)

Description of parameters:lat1 - input, latitude of the first position point, in radianslon1 - input, longitude of the first position point, in radianslat2 - input, latitude of the second position point, in radianslon2 - input, longitude of the second position point, in radiansx - output, horizontal position error between the two defined position points, in

meters

Remarks:1) The macro wgs84con should be called before using the macro hpe in order to initialize

the global variables used.2) The computation accuracy is limited due to algorithm approximations; it is

recommended to be used when the range is less than 100 km.

External Matlab macros used: wgs84con

4.32 IONOC

Scope:This MATLAB macro computes L1 iono correction for a specified user by using theKlobuchar model; WGS-84 constants are used.

Usage: ionocorr = ionoc(lat,lon,el,az,tgps,alpha,beta)

Page 115: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 IONOC, KFCOV

- Page 4-15 -

Description of parameters:lat - input, user's geodetic latitude, in radianslon - input, user's geodetic longitude, in radiansel - input, user's elevation angle, in radiansaz - input, user's azimuth angle, in radianstgps - input, GPS system time, in secondsalpha - input, coefficients of cubic fit to the amplitude of vertical delay (array with

4 elements)beta - input, coefficients of cubic fit to the period of model (array with 4 elements)ionocorr - output, L1 iono correction, in meters

Remark:L2 iono correction can be determined as follows:

L2 Iono correction = (L1 iono correction) * ((77/60)^2)

References: [25], [29]

External Matlab macros used: wgs84con

4.33 IONOCON

Scope:This MATLAB macro sets the Klobuchar model iono constants.

Usage: ionocon

Description of parameters:alpha - output, array with 4 components storing the Klobuchar model alpha

constantsbeta - output, array with 4 components storing the Klobuchar model beta constants

Remark:1) The constants are taken from satellite 26, subframe 4, page 18, date 5/20/1994.2) The indexes of the arrays alpha and beta are greater than the indexes defined by

Klobuchar model by 1 (because Matlab does not allow a zero index).

4.34 KFCOV

Scope:This MATLAB macro generates Kalman filter covariance matrix when the parameters areconstants; conventional formulation is implemented. This computation is useful forcovariance analysis.

Usage: [pafter,pbefore] = kfcov(nstep,n,m,phi,q,h,r,pinit)

Page 116: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 KFCOVA

- Page 4-16 -

Description of parameters:nstep - input, number of steps to be executedn - input, state vector dimensionm - input, measurement dimensionphi - input, transition matrix, n by nq - input, process noise matrix, n by nh - input, measurement matrix, m by n, where m is the number of measurementsr - input, measurement noise matrix, m by mpinit - input, initial value of the covariance matrix, symmetric n by n matrixpafter - output, final value of the covariance matrix after measurement incorporation

(current time cycle)pbefore - output, final value of the covariance matrix after time propagation and

before measurement incorporation (next time cycle)

Remark:1) For covariance analysis the matrix pafter should be saved at each step.2) When parameters are time-dependent then this module should be called for one step only (nstep = 1) with new time dependent values at each call.

4.35 KFCOVA

Scope:This MATLAB macro generates Kalman filter covariance matrix when the parameters areconstants; alternate conventional formulation is implemented. This computation is usefulfor covariance analysis.

Usage: [pafter,pbefore] = kfcova(nstep,n,m,phi,q,h,r,pinitinv)

Description of parameters:nstep - input, number of steps to be executedn - input, state vector dimensionm - input, measurement dimensionphi - input, transition matrix, n by nq - input, process noise matrix, n by nh - input, measurement matrix, m by nr - input, measurement noise matrix, m by mpinvinit - input, initial value of the inverse of the covariance matrix, symmetric,

n by n matrixpafter - output, final value of the covariance matrix after measurement incorporation

(current time cycle)pinvbef - output, final value of the covariance matrix after time propagation and

before measurement incorporation (next time cycle)

Remark:1) For covariance analysis the matrix pafter should be saved at each step.2) When parameters are time-dependent then this module should be called for one step

Page 117: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 MBLLW, MCUD

- Page 4-17 -

only (nstep = 1) with new time dependent values at each call.

4.36 MBLLW

Scope:This MATLAB module constructs the transformation matrix from GPS body frame toLLWA (Local Level Wander Azimuth) frame.

Usage: moutput = mbllw(yaw,pitch,roll)

Description of parameters:yaw - input, yaw angle in radianspitch - input, pitch angle in radiansroll - input, roll angle in radiansmoutput - output, two-dimensional real array containing the transformation matrix

from GPS body frame to LLWA frame

Remark:The coordinate axes for wander azimuth local level frame are defined as follows:x - axis at wander azimuth angle counter-clockwise from East in local level plane,y - axis at wander azimuth angle counter-clockwise from North in local level plane,z - axis upward along local normal

4.37 MCUD

Scope:This MATLAB module computes the real symmetric matrix P = U*D*U**(Transpose),when its U-D factors are given, where U is a real unit upper triangular matrix and D is areal diagonal matrix. Only the upper triangular part (columnwise) of the pair U-D andmatrix P are stored.

Usage: p = mcud(n,ud)ud = mcud(n,ud) , when the input matrix ud is destroyed

Description of parameters:n - input, real scalar, number of rows and columns in matrices U , D and Pud - input, real array of length n*(n+1)/2, storing the upper triangular part of the

pair U-D ; the elements of the diagonal matrix D are stored on diagonal locations of the unit upper triangular matrix U

p - output, real array of length n*(n+1)/2, storing the upper triangular part of the resultant matrix P

Remark:The computation can be used to determine the covariance matrix from its U-D factors.

Page 118: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 MECEFECI, MECEFENU, MECEFINS

- Page 4-18 -

4.38 MECEFECI

Scope:This MATLAB macro constructs the transformation matrix from ECEF frame to ECI(Earth Centered Inertial) frame; WGS-84 earth's rotation rate constant is used.

Usage: moutput = mecefeci(dtime)

Description of parameters:dtime - input, time elapsed since reference time, in secondsmoutput - output, two-dimensional real array containing the transformation matrix

from ECEF frame to ECI frame

Remark:The ECEF to ECI transformation takes into account only Earth's rotation, i.e. no Earth'sprecession and mutation effects.

External Matlab macros used: wgs84con

4.39 MECEFENU

Scope:This MATLAB module constructs the transformation matrix from ECEF frame to ENU(East, North, Up) frame.

Usage: moutput = mecefenu(lat,lon)

Description of parameters:lat - input, reference latitude in radianslon - input, reference longitude in radiansmoutput - output, two-dimensional real array containing the transformation matrix

from ECEF frame to ENU frame

4.40 MECEFINS

Scope:This MATLAB module constructs the transformation matrix from ECEF frame to INS(Wander / North West Up) frame.

Usage: moutput = mecefins(lat,lon,waz)

Description of parameters:lat - input, reference latitude in radianslon - input, reference longitude in radianswaz - input, wander azimuth angle in radians

Page 119: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 MECEFLLW, MECIECEF

- Page 4-19 -

moutput - output, two-dimensional real array containing the transformation matrix from ECEF frame to INS frame

4.41 MECEFLLW

Scope:This MATLAB module constructs the transformation matrix from ECEF frame to LLWA(Local Level Wander Azimuth) frame.

Usage: moutput = mecefllw(lat,lon,waz)

Description of parameters:lat - input, reference latitude in radianslon - input, reference longitude in radianswaz - input, wander azimuth angle in radiansmoutput - output, two-dimensional real array containing the transformation matrix from

ECEF frame to LLWA frame

Remark:The coordinate axes for local level wander azimuth frame are defined as follows:x - axis at wander azimuth angle counter-clockwise from East in local level plane,y - axis at wander azimuth angle counter-clockwise from North in local level plane,z - axis upward along local normal

4.42 MECIECEF

Scope:This MATLAB macro constructs the transformation matrix from ECI (Earth CenteredInertial) frame to ECEF frame; WGS-84 earth's rotation rate constant is used.

Usage: moutput = meciecef(dtime)

Description of parameters:dtime - input, time elapsed since reference time in secondsmoutput - output, two-dimensional real array containing the transformation matrix

from ECIE frame to ECEF frame

Remark:The ECI to ECEF transformation takes into account only Earth's rotation, i.e. no Earth'sprecession and mutation effects.

External Matlab macros used: wgs84con

Page 120: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 MENUECEF, MENULLW, MINSECEF

- Page 4-20 -

4.43 MENUECEF

Scope:This MATLAB module constructs the transformation matrix from ENU (East, North, Up)frame to ECEF frame.

Usage: moutput = menuecef(lat,lon)

Description of parameters:Lat - input, reference latitude in radianslon - input, reference longitude in radiansmoutput - output, two-dimensional real array containing the transformation matrix

from ENU frame to ECEF frame

4.44 MENULLW

Scope:This MATLAB module constructs the transformation matrix from ENU (East, North, Up)frame to LLWA (Local Level Wander Azimuth) frame.

Usage: moutput = menullw(waz)

Description of parameters:waz - input, wander azimuth angle in radiansmoutput - output, two-dimensional real array containing the transformation matrix

from ENU frame to LLWA frame

Remark:The coordinate axes for local level wander azimuth frame are defined as follows:x - axis at wander azimuth angle counter-clockwise from East in local level plane,y - axis at wander azimuth angle counter-clockwise from North in local level plane,z - axis upward along local normal

4.45 MINSECEF

Scope:This MATLAB module constructs the transformation matrix from INS (Wander / NorthWest Up) frame to ECEF frame.

Usage: moutput = minsecef(lat,lon,waz)

Description of parameters:lat - input, reference latitude in radianslon - input, reference longitude in radianswaz - input, wander azimuth angle in radians

Page 121: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 MLLWB, MLLWECEF

- Page 4-21 -

moutput - output, two-dimensional real array containing the transformation matrix from INS frame to ECEF frame

4.46 MLLWB

Scope:This MATLAB module constructs the transformation matrix from LLWA (Local LevelWander Azimuth) frame to GPS body frame.

Usage: moutput = mllwb(yaw,pitch,roll)

Description of parameters:yaw - input, yaw angle in radianspitch - input, pitch angle in radiansroll - input, roll angle in radiansmoutput - output, two-dimensional real array containing the transformation matrix from

LLWA frame to GPS body frame

Remark:The coordinate axes for wander azimuth local level frame are defined as follows:x - axis at wander azimuth angle counter-clockwise from East in local level plane,y - axis at wander azimuth angle counter-clockwise from North in local level plane,z - axis upward along local normal

4.47 MLLWECEF

Scope:This MATLAB module constructs the transformation matrix from LLWA (Local LevelWander Azimuth) frame to ECEF frame.

Usage: moutput = mllwecef(lat,lon,waz)

Description of parameters:lat - input, reference latitude in radianslon - input, reference longitude in radianswaz - input, wander azimuth angle in radiansmoutput - output, two-dimensional real array containing the transformation matrix

from LLWA frame to ECEF frame

Remark:The coordinate axes for local level wander azimuth frame are defined as follows:x - axis at wander azimuth angle counter-clockwise from East in local level plane,y - axis at wander azimuth angle counter-clockwise from North in local level plane,z - axis upward along local normal

Page 122: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 MLLWENU, MREAST, MSC2F

- Page 4-22 -

4.48 MLLWENU

Scope:This MATLAB module constructs the transformation matrix from LLWA (Local LevelWander Azimuth) frame to ENU (East, North, Up) frame.

Usage: moutput = mllwenu(waz)

Description of parameters:waz - input, wander azimuth angle in radiansmoutput - output, two-dimensional real array containing the transformation matrix from LLWA frame to ENU frame

Remark:The coordinate axes for local level wander azimuth frame are defined as follows:x - axis at wander azimuth angle counter-clockwise from East in local level plane,y - axis at wander azimuth angle counter-clockwise from North in local level plane,z - axis upward along local normal

4.49 MREAST

Scope:This MATLAB module executes measurement reasonableness test for a given scalarmeasurement.

Usage: alpha = mreast(n,ud,h,r,dz,test)

Description of parameters:n - input, integer scalar, dimension of state vector, n is greater than or equal to 2ud - input, real array with n*(n+1)/2 elements, containing the U-D factors of

the covariance matrix; U is unit upper triangular and D elements are stored on the diagonal

h - input, real array with n elements, storing the observation coefficients (measurement matrix) for one measurement

r - input, real scalar, measurement variancedz - input, real scalar, measurement residualtest - input, real scalar, constant used to test the validity of the measurement, e.g.

test = 25 corresponds to 5 sigma verificationalpha - output, real scalar, innovations variance; if the measurement residual fails

the test then the output is negative alpha

4.50 MSC2F

Scope:

Page 123: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 MSF2C, MUDC2F

- Page 4-23 -

This MATLAB macro determines the real symmetric matrix stored as a two-dimensionalarray from its upper triangular part stored columnwise as a one-dimensional array.

Usage: xout = msc2f(n,a)

Description of parameters:n - input, real scalar, number of rows and columns of the symmetric matrixa - input, one-dimensional array of length n*(n+1)/2, storing columnwise the

upper triangular part of the symmetric matrixxout - output, two-dimensional array storing the full symmetric matrix

4.51 MSF2C

Scope:This MATLAB macro determines the real symmetric matrix stored as columnwise uppertriangular part as a one-dimensional array from its two-dimensional array.

Usage: xout = msc2f(n,a)

Description of parameters:n - input, real scalar, number of rows and columns of the symmetric matrixa - input, two-dimensional array storing the full symmetric matrixxout - output, one-dimensional array of length n*(n+1)/2, storing columnwise the

upper triangular part of the symmetric matrix

4.52 MUDC2F

Scope:This MATLAB macro determines the full U and D matrices stored as two-dimensionalarrays from its compact upper triangular part stored columnwise as a one-dimensionalarray.

Usage: [u,d] = mudc2f(n,a)

Description of parameters:n - input, real scalar, number of rows and columns of the symmetric matrixa - input, one-dimensional array of length n*(n+1)/2, storing columnwise the

U-D components of a symmetric matrixu - output, two-dimensional array storing the full U matrixd - output, two-dimensional array storing the full D matrix

Page 124: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 MUDD, MUDF2C, MUDM

- Page 4-24 -

4.53 MUDD

Scope:This MATLAB module computes the U-D factorization of a real symmetric, positive(semi)definite matrix by using the modified Cholesky decomposition.

Usage: [ud,ier] = mudd(n,a,meps)

Description of parameters:n - input, real scalar, number of rows and columns in Aa - input, real array of length n*(n+1)/2 , storing column-wise the upper

triangular part of the real symmetric matrix A,meps - input, real scalar, machine dependent accuracyud - output, real array of length n*(n+1)/2, storing the upper triangular part of

the pair U-D ; the elements of the diagonal matrix D are stored on diagonal locations of the unit upper triangular matrix U

ier - output, integer scalar, index of error = 0 no computation error = 1 computation error occurred, a diagonal element is smaller than meps = 2 computation error occurred, the input matrix A is not numerically positive (semi)definite

4.54 MUDF2C

Scope:This MATLAB macro determines the compact upper triangular part stored columnwise asa one-dimensional array from the full U and D matrices stored as two-dimensional arrays.

Usage: xout = mudf2c(n,u,d)

Description of parameters:n - input, real scalar, number of rows and columns of the symmetric matrixu - input, two-dimensional array storing the full U matrixd - input, two-dimensional array storing the full D matrixxout - output, one-dimensional array of length n*(n+1)/2, storing columnwise the

U-D components of a symmetric matrix

4.55 MUDM

Scope:This MATLAB module implements the discrete Kalman filter measurement updatingusing Bierman's U-D measurement update algorithm. Only a scalar measurement isprocessed, the U-D covariance factors and the state estimate (optional) are updated. Themeasurement is an input when the state is updated.

Page 125: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 MUDM1

- Page 4-25 -

Usage: [ud,f,g,alpha] = mudm(n,ud,r,h,index) [ud,h,g,alpha] = mudm(n,ud,r,h,index) , when the input h is destroyed

Description of parameters:n - input, integer scalar, dimension of state vector, n is greater than or equal to 2ud - input/output, real array of length (n+1)*(n+2)/2. The first n*(n+1)/2

elements store the input/output U-D factors; the D elements are stored on diagonal. The last n+1 elements store the input/output state vector x and the scalar value z-h**(transpose)*x(a priori) in u((n+1)*(n+2)/2). If index = 0 then the state x (and z) need not be included and the dimension of the array should be n*(n+1)/2.

r - input, real scalar, stores the measurement varianceh - input, real array of length (n+1) , stores the vector of measurement

coefficients (first n elements) and h(n+1) = z if index = 0. If index = 0 the dimension of the array h should be n.

index - input, integer scalar, index of updating type = 0 then only the U-D factors are updated (the state is not updated) ≠ 0 then the U-D factors and state are updatedf - output, real array of length (n+1) ; the first n elements contain the vector

u**(transpose)*h(input), and when index ≠ 0 then f(n+1) = (z-h**(transpose)*x(a priori))/alpha. If index = 0 the dimension of the array f should be n.

g - output, real array of length n , which contains the vector of unweighted Kalman gains; Kalman gain is g/alpha.

alpha - output, real scalar, innovations variance of the measurement residual (h**(transpose)*p(a priori)*h+r)

Remarks:The algorithm holds for r = 0 (a perfect measurement) and the code includes this case.One can use this algorithm with r negative to delete a previously processed data point.However, one should note that data deletion is numerically unstable and sometimesintroduces numerical errors.

Method:The algorithm updates the columns of the U-D matrix, from left to right, using Bierman'salgorithm; the state vector is updated using the classical formula.

Reference: [6]

4.56 MUDM1

Scope:This MATLAB module implements the discrete Kalman filter measurement updatingusing Bierman's U-D measurement update algorithm. Only a scalar measurement isprocessed, the U-D covariance factors and the state estimate (optional) are updated. Themeasurement residual is an input when the state is updated.

Page 126: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 NCCHI2_10

- Page 4-26 -

Usage: [ud,f,g,alpha] = mudm1(n,ud,r,h,index) [ud,h,g,alpha] = mudm1(n,ud,r,h,index) when the input h is destroyed

Description of parameters:n - input, integer scalar, dimension of state vector, n is greater than or equal to 2ud - input/output, real array of length (n+1)*(n+2)/2. The first n*(n+1)/2

elements store the input/output U-D factors; the D elements are stored on diagonal. The last n+1 elements store the input/output state vector x and the scalar value of measurement residual in u((n+1)*(n+2)/2). If index = 0 then the state x and measurement residual need not be included and the dimension of the array should be n*(n+1)/2.

r - input, real scalar, stores the measurement varianceh - input, real array of length n , storing the vector of measurement coefficientsindex - input, integer scalar, index of updating type = 0 then only the U-D factors are updated (the state is not updated) ≠ 0 then the U-D factors and state are updatedf - output, real array of length (n+1) ; the first n elements contain the vector

u**(transpose)*h(input), and when index ≠ 0 then f(n+1)=(measurement residual)/ alpha. If index = 0 the dimension of the array f should be n.

g - output, real array of length n , which contains the vector of unweighted Kalman gains; Kalman gain is g/alpha.

alpha - output, real scalar, innovations variance of the measurement residual (h**(transpose)*p(a priori)*h+r)

Remarks:The algorithm holds for r = 0 (a perfect measurement) and the code includes this case.One can use this algorithm with r negative to delete a previously processed data point.However, one should note that data deletion is numerically unstable and sometimesintroduces numerical errors.

Method:The algorithm updates the columns of the U-D matrix, from left to right, using Bierman'salgorithm; the state vector is updated using the classical formula.

Reference: [6]

4.57 NCCHI2_10

Scope:This MATLAB macro computes the probability density function of the non-central chi-square distribution with ten degrees of freedom.

Usage: xoutput = ncchi2_10(x,lambda)

Description of parameters:x - input, scalar independent variable

Page 127: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 NCCHI2_2, NCCHI2_3, NCCHI2_4

- Page 4-27 -

lambda - input, non-centrality parameterxoutput - output, computed probability density function

Remark:This macro can be used for the computation of the integral of the probability densityfunction.

4.58 NCCHI2_2

Scope:This MATLAB macro computes the probability density function of the non-central chi-square distribution with two degrees of freedom.

Usage: xoutput = ncchi2_2(x,lambda)

Description of parameters:x - input, scalar independent variablelambda - input, non-centrality parameterxoutput - output, computed probability density function

Remark:This macro can be used for the computation of the integral of the probability densityfunction.

4.59 NCCHI2_3

Scope:This MATLAB macro computes the probability density function of the non-central chi-square distribution with three degrees of freedom.

Usage: xoutput = ncchi2_3(x,lambda)

Description of parameters:x - input, scalar independent variablelambda - input, non-centrality parameterxoutput - output, computed probability density function

Remark:This macro can be used for the computation of the integral of the probability densityfunction.

4.60 NCCHI2_4

Scope:

Page 128: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 NCCHI2_5, NCCHI2_6

- Page 4-28 -

This MATLAB macro computes the probability density function of the non-central chi-square distribution with four degrees of freedom.

Usage: xoutput = ncchi2_4(x,lambda)

Description of parameters:x - input, scalar independent variablelambda - input, non-centrality parameterxoutput - output, computed probability density function

Remark:This macro can be used for the computation of the integral of the probability densityfunction.

4.61 NCCHI2_5

Scope:This MATLAB macro computes the probability density function of the non-central chi-square distribution with five degrees of freedom.

Usage: xoutput = ncchi2_5(x,lambda)

Description of parameters:x - input, scalar independent variablelambda - input, non-centrality parameterxoutput - output, computed probability density function

Remark:This macro can be used for the computation of the integral of the probability densityfunction.

4.62 NCCHI2_6

Scope:This MATLAB macro computes the probability density function of the non-central chi-square distribution with six degrees of freedom.

Usage: xoutput = ncchi2_6(x,lambda)

Description of parameters:x - input, scalar independent variablelambda - input, non-centrality parameterxoutput - output, computed probability density function

Remark:

Page 129: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 NCCHI2_7, NCCHI2_8, NCCHI2_9

- Page 4-29 -

This macro can be used for the computation of the integral of the probability densityfunction.

4.63 NCCHI2_7

Scope:This MATLAB macro computes the probability density function of the non-central chi-square distribution with seven degrees of freedom.

Usage: xoutput = ncchi2_7(x,lambda)

Description of parameters:x - input, scalar independent variablelambda - input, non-centrality parameterxoutput - output, computed probability density function

Remark:This macro can be used for the computation of the integral of the probability densityfunction.

4.64 NCCHI2_8

Scope:This MATLAB macro computes the probability density function of the non-central chi-square distribution with eight degrees of freedom.

Usage: xoutput = ncchi2_8(x,lambda)

Description of parameters:x - input, scalar independent variablelambda - input, non-centrality parameterxoutput - output, computed probability density function

Remark:This macro can be used for the computation of the integral of the probability densityfunction.

4.65 NCCHI2_9

Scope:This MATLAB macro computes the probability density function of the non-central chi-square distribution with nine degrees of freedom.

Usage: xoutput = ncchi2_9(x,lambda)

Page 130: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 PIONOC, PRADR

- Page 4-30 -

Description of parameters:x - input, scalar independent variablelambda - input, non-centrality parameterxoutput - output, computed probability density function

Remark:This macro can be used for the computation of the integral of the probability densityfunction.

4.66 PIONOC

Scope:This MATLAB module computes pseudorange measurement corrected for ionosphericeffects when pseudoranges measured on L1/L2 are available.

Usage: pr = pionoc(pr1,pr2)

Description of parameters:pr1 - input, pseudorange measured on L1pr2 - input, pseudorange measured on L2pr - output, pseudorange corrected for ionospheric effects

4.67 PRADR

Scope:This MATLAB macro computes pseudorange and accumulated delta range for a specifiedsatellite. WGS-84 constants are used.

Usage: [pr,adr] = pradr(upos,uposlla,uelaz,svpos,tsim,step,svid,flags)

Description of parameters:upos - input, user position in ECEF, the components are in metersuposlla - input, user position in geodetic coordinates (latitude/longitude/altitude

above ellipsoid), the components are in radians, radians, and meters(optional, it is needed when iono correction flag is set)

uelaz - input, elevation and azimuth angles as followsuelaz(1) - elevation angle, in radiansuelaz(2) - azimuth angle, in radians

svpos - input, ECEF satellite position, the components in meterstsim - input, simulation time (time of week), in secondsstep - input, step number; the value is used when when one of the following are

applied: SA, multipath, user clock, pseudorange noise, ambiguity, deltarange noise

svid - input, satellite id

Page 131: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 PZ90CON

- Page 4-31 -

flags - input, flags with the following meaningflags(1) = 0 iono correction is not used != 0 iono correction is used; the coefficients alpha and beta should be initialized before calling this module (see global)flags(2) = 0 tropo correction is not used != 0 tropo correction is used; geoid heights data file (e.g. tgeoid84. dat) should be loaded before calling this module (see global)flags(3) = 0 SA correction is not used != 0 SA correction is used; SA data file (e.g. safile.mat) should be loaded before calling this module (see also global)flags(4) = 0 multipath is not used != 0 multipath is used; multipath data file (e.g. mpfile.mat) should be loaded before calling this module (see also global)flags(5) = 0 user clock bias/drift is not used != 0 user clock bias/drift is used; user clock bias and drift data file (e.g. ucbfile.mat) should be loaded before calling this module (see also global)flags(6) = 0 earth rotation correction is not used != 0 earth rotation correction is usedflags(7) = 0 pseudorange noise is not used != 0 pseudorange noise is used; prnoise(nrstep,svid) generated in the main program (see also global)flags(8) = 0 carrier phase is not generated != 0 carrier phase is generated; user clock bias and drift data (e.g. ambfile.mat) file should be loaded before (see also global)flags(9) = 0 delta range noise is not used != 0 delta range noise is used ; adrnoise(nrstep,svid) generated in the main program (see also global)

pr - output, pseudorange, in metersadr - output, accumulated delta range, in meters (optional)

Remarks:It is assumed that the satellite is visible. Some data are transmitted using globals.

External Matlab macros used: ionoc, tropoc1, uercor, wgs84con

4.68 PZ90CON

Scope:This MATLAB macro sets the PZ-90 (earth's parameters 1990) most used constants asglobal variables.

Usage: pz90con

Description of parameters:a_smaxis - output, PZ-90 earth semi-major axis in meters

Page 132: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 QRUPA, RAIMFD

- Page 4-32 -

b_smaxis - output, PZ-90 earth semi-minor axis in meterseccentr - output, PZ-90 earth eccentricityeccentr2 - output, PZ-90 earth eccentricity squaredflatness - output, PZ-90 flatness (ellipticity)gravpar - output, PZ-90 gravity parameter in meters**3/sec**2 earth's gravitational constant (mass of earth including earth's atmosphere)gravatm - output, PZ-90 gravitational constant of atmosphere in m**3/s**2rot_rate - output, PZ-90 earth rotation rate in radians/secondc_speed - output, PZ-90 speed of light in vacuum in meters/secondg0 - output, PZ-90 equatorial acceleration of gravity in meters/sec**2gcoratm - output, PZ-90 correction to the acceleration of gravity at sea level

because of atmosphere, in meters/sec**2j2 - output, PZ-90 second zonal harmonic of the geopotential

Reference: [34]

4.69 QRUPA

Scope:This MATLAB module implements the updating algorithm [10] for Q-R factorization ofthe modified measurement matrix when a new clock measurement is added.

Usage: [qupdate,rupdate] = qrupa(m,n,q,r,alpha)

Description of parameters:m - input, real scalar, number of rows and columns in matrix q, and number of

rows in matrix rn - input, real scalar, number of columns in matrix rq - input, real two-dimensional array storing the initial matrix q, where

measurement matrix is decomposed in (q,r) factorsr - input, real two-dimensional array storing the initial matrix r, where

measurement matrix is decomposed in (q,r) factorsalpha - input, real scalar, ratio between pseudorange measurement standard

deviation and clock standard deviationqupdate - output, real two-dimensional array storing the updated q matrix qupdaterupdate - output, real two-dimensional array storing the updated r matrix rupdate

Reference: [10]

4.70 RAIMFD

Scope :This MATLAB module determines the outcome of a fault detection algorithm for theReceiver Autonomous Integrity Monitoring (RAIM) [23]; only a time step is processed.

Page 133: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 RAIMST

- Page 4-33 -

Usage : counts = raimfd(g,pfa,sigma,pmd)

Description of parameters :g - input, line-of-sight unit vectors, each vector is stored in another row (it

should be 3 columns)pfa - input, probability of false alarmsigma - input, standard deviation of measurement noise (in meters)pmd - input, probability of missed detectioncounts - output, counters

counts(1) = false alarm counter counts(2) = true alarm counter counts(3) = missed detection counter counts(4) = normal operation counter counts(5) = unavailable counter

Remark:It is assumed that at least five line-of-sight unit vectors are specified as input.

Reference : [23]

4.71 RAIMST

Scope:This MATLAB module determines availability and failure flags for the ReceiverAutonomous Integrity Monitoring (RAIM) baseline standard algorithm (constant alarmrate algorithm) [7].

Usage: [avail,testst] = raimst(g,threshold,arpceil,epsvec)

Description of parameters:g - input, line-of-sight unit vectors, each vector is stored in another row (it

should be 3 columns)threshold - input, threshold valuearpceil - input, arp ceiling value; arp = approximate radial error protectedepsvec - input, error vector in true rangeavail - output, availability flag = 0 admissible = 1 inadmissibletestst - output, failure flag = 0 no failure = 1 failure

Remark:It is assumed that at least five line-of-sight unit vectors are specified as input.

Reference: [7]

Page 134: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 RANGE, RMS, RMS2

- Page 4-34 -

4.72 RANGE

Scope:This MATLAB module computes the range between two position points defined into athree-dimensional orthogonal frame.

Usage: x = range(x1,x2)

Description of parameters:x1 - input, first position pointx2 - input, second position pointx - output, range between the two defined position points

Remarks:1) The computation is executed when the two vectors have the same dimension.2) The components of the input vectors and the range should have the same unit, e.g.

meters, feet.

4.73 RMS

Scope:This MATLAB module computes root mean square (RMS) of a sample.

Usage: y = rms(x)

Description of parameters:x - input, sample vector (columnwise) with m elementsy - output, RMS value (normalized by (m-1)); if the sample vector has only one

element then the result is 0.

4.74 RMS2

Scope:This MATLAB macro computes modified root mean square (modified RMS) of asample.

Usage: y = rms2(x)

Description of parameters:x - input, sample (row or column) vector with m elementsy - output, RMS2 value, i.e. square root of (sum of squares normalized by

number of elements)

Remark:

Page 135: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 RSS, RSSXY, RWALK

- Page 4-35 -

The modified RMS is identical to the textbook RMS when the sum of all sampleelements is zero.

4.75 RSS

Scope:This MATLAB module computes root sum square (RSS) of a three component vectorsample.

Usage: y = rss(x)

Description of parameters:x - input, sample vector, x(i,*) is an i-th three component vector sampley - output, RSS value, y(i) is the RSS of the i-th three component vector sample

4.76 RSSXY

Scope:This MATLAB module computes root sum square (RSS) of a two component vectorsample.

Usage: y = rssxy(x)

Description of parameters:x - input, sample vector, x(i,*) is an i-th two component vector sampley - output, RSS value, y(i) is the RSS of the i-th two component vector sample

4.77 RWALK

Scope:This MATLAB module generates random walk process. The seed is reset to 0. at the startof the random number generation process, i.e. at each execution of this module.

Usage: x = rwalk(n,qdt)

Description of parameters:n - input, number of random numbers to be generatedqdt - input, noise covariance q*dtx - output, random walk process with n elements

External Matlab modules used: genrn

Method:Direct implementation of the formula

Page 136: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 SDOP, SELECTD

- Page 4-36 -

x_new = x_old + wwhere w is a normally distributed random number with zero mean and standard deviation equals to qdt

4.78 SDOP

Scope:This MATLAB macro computes sub-dilution of precision (sub-DOP) quantities, i.e. DOPquantities for all satellites subsets obtained from eliminating one satellite from theoriginal set. Five or more satellites are needed for the computation of sub-DOP.

Usage: [sgdop,spdop,shdop,svdop,stdop,dops] = sdop(g)

Description of parameters:g - input, line-of-sight unit vectors, each vector is stored in another row (it should

be 3 columns)sgdop - output, sub-GDOP for all satellites subsetsspdop - output, sub-PDOP for all satellites subsetsshdop - output, sub-HDOP for all satellites subsetssvdop - output, sub-VDOP for all satellites subsetsstdop - output, sub-TDOP for all satellites subsetsdops - output, dilution of precision quantities for the complete set of satellites

dops(1) = geometric dilution of precision (GDOP) dops(2) = position dilution of precision (PDOP) dops(3) = horizontal dilution of precision (HDOP) dops(4) = vertical dilution of precision (VDOP) dops(5) = time dilution of precision (TDOP)

Remark:The sub-HDOP is useful in the RAIM detection process [7], [27].

References: [7], [27]

4.79 SELECTD

Scope:This MATLAB module selects only the different elements from a specified array.

Usage: [xsel,nsel] = selectd(x)

Description of parameters:x - input, columnwise array containing elements to be selectedxsel - output, array containing selected elements, vector with nsel elementsnsel - output, number of elements in the array xsel

Page 137: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 SGS85CON, SLOPEMAX

- Page 4-37 -

4.80 SGS85CON

Scope:This MATLAB macro sets the SGS-85 (Soviet Geodetic System 1985) most usedconstants as global variables.

Usage: sgs85con

Description of parameters:a_smaxis - output, SGS-85 earth semi-major axis in metersb_smaxis - output, SGS-85 earth semi-minor axis in meterseccentr - output, SGS-85 earth eccentricityeccentr2 - output, SGS-85 earth eccentricity squaredflatness - output, SGS-85 flatness (ellipticity)gravpar - output, SGS-85 gravity parameter in meters**3/sec**2 earth's

gravitational constant (mass of earth including earth's atmosphere)gravatm - output, SGS-85 gravitational constant of atmosphere in m**3/s**2rot_rate - output, SGS-85 earth rotation rate in radians/secondc_speed - output, SGS-85 speed of light in vacuum in meters/ secondg0 - output, SGS-85 equatorial acceleration of gravity in meters/sec**2gcoratm - output, SGS-85 correction to the acceleration of gravity at sea level

because of atmosphere, in meters/sec**2j2 - output, SGS-85 second zonal harmonic of the geopotential

Reference: [34]

4.81 SLOPEMAX

Scope:This MATLAB module determines slopemax value for the Receiver AutonomousIntegrity Monitoring (RAIM) baseline standard algorithm (constant alarm rate algorithm)[7].

Usage: xoutput = slopemax(g)

Description of parameters:g - input, line-of-sight unit vectors, each vector is stored in another row (it

should be 3 columns)xoutput - output, value of the slopemax

Remark:It is assumed that at least five line-of-sight unit vectors are specified as input.

Reference: [7]

Page 138: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 STATUP, SVPALM

- Page 4-38 -

4.82 STATUP

Scope:This MATLAB module computes the running mean, standard deviation and root meansquare for a set of real samples.

Usage: [np1,am,astd,arms] = statup(np1,xnp1,am,astd,arms)

Description of parameters:np1 - input, number of samples of the old set is np1 - 1xnp1 - input, latest sample to be added to the old set to form the new setam - input, mean of the old setastd - input, standard deviation of the old set of samplesarms - input, root mean square of the old set of samplesnp1 - output, number of samples of the new setam - output, mean of the new setastd - output, standard deviation of the new set of samplesarms - output, root mean square of the new set of samples

Remarks:1) np1 should be greater or equal to 1.2) The first call to this module should be with np1 = 1, for the initialization - when the computation of running mean, standard deviation and mean square root is beginning.

4.83 SVPALM

Scope:This MATLAB macro computes ECEF satellite position based on satellite almanac data;WGS-84 constants are used.

Usage: psa = svpalm(tsim,adata)

Description of parameters:tsim - input, tsim, GPS system time at time of transmission, i.e. GPS time

corrected for transit time (range/speed of light), in secondsadata(1) - input, toa, reference time almanac (time of applicability), in secondsadata(2) - input, smaxis (a), semi-major axis, in metersadata(3) - input, ecc (e), satellite eccentricityadata(4) - input, izero (I_0), inclination angle at reference time, in radiansadata(5) - input, razero (OMEGA_0), right ascension at reference time, in radians

(longitude of ascending node of orbit plane at weekly epoch)adata(6) - input, argper (omega), argument of perigee, in radiansadata(7) - input, mzero (M_0), mean anomaly at reference time, in radiansadata(8) - input, radot (OMEGA_DOT), rate of right ascension, in radians/secondpsa - output, ECEF satellite position vector, the components are in meters

Page 139: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 SVPEPH, SVSEL4

- Page 4-39 -

External Matlab macros used: wgs84con

4.84 SVPEPH

Scope:This MATLAB macro computes ECEF satellite position based on satellite ephemerisdata; WGS-84 constants are used.

Usage: pse = svpeph(tsim,edata)

Description of parameters:tsim - input, tsim, GPS system time at time of transmission, i.e. GPS time

corrected for transit time (range/speed of light), in secondsedata(1) - input, toe, reference time ephemeris, in secondsedata(2) - input, smaxis (a), semi-major axis, in metersedata(3) - input, ecc (e), satellite eccentricityedata(4) - input, izero (I_0), inclination angle at reference time, in radiansedata(5) - input, razero (OMEGA_0), right ascension at reference time, in radians

(longitude of ascending node of orbit plane at weekly epoch)edata(6) - input, argper (omega), argument of perigee, in radiansedata(7) - input, mzero (M_0), mean anomaly at reference time, in radiansedata(8) - input, radot (OMEGA_DOT), rate of right ascension, in radians/secondedata(9) - input, deln (delta_n), mean motion difference from computed value, in

radians/secondedata(10) - input, idot (I_DOT), rate of inclination angle, in radians/secondedata(11) - input, cic, amplitude of the cosine harmonic correction term to the angle

of inclination, in radiansedata(12) - input, cis, amplitude of the sine harmonic correction term to the angle of

inclination, in radiansedata(13) - input, crc, amplitude of the cosine harmonic correction term to the orbit

radius, in metersedata(14) - input, crs, amplitude of the sine harmonic correction term to the orbit

radius, in metersedata(15) - input, cuc, amplitude of the cosine harmonic correction term to the

argument of latitude, in radiansedata(16) - input, cus, amplitude of the sine harmonic correction term to the

argument of latitude, in radianspse - output, ECEF satellite position vector, the components are in meters

External Matlab macros used: wgs84con

4.85 SVSEL4

Scope:

Page 140: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 SVSEL5

- Page 4-40 -

This MATLAB module determines the selection of a set of 4 satellites based on minimumgeometric dilution of precision (GDOP) from all possible sets available. For the selectedset of 4 satellites the computed dilution-of-precision (DOP) values are outputted.

Usage: [hmat,dops,svind] = svsel4(losuvec)

Description of parameters:losuvec - input, line of sight unit vectors for all visible or selected satellites assembled

into a 3 by nrsv matrix, where nrsv is the number of satellites (nrsv ≥ 4)hmat - output, 4 by 4 matrix containing the selected LOS vectors combination;

each column contains one LOS vector and 1 as the last componentdops - output, dilution-of-precision (DOP) values in the following order

dops(1) = geometric dilution of precision (GDOP) dops(2) = position dilution of precision (PDOP) dops(3) = horizontal dilution of precision (HDOP) dops(4) = vertical dilution of precision (VDOP) dops(5) = time dilution of precision (TDOP)

svind - output, indices of the selected optimum satellite combination (4 satellites); indices are reflecting the order line of sight unit vectors are listed in the input array losuvec

4.86 SVSEL5

Scope:This MATLAB module determines the selection of a set of 5 satellites based on minimumgeometric dilution of precision (GDOP) from all possible sets available. For the selectedset of 5 satellites the computed dilution-of-precision (DOP) values are outputted.

Usage: [hmat,dops,svind] = svsel5(losuvec)

Description of parameters:losuvec - input, line of sight unit vectors for all visible or selected satellites assembled

into a 3 by nrsv matrix, where nrsv is the number of satellites (nrsv ≥ 5)hmat - output, 4 by 5 matrix containing the selected LOS vectors combination;

each column contains one LOS vector and 1 as the last componentdops - output, dilution-of-precision (DOP) values in the following order dops(1) = geometric dilution of precision (GDOP) dops(2) = position dilution of precision (PDOP) dops(3) = horizontal dilution of precision (HDOP) dops(4) = vertical dilution of precision (VDOP) dops(5) = time dilution of precision (TDOP)svind - output, indices of the selected optimum satellite combination (5 satellites); ind-

ices are reflecting the order line of sight unit vectors are in the array losuvec

Page 141: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 SVSEL6, SWDOP

- Page 4-41 -

4.87 SVSEL6

Scope:This MATLAB module determines the selection of a set of 6 satellites based on minimumgeometric dilution of precision (GDOP) from all possible sets available. For the selectedset of 6 satellites the computed dilution-of-precision (DOP) values are outputted.

Usage: [hmat,dops,svind] = svsel6(losuvec)

Description of parameters:losuvec - input, line of sight unit vectors for all visible or selected satellites assembled

into a 3 by nrsv matrix, where nrsv is the number of satellites (nrsv ≥ 6)hmat - output, 4 by 6 matrix containing the selected LOS vectors combination;

each column contains one LOS vector and 1 as the last componentdops - output, dilution-of-precision (DOP) values in the following order dops(1) = geometric dilution of precision (GDOP) dops(2) = position dilution of precision (PDOP) dops(3) = horizontal dilution of precision (HDOP) dops(4) = vertical dilution of precision (VDOP) dops(5) = time dilution of precision (TDOP)svind - output, indices of the selected optimum satellite combination (6 satellites);

indices are reflecting the order line of sight unit vectors are listed in the input array losuvec

4.88 SWDOP

Scope:This MATLAB macro computes sub-weighted dilution of precision (sub-WDOP)quantities, i.e. WDOP quantities for all satellites subsets obtained from eliminating onesatellite from the original set.

Usage: [swgdop,swpdop,swhdop,swvdop,swtdop,wdops] = swdop(g,wf)

Description of parameters:g - input, line-of-sight unit vectors, each vector is stored in another row (it

should be 3 columns)wf - input, array containing weighting factors, it should be one weighting factor

for each line-of-sight unit vector (in the same order)swgdop - output, sub-WGDOP for all satellites subsetsswpdop - output, sub-WPDOP for all satellites subsetsswhdop - output, sub-WHDOP for all satellites subsetsswvdop - output, sub-WVDOP for all satellites subsetsswtdop - output, sub-WTDOP for all satellites subsetswdops - output, weighted dilution of precision quantities for the complete set of

satellites; vector with the following components: wdops(1) = geometric dilution of precision (WGDOP)

Page 142: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 TADMSRAD, TARADDMS, TECEFGD

- Page 4-42 -

wdops(2) = position dilution of precision (WPDOP)wdops(3) = horizontal dilution of precision (WHDOP)wdops(4) = vertical dilution of precision (WVDOP)wdops(5) = time dilution of precision (WTDOP)

Remark:Five or more satellites are needed for the computation of sub-WDOP. The sub-WHDOPis useful in the RAIM detection process [7], [27].

References: [7], [27]

4.89 TADMSRAD

Scope:This MATLAB module converts an angle value from degrees/minutes/seconds to radians.

Usage: arad = tadmsrad(adeg,amin,asec)

Description of parameters:adeg - input, angle - degrees component, positive or negative numberamin - input, angle - minutes component, positive number onlyasec - input, angle - seconds component, positive number onlyarad - output, angle in radians

4.90 TARADDMS

Scope:This MATLAB module converts an angle value from radians to degrees/minutes/seconds.

Usage: [adeg,amin,asec] = taraddms(arad)

Description of parameters:arad - input, angle in radiansadeg - output, angle - degrees componentamin - output, angle - minutes componentasec - output, angle - seconds component

4.91 TECEFGD

Scope:This MATLAB module performs the transformation from ECEF to geodetic coordinatesfor a given position; WGS-84 constants are used.

Usage: [lat,lon,alt] = tecefgd(pecef)

Page 143: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 TECEFGD2, TGDECEF

- Page 4-43 -

Description of parameters:pecef - input, ECEF position, with components in meterslat - output, latitude of the position, in radianslon - output, longitude of the position, in radiansalt - output, altittude of the position, in meters

Reference: [35]

External Matlab macros used: wgs84con

4.92 TECEFGD2

Scope:This MATLAB macro performs the transformation from ECEF to geodetic coordinatesfor a given position by using an iterative process; WGS-84 constants are used.

Usage: [lat,lon,alt] = tecefgd2(pecef)

Description of parameters:pecef - input, ECEF position, with components in meterslat - output, latitude of the position, in radianslon - output, longitude of the position, in radiansalt - output, altitude of the position, in meters

External Matlab macros used: wgs84con

4.93 TGDECEF

Scope:This MATLAB module performs the transformation from geodetic to ECEF coordinatesfor a given position; WGS-84 constants are used.

Usage: pecef = tgdecef(lat,lon,alt)

Description of parameters:lat - input, latitude of the given position, in radianslon - input, longitude of the given position, in radiansalt - input, altittude (above ellipsoid) of the given position, in meterspecef - output, ECEF position, with components in meters

External Matlab macros used: wgs84con

Page 144: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 TIMETR, TRAJS

- Page 4-44 -

4.94 TIMETR

Scope:This MATLAB macro computes GPS time of transmission from time of measurement(reception) for a satellite pseudorange measurement; WGS-84 constants are used.

Usage: xoutput = timetr(tmeas,toc,af,pr)

Description of parameters:tmeas - input, time of measurement (reception), in secondstoc - input, reference time of clock (from ephemeris data), in secondsaf - input, array containing ephemeris satellite clock parameters af0 --> af(1),

af1 --> af(2) and af2 --> af(3)pr - input, satellite pseudorange, in metersxoutput - output, time of transmission, in seconds

Remark:The relativistic correction term given by

delta_tr = F * e * sqrt(a) * sin(Ek)where

F = -4.442807633*10^(-10) sec/(meters)^0.5 in WGS-84e is the satellite eccentricitya is the satellite semi-major axisEk is ecentric anomaly (time dependent) can be added to delta_ts to improved the computational accuracy.

External Matlab macros used: wgs84con

4.95 TRAJS

Scope:This MATLAB macro computes the vehicle trajectory with the following characteristics:straight segment with constant speed in ENU frame; the trajectory is specified in ECEFand ENU frames. WGS-84 constants are used.

Usage: [trajecef,trajenu] = trajs(user0xyz,v0enu,deltat,nsteps)

Description of parameters:user0xyz - input, user's initial ECEF position, the components are in metersv0enu - input, ENU velocity vector, the components are in meters/seconddeltat - input, time step, in secondsnsteps - input, number of step desiredtrajecef - output, ECEF position, the components are in meters; trajecef(k+1,:) is the

k-th time step valuetrajenu - output, ENU position, the components are in meters; trajenu(k+1,:) is the

k-th time step value; the origin is the initial user's position

Page 145: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 TROPOC1, UCLOCK

- Page 4-45 -

External Matlab macros used: tecefgd, venuecef, wgs84con

4.96 TROPOC1

Scope:This MATLAB macro computes tropospheric correction for a specified user by using asimplified model [1]; WGS-84 constants are used.

Usage: tropoc = tropoc1(lat,lon,alt,elev,tgeoid)

Description of parameters:lat - input, user's latitude, in radians (-pi/2 to +pi/2)lon - input, user's longitude, in radians (0 to 2*pi)alt - input, user's altitude above WGS-84 ellipsoid, in meterselev - input, user's elevation angle, in radianstgeoid - input, geoid heights table (in meters) for a 19 by 36 Latitude/Longitude grid;

the latitudes go northward from -90 to 90 degrees, and longitudes go eastward from 0 to 350 degrees

tropoc - output, tropospheric correction, in meters

Reference: [29]

External Matlab macros used: geoidh

4.97 UCLOCK

Scope:This MATLAB macro computes user clock bias and drift by using a simplified secondorder model [1]. WGS-84 constants are used.

Usage: [cbias,cdrift] = uclock(nsteps,sb,sf,dt) when seed is not reset[cbias,cdrift] = uclock(nsteps,sb,sf) when seed is not reset and dt = 1 as

default values

Description of parameters:nsteps - input, number of steps to be executedsb - input, white noise spectral density amplitude for the first component

corresponding to clock bias, in secondssf - input, white noise spectral density amplitude for the second component

corresponding to clock drift, in second/seconddt - input (optional), time interval between two consecutive steps, in seconds;

the default value is 1 secondiseed - input (optional), seed valuecbias - output, clock bias vector for nsteps, in meters

Page 146: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 UERCOR, UPOSD4

- Page 4-46 -

cdrift - output, clock drift vector for nsteps, in meters/sec

Remark:The initial clock bias and drift values can be changed; the default values are 0.

Reference: [8]

External Matlab macros used: wgs84con

4.98 UERCOR

Scope:This MATLAB macro computes user earth rotation correction vector as per ICD-GPS-200C [1]. WGS-84 constants are used.

Usage: xercor = uercor(upos,dt)

Description of parameters:upos - input, user ECEF position, the components are in metersdt - input, time delay of signal propagation from satellite to user, in secondsxercor - output, user earth rotation correction vector, ECEF components are in meters

References: [4], [36]

External Matlab macros used: wgs84con

4.99 UPOSD4

Scope:This MATLAB module computes GPS user's position by using a direct (non-iterative)GPS solution method proposed by Bancroft [5], [9], when four satellite positions and thecorresponding pseudoranges are known.

Usage: [nsol,upos,ucbias] = uposd4(svpos,rho)

Description of parameters:svpos - input, four ECEF satellite positions, each row contains the three component

for a satellite, all components are in metersrho - input, columnwise four pseudoranges, the pseudoranges are in metersnsol - output, number of solutions (0, 1 or 2)upos - output, ECEF user's position, the components are in metersucbias - output, user's clock bias (the difference between user's time and GPS time)

measured in units of distance (meters)

Page 147: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 UPOSDG, UPOSIT, UVERV

- Page 4-47 -

References: [5], [9]

4.100 UPOSDG

Scope:This MATLAB module computes GPS user's position by using a direct (non-iterative)GPS solution method proposed by Bancroft [5], [9], when at least four satellite positionsand the corresponding pseudoranges are known.

Usage: [nsol,upos,ucbias] = uposdg(svpos,rho)

Description of parameters:svpos - input, at least four ECEF satellite positions, each row contains the three

component for a satellite, all components are in metersrho - input, columnwise, at least four pseudoranges, the pseudoranges are in

metersnsol - output, number of solutions (0, 1 or 2)upos - output, ECEF user's position, the components are in metersucbias - output, user's clock bias (the difference between user's time and GPS time)

measured in units of distance (meters)

References: [5], [9]

4.101 UPOSIT

Scope:This MATLAB module computes GPS user's position by using an iterative method, whenfour ECEF satellite positions and the corresponding pseudoranges are known.

Usage: [upos,ucbias] = uposit(svpos,rho,upos)

Description of parameters:svpos - input, four ECEF satellite positions, each row contains the three component

for a satellite, all components are in metersrho - input, columnwise four pseudoranges, the pseudoranges are in metersupos - input/output, ECEF user's position, the components are in meters; as input,

the initialization value or the value from the previous iterationucbias - output, user's clock bias (the difference between user's time and GPS time)

measured in units of distance (meters)

4.102 UVERV

Scope:

Page 148: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 VBLLW, VECEFECI

- Page 4-48 -

This MATLAB module computes the unit vertical vector (up) for a given ECEF positionvector; WGS-84 constants are used.

Usage: up = uverv(p)

Description of parameters:p - input, ECEF position vector, the components are in metersup - output, unit vertical vector (up), the components are in meters

External Matlab macros used: wgs84con

4.103 VBLLW

Scope:This MATLAB module performs the transformation from GPS body frame to wanderazimuth local level frame for a given position vector and referenced yaw/pitch/roll angles.

Usage: pllw = vbllw(pb,yaw,pitch,roll)

Description of parameters:pb - input, GPS body frame position vector (with components in meters)yaw - input, yaw angle in radianspitch - input, pitch angle in radiansroll - input, roll angle in radianspllw - output, local level wander azimuth position vector, with components in the

same units as the input GPS body frame position vector

Remark:The coordinate axes for wander azimuth local level frame are defined as follows:x - axis at wander azimuth angle counter-clockwise from East in local level plane,y - axis at wander azimuth angle counter-clockwise from North in local level plane,z - axis upward along local normal

4.104 VECEFECI

Scope:This MATLAB macro performs the transformation from ECEF to ECI (Earth CenteredInertial) coordinates for a given position vector and time elapsed since reference time;WGS-84 earth's rotation rate constant is used.

Usage: peci = vecefeci(pecef,dtime)

Description of parameters:pecef - input, ECEF position vector (with components in meters)dtime - input, time elapsed since reference time in seconds

Page 149: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 VECEFENU, VECEFGD

- Page 4-49 -

peci - output, ECI position vector, with components in same units as the input ECEF position vector

Remark:The ECEF to ECI transformation takes into account only Earth's rotation, i.e. no Earth'sprecession and mutation effects.

External Matlab macros used: wgs84con

4.105 VECEFENU

Scope:This MATLAB module performs the transformation from ECEF frame to ENU (East,North, Up) frame for a given position vector and referenced latitude/longitude angles.

Usage: penu = vecefenu(pecef,lat,lon)

Description of parameters:pecef - input, ECEF position vector (with components in meters)lat - input, reference latitude in radianslon - input, reference longitude in radianspenu - output, ENU position vector, with components in same units as the input ECEF

position vector

4.106 VECEFGD

Scope:This MATLAB module performs the transformation from ECEF frame to geodeticcoordinates for a given position vector; the reference point is given in geodeticcoordinates.

Usage: pgd = vecefgd(pecef,pgdref)

Description of parameters:pecef - input, ECEF position vector, with components in meterspgdref - input, geodetic position of the reference point, where pgdref(1) = latitude in radians pgdref(2) = longitude in radians pgdref(3) = altitude in meterspgd - output, geodetic position of the final point, where pgd(1) = latitude in radians pgd(2) = longitude in radians pgd(3) = altitude in meters

External Matlab modules used: tecefgd, tgdecef

Page 150: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 VECEFINS, VECEFLLW,VECEFP90

- Page 4-50 -

4.107 VECEFINS

Scope:This MATLAB module performs the transformation from ECEF to INS platformcoordinates (Wander / North, West, Up) for a given position vector and referencelatitude/longitude/wander azimuth angles.

Usage: pins = vecefins(pecef,lat,long,waz)

Description of parameters:pecef - input, ECEF position vector (with components in meters)lat - input, reference latitude in radianslon - input, reference longitude in radianswaz - input, reference wander azimuth angle in radianspins - output, INS platform position vector, with components in same units as the

input ECEF position vector

4.108 VECEFLLW

Scope:This MATLAB module performs the transformation from ECEF frame to wanderazimuth local level frame for a given position vector and referencelatitude/longitude/wander azimuth angles.

Usage: pllw = vecefllw(pecef,lat,lon,waz)

Description of parameters:pecef - input, ECEF position vector (with components in meters)lat - input, reference latitude in radianslon - input, reference longitude in radianswaz - input, reference wander azimuth angle in radianspllw - output, local level wander azimuth position vector, with components in

same units as the input ECEF position vector

Remark:The coordinate axes for wander azimuth local level frame are defined as follows:x - axis at wander azimuth angle counter-clockwise from East in local level plane,y - axis at wander azimuth angle counter-clockwise from North in local level plane,z - axis upward along local normal

4.109 VECEFP90

Scope:

Page 151: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 VECEFS85, VECIECEF

- Page 4-51 -

This MATLAB macro performs the transformation from ECEF WGS-84 to PZ-90("Parametri Zemli 1990", i.e. earth's parameters 1990) frame coordinates for a givenposition vector with components expressed in meters.

Usage: ppz90 = vecefp90(pecef)

Description of parameters:pecef - input, ECEF (WGS-84) position vector with components in metersppz90 - output, PZ-90 frame position vector, with components in meters

Reference: [37]

4.110 VECEFS85

Scope:This MATLAB macro performs the transformation from ECEF WGS-84 to SGS-85(Soviet Geodetic System 1985) frame coordinates for a given position vector withcomponents expressed in meters.

Usage: psgs85 = vecefs85(pecef)

Description of parameters:pecef - input, ECEF (WGS-84) position vector with components in meterspsgs85 - output, SGS-85 frame position vector, with components in meters

Reference: [38]

4.111 VECIECEF

Scope:This MATLAB macro performs the transformation from ECI (Earth Centered Inertial) toECEF coordinates for a given position vector and time elapsed since reference time;WGS-84 earth's rotation rate constant is used.

Usage: pecef = veciecef(peci,dtime)

Description of parameters:peci - input, ECI position vector (with components in meters)dtime - input, time elapsed since reference time in secondspecef - output, ECEF position vector, with components in same units as the input ECI

position vector

Remark:The ECI to ECEF transformation takes into account only Earth's rotation, i.e. no Earth'sprecession and mutation effects.

Page 152: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 VENUECEF, VENUGD, VENULLW

- Page 4-52 -

External Matlab macros used: wgs84con

4.112 VENUECEF

Scope:This MATLAB module performs the transformation from ENU (East, North, Up) toECEF coordinates for a given position vector and reference latitude/longitude angles.

Usage: pecef = venuecef(penu,lat,lon)

Description of parameters:penu - input, ENU position vector (with components in meters)lat - input, reference latitude in radianslon - input, reference longitude in radianspecef - output, ECEF position vector, with components in same units as the input ENU

position vector

4.113 VENUGD

Scope:This MATLAB module performs the transformation from ENU (East, North, Up) togeodetic coordinates for a given position vector and a reference point.

Usage: pgd = venugd(penu,pgdref)

Description of parameters:penu - input, ENU position vector, with components in meterspgdref - input, geodetic position of the reference point, where pgdref(1) = latitude in radians pgdref(2) = longitude in radians pgdref(3) = altitude in meterspgd - output, geodetic position of the final point, where pgd(1) = latitude in radians pgd(2) = longitude in radians pgd(3) = altitude in meters

External Matlab modules used: tecefgd, tgdecef, venuecef

4.114 VENULLW

Scope:

Page 153: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 VEP, VGDECEF

- Page 4-53 -

This MATLAB module performs the transformation from ENU (East, North, Up) towander azimuth local level coordinates for a given position vector and a reference wanderazimuth angle.

Usage: pllw = venullw(penu,waz)

Description of parameters:penu - input, ENU position vector (with components in meters)waz - input, wander azimuth angle in radianspllw - output, local level wander azimuth position vector, with components in

same units as the input ENU vector

Remark:The coordinate axes for wander azimuth local level frame are defined as follows:x - axis at wander azimuth angle counter-clockwise from East in local level plane,y - axis at wander azimuth angle counter-clockwise from North in local level plane,z - axis upward along local normal

4.115 VEP

Scope:This MATLAB module computes the value of the vertical error probable (VEP).

Usage: yvep = vep(y)

Description of parameters:y - input, error vector containing the errors on y axisyvep - output, vertical error probable (VEP) value

4.116 VGDECEF

Scope:This MATLAB module performs the transformation from geodetic to ECEF coordinatesfor a given position vector specified by the external points in geodetic coordinates; WGS-84 constants are used.

Usage: pecef = vgdecef(pgd,pgdref)

Description of parameters:pgd - input, geodetic position of the final point, where

pgd(1) = latitude in radians pgd(2) = longitude in radians pgd(3) = altitude in meters

pgdref - input, geodetic position of the reference point, where pgdref(1) = latitude in radians

Page 154: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 VGDENU, VINSECEF

- Page 4-54 -

pgdref(2) = longitude in radians pgdref(3) = altitude in meters

pecef - output, ECEF position vector, with components in meters

External Matlab modules used: tgdecef, wgs84con.

4.117 VGDENU

Scope:This MATLAB module performs the transformation from geodetic to ENU (East, North,Up) coordinates for a given position vector specified by the external points in geodeticcoordinates; WGS-84 constants are used.

Usage: penu = vgdenu(pgd,pgdref)

Description of parameters:pgd - input, geodetic position of the final point, where pgd(1) = latitude in radians pgd(2) = longitude in radians pgd(3) = altitude in meterspgdref - input, geodetic position of the reference point, where pgdref(1) = latitude in radians pgdref(2) = longitude in radians pgdref(3) = altitude in meterspenu - output, ENU position vector, with components in meters

External Matlab modules used: tgdecef, vecefenu, wgs84con.

4.118 VINSECEF

Scope:This MATLAB module performs the transformation from INS platform frame (Wander /North, West, Up) to ECEF coordinates for a given position vector and referencelatitude/longitude/wander azimuth angles.

Usage: pecef = vinsecef(pins,lat,lon,waz)

Description of parameters:pins - input, INS platform position vector (with components in meters)lat - input, reference latitude in radianslon - input, reference longitude in radianswaz - input, reference wander azimuth angle in radianspecef - output, ECEF position vector, with components in same units as the input

INS platform position vector

Page 155: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 VLLWB, VLLWECEF

- Page 4-55 -

4.119 VLLWB

Scope:This MATLAB module performs the transformation from wander azimuth local levelframe to GPS body frame for a given position vector and reference yaw/pitch/roll angles.

Usage: pb = vllwb(pllw,yaw,pitch,roll)

Description of parameters:pllw - input, local level wander azimuth position vector (with components in

meters)yaw - input, yaw angle in radianspitch - input, pitch angle in radiansroll - input, roll angle in radianspb - output, GPS body frame position vector (with components in same units as

the input local level wander azimuth position vector)

Remark:The coordinate axes for wander azimuth local level frame are defined as follows:x - axis at wander azimuth angle counter-clockwise from East in local level plane,y - axis at wander azimuth angle counter-clockwise from North in local level plane,z - axis upward along local normal

4.120 VLLWECEF

Scope:This MATLAB module performs the transformation from wander azimuth local levelframe to ECEF frame for a given position vector and reference latitude/longitude/ wanderazimuth angles.

Usage: pecef = vllwecef(pllw,lat,lon,waz)

Description of parameters:pllw - input, local level wander azimuth position vector (with components in

meters)lat - input, reference latitude in radianslon - input, reference longitude in radianswaz - input, reference wander azimuth angle in radianspecef - output, ECEF position vector, with components in same units as the input

local level wander azimuth position vector

Remark:The coordinate axes for wander azimuth local level frame are defined as follows:x - axis at wander azimuth angle counter-clockwise from East in local level plane,y - axis at wander azimuth angle counter-clockwise from North in local level plane,z - axis upward along local normal

Page 156: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 VLLWENU, VP90ECEF, VS85ECEF

- Page 4-56 -

4.121 VLLWENU

Scope:This MATLAB module performs the transformation from wander azimuth local levelframe to ENU (East, North, Up) frame for a given position vector and a reference wanderazimuth angle.

Usage: penu = vllwenu(pllw,waz)

Description of parameters:pllw - input, local level wander azimuth position vector (with components in

meters)waz - input, wander azimuth angle in radianspenu - output, ENU position vector, with components in same units as the input

local level wander azimuth position vector

Remark:The coordinate axes for wander azimuth local level frame are defined as follows:x - axis at wander azimuth angle counter-clockwise from East in local level plane,y - axis at wander azimuth angle counter-clockwise from North in local level plane,z - axis upward along local normal

4.122 VP90ECEF

Scope:This MATLAB macro performs the transformation from PZ-90 ("Parametri Zemli 1990",i.e. earth's parameters 1990) frame to ECEF WGS-84 frame coordinates for a givenposition vector with components expressed in meters.

Usage: pecef = vp90ecef(pecef)

Description of parameters:ppz90 - input, PZ-90 frame position vector, with components in meterspecef - output, ECEF (WGS-84) position vector with components in meters

Reference: [37]

4.123 VS85ECEF

Scope:This MATLAB macro performs the transformation from SGS-85 (Soviet GeodeticSystem 1985) frame to ECEF WGS-84 frame coordinates for a given position vector withcomponents expressed in meters.

Usage: pecef = vs85ecef(psgs85)

Page 157: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 WDOP1, WDOP2

- Page 4-57 -

Description of parameters:psgs85 - input, SGS-85 frame position vector, with components in meterspecef - output, ECEF (WGS-84) position vector with components in meters

Reference: [38]

4.124 WDOP1

Scope:This MATLAB module computes weighted dilution of precision (WDOP) quantitieswhen at least three line-of-sight unit vectors are specified, by using a direct method.

Usage: dops = wdop1(g,wf)

Description of parameters:g - input, line-of-sight unit vectors, each vector is stored in another row (it

should be 3 columns)wf - input, array containing weighting factors, it should be one weighting factor

for each line-of-sight unit vector (in the same order)wdops - output, weighted dilution of precision quantities wdops(1) = weighted geometric dilution of precision (WGDOP) wdops(2) = weighted position dilution of precision (WPDOP) wdops(3) = weighted horizontal dilution of precision (WHDOP) wdops(4) = weighted vertical dilution of precision (WVDOP) wdops(5) = weighted time dilution of precision (WTDOP)

Remark:When less than four line-of-sight unit vectors are specified the computation is not fullysignificant, and it is conducted by using a pseudoinverse matrix instead of an inversematrix.

4.125 WDOP2

Scope:This MATLAB module computes weighted dilution of precision (WDOP) quantitieswhen four line-of-sight unit vectors are specified, by using a direct method.

Usage: wdops = wdop2(g,wf)

Description of parameters:g - input, line-of-sight unit vectors, each vector is stored in another row (it

should be 3 columns)wf - input, array containing weighting factors, it should be one weighting factor

for each line-of-sight unit vector (in the same order)

Page 158: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 WDOPV, WGS72CON

- Page 4-58 -

wdops - output, weighted dilution of precision quantities wdops(1) = weighted geometric dilution of precision (WGDOP) wdops(2) = weighted position dilution of precision (WPDOP) wdops(3) = weighted horizontal dilution of precision (WHDOP) wdops(4) = weighted vertical dilution of precision (WVDOP) wdops(5) = weighted time dilution of precision (WTDOP)

4.126 WDOPV

Scope:This MATLAB module computes an approximate value for the weighted dilution ofprecision (WDOP) when at least four line-of-sight unit vectors are specified by using anapproximate geometric method [18].

Usage: [wdops,ier] = wdopv(g,wf)

Description of parameters:g - input, line-of-sight unit vectors, each vector is stored in another row (it

should be 3 columns)wf - input, array containing weighting factors, it should be one weighting factor

for each line-of-sight unit vector (in the same order)wdops - output, weighted dilution of precision quantities

wdops(1) = weighted geometric dilution of precision (WGDOP) wdops(2) = weighted position dilution of precision (WPDOP) wdops(3) = weighted horizontal dilution of precision (WHDOP) wdops(4) = weighted vertical dilution of precision (WVDOP) wdops(5) = weighted time dilution of precision (WTDOP)

ier - output, index of error = 0 computation performed = 1 computation is not performed, the corresponding matrix H is numerically singular = 2 computation is not performed, numerical error during the computation

of WHDOP

Reference: [18]

4.127 WGS72CON

Scope:This MATLAB module sets the WGS-72 most used constants as global variables.

Usage: wgs72con

Description of global parameters:a_smaxis - output, WGS-72 earth semi-major axis in meters

Page 159: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4 WGS84CON

- Page 4-59 -

b_smaxis - output, WGS-72 earth semi-minor axis in meterseccentr - output, WGS-72 earth eccentricityeccentr2 - output, WGS-72 earth eccentricity squaredflatness - output, WGS-72 flatness (ellipticity)gravpar - output, WGS-72 gravity parameter in meters**3/sec**2 earth's

gravitational constant (mass of earth including earth's atmosphere)rot_rate - output, WGS-72 earth rotation rate in radians/secondc_speed - output, speed of light in vacuum in meters/seconducgrav - output, universal constant of gravity (G) in meters**3/sec**2/Kgmearth - output, mass of earth (including the atmosphere) (M) in Kgg0 - output, ellipsoidal equatorial gravity in meters/sec**2

4.128 WGS84CON

Scope:This MATLAB module sets the WGS-84 most used constants as global variables.

Usage: wgs84con

Description of global parameters:a_smaxis - output, WGS-84 earth semi-major axis in metersb_smaxis - output, WGS-84 earth semi-minor axis in meterseccentr - output, WGS-84 earth eccentricityeccentr2 - output, WGS-84 earth eccentricity squaredflatness - output, WGS-84 flatness (ellipticity)eprime - output, WGS-84 second eccentricityeprime2 - output, WGS-84 second eccentricity squaredonemecc2 - output, WGS-84 one minus eccentricity squaredgravpar - output, WGS-84 gravity parameter in meters**3/sec**2, earth's

gravitational constant (mass of earth including earth's atmosphere)rot_rate - output, WGS-84 earth rotation rate in radians/secondc_speed - output, speed of light in vacuum in meters/seconducgrav - output, universal constant of gravity (G) in meters**3/sec**2/Kgmearth - output, mass of earth (including the atmosphere) (M) in Kgg0 - output, ellipsoidal equatorial gravity in meters/sec**2c20 - output, normalized second degree zonal harmonic coefficient of the

gravitational potential (C20)

Page 160: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 4

- Page 4-60 -

Page 161: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XAMBIG, XATRANSF

- Page 5-1 -

5.0 DETAILED SPECIFICATIONS FOR M-FILE MAIN PROGRAMS

5.1 XAMBIG

Scope:This MATLAB program generates ambiguity numbers for a specified number of satellites.

Usage: xambig

Inputs:From keyboard the user should enter the following data:- maximum number of satellites used, nrsv (default is 32)- random number seed value (default is 0)- selection of the storage data file - ambfile.mat (default) - selected name for ASCII data file - none, no storage

Outputs:- output file storing the ambiguity number for the number of selected satellites: mat-file ambfile.mat or defined ASCII data file; the output ambig array has one row and nrsv columns- display the ambiguity values for the number of selected satellites.

5.2 XATRANSF

Scope:This MATLAB program performs the following unit transformations of a specified angle(s):1) from degrees/minutes/seconds to radians transformation2) from radians to degrees/minutes/seconds transformation

Usage: xatransf

Inputs:- name of the output file if selected (the default is the screen)1) For the degrees/minutes/seconds to radians: - degrees value of the angle (including sign) - minutes value of the angle - seconds value of the angle The values can be entered from keyboard or from a specified file (in this case each row/record contains the degrees/minutes/seconds value of an angle).2) For the radians to degrees/minutes/seconds: - radians value of the angle (including sign) The values can be entered from keyboard or from a specified file (in this case each

Page 162: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XCEPVEP, XCON

- Page 5-2 -

row/record contains the radians value of an angle).

Outputs:- input/output data stored on the selected output file or displayed on the computer screen, namely - values of the input/output angle in radians - values of the output/input angle in degrees/minutes/seconds

External Matlab modules used: tadmsrad, taraddms

5.3 XCEPVEP

Scope:This MATLAB program computes the value of circular error probable (CEP) or vertical errorprobable (VEP) by using modules cep.m or vep.m.

Usage: xcepvep

Inputs:- name of the input file containing x-y error data for CEP computation and x error data for VEP computation; first column contains the x axis error data while the second column contains the y axis error data- name of the output file containing the results, optional

Outputs:- input/output data stored on the selected output file or displayed on screen

External Matlab modules used: cep, vep

5.4 XCON

Scope:This MATLAB program displays the constants specified by the modules convcon, gpscon,wgs72con, wgs84con, sgs85con, and pz90con. Each macro sets the constants as globalvariables.

Usage: xcon

Inputs:- selection of the set of constants (see the displayed menu)

Outputs:- displayed constants

Page 163: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XDOP, XEBUDGET

- Page 5-3 -

External Matlab modules used: convcon, gpscon, pz90con, sgs85con, wgs72con, wgs84con

5.5 XDOP

Scope:This MATLAB program computes dilution of precision (DOP) quantities when at least threeline-of-sight unit vectors are specified by using macro dop1.m or macro dop2.m when fourline-of-sight unit vectors are specified.

Usage: xdop

Inputs:- name of the output file containing the results; the default is the display on screen- selection of the macro to be used (dop1.m or dop2.m)- name of the input file containing line-of-sight unit vectors; each row contains a line-of- sight unit vector

Outputs:- input/output data stored on the selected output file or displayed on screen

Remark:When less than four line-of-sight unit vectors are specified the computation is not fullysignificant, and it is conducted by using a pseudoinverse matrix instead of an inverse matrix.

External Matlab modules used: dop1, dop2

5.6 XEBUDGET

Scope:This MATLAB program determines the error budget for a specified input data set.

Usage: xebudget

Inputs:- input data from keyboard as follows (1) space segment error (2) control segment error (3) user segment, tropo error (4) user segment, iono error (5) user segment, multipath error (6) user segment, receiver error (7) PDOP value (8) HDOP value

Page 164: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XECEF2GD_COMP

- Page 5-4 -

(9) VDOP value (10) TDOP value A complete default data set is provided.

Outputs:- selected input data- computed quantities, namely (1) URE (User Range Error), in meters (2) UEE (User Equipment Error), in meters (3) URE (User Equivalent Range Error), in meters (4) SEP (Spherical Error Probable, 50 percentage), in meters (5) CEP (Circular Error Probable, 50 percentage), in meters (6) LEP (Linear Error Probable, 50 percentage), in meters (7) Time Error (50 percentage), in nanoseconds (8) 3-D (Spherical) Position Error (95 percentage), in meters (9) 2-D (Horizontal) Position Error (95 percentage), in meters (10) Actual 2-D (Horizontal) Position Error (95 percentage), in meters (11) Vertical Position Error (95 percentage), in meters (12) Actual Vertical Position Error (95 percentage), in meters (13) Time Error (95 percentage), in nanoseconds (14) Actual Time Error (95 percentage), in nanoseconds

Remarks:1) For 2-D Horizontal Position Error (95 percentage) the real percentage is in the range of

95.4% to 98.2%. The "Actual" is adjusted for a circular distribution.2) For Vertical Position Error (95 percentage) and Time Error (95 percentage) the real

percentage is 95.4% rather than 95%. The "Actual" quantities are adjusted for thisdifference.

5.7 XECEF2GD_COMP

Scope:This MATLAB program performs the comparison between two different algorithmsimplementing the ECEF to Geodetic coordinates transformation; WGS-84 constants are used.

Usage: xecef2gd_comp

Inputs:- name of the output file if selected (the default is the screen) - input data from the keyboard as follows: - x-component of the ECEF position, in meters - y-component of the ECEF position, in meters - z-component of the ECEF position, in meters The ECEF coordinates can be entered from keyboard or from a specified file (in this case the record contains the x, y, and z components).

Page 165: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XELAZ

- Page 5-5 -

Outputs:- input/output data stored into the specified output file or displayed on screen

External Matlab macros used: tecefgd, tecefgd2, wgs84con

5.8 XELAZ

Scope:This Matlab program determines elevation and azimuth angles for specified users and aspecified time interval, for all satellites in-view, and saves into a specified file; WGS-84constants are used.

Usage: xelaz.m

Inputs:- reduced almanac data; the default is data file wk749.dat. To create an input data file each row contains the following quantities, for each satellite:

(1) satellite id, (2) time of applicability (toa), in seconds, (3) semi-major axis (a), in meters,(4) eccentricity (e), (5) inclination angle at reference time (I_0), in radians, (6) rightascension at reference time (OMEGA_0), in radians, (7) argument of perigee (omega), inradians, (8) mean anomaly at reference time (M_0), in radians, (9) rate of right ascension(OMEGA_DOT), in radians/second

- geographic location(s) for the test; the default is data file xelaz1.dat. The data can be entered from a selected input file or from keyboard by specifying latitude in radians, longitude in radians, and altitude above the ellipsoid in meters- elevation mask angle limit; the default value is 5. degrees- GPS time of week (simulation time); the default value is 0.- time step; the default value is 120 seconds- number of time samples; the default value is 360- name of the output file; the default is xelaz1.out- other parameters are initialized by default

Outputs:- file containing for each time step and for each visible satellite the following (the default file is xelaz1.out): 1) time step number, 2) user's position index, 3) number of visible satellites, 4) id of visible satellite, 5) elevation angle (radians), 6) azimuth angle (radians). The output file can be used as input file for the program xpgelaz.m, which executes plots related to above-listed quantities.

Remarks:If the structures of the input/output datafiles are changed then the statements related toreading and/or writing should also be changed.

External Matlab modules used: elevaz, svpalm, tecefgd, tgdecef, vecefenu, wgs84con

Page 166: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XELIMRC, XFDNT

- Page 5-6 -

5.9 XELIMRC

Scope:This MATLAB program tests the modules elimrow and elimcol.

Usage: xelimrc

Inputs:- number of rows of the input matrix- number of columns of the input matrix

Outputs:- the resultant matrices after the elimination of rows/columns are displayed on the screen

External Matlab modules used: elimcol, elimrow

5.10 XFDNT

Scope:This MATLAB program determines the fault detection normalized thresholds used in theReceiver Autonomous Integrity Monitoring (RAIM), for a specified input data set.

Usage: xfdnt

Inputs:- input data for probability of false alarm; a default value (of 3.33333e-7) can be selected- name of the output file (optional); the default is the screen

Outputs:- values of the selected input data- computed fault detection normalized thresholds (for each degree of freedom, from 1 to 16)

Remark:1) For the first degree of freedom case a Gaussian distribution is assumed, while for higher

degree of freedom cases a Chi-square distribution are assumed.2) For the RAIM with constant false alarm thresholds [7], the un-normalized test statistic

thresholds can be determined as follows:test statistic thresholds = (normalized threshold) * (standard deviation of

the measurements error).

References: [7], [27]

External Matlab macros used: chi2_dof, fdnt, gauss_1

Page 167: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XFOM, XGCDR

- Page 5-7 -

5.11 XFOM

Scope:This MATLAB program plots the figure of merit value versus the estimated position error.

Usage: xfom

Inputs:- selection of the range of estimated position error; the default is 1 to 6000 meters

Outputs:- plot of the figure of merit (based on ICD-059 table versus) versus estimated position error

External Matlab macros used: fom

5.12 XGCDR

Scope:This MATLAB program determines great circle dead reckoning trajectory assuming aspherical earth with radius equal to the local radius and constant altitude; WGS-84 constantsare used.

Usage: xgcdr

Inputs:Selection of the default input data or enter the following input data from keyboard:- initial latitude, in radians- initial longitude, in radians- altitude, in meters- heading, in radians- speed, in meters/second- initial time, in seconds- time step, in seconds- number of steps- selection of the output data file or exit the results on screen, - selection of the plot option

Outputs:- the recorded output data (at each time step) are as follows: - time, in seconds, - latitude, in radians, - longitude, in radians, - altitude, in meters, - velocity north component, in meters/second, - velocity east component, in meters/second

Page 168: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XGCNAC, XGDOPV

- Page 5-8 -

on a specified file or on screen - plot of the generated longitude-latitude trajectory (optional)

External Matlab macros used: convcon, geodes, wgs84con

5.13 XGCNAV

Scope:This MATLAB program determines great circle navigation position velocity, and accelera-tion when the ECEF initial position and velocity are specified; WGS-84 constants are used.

Usage: xgcnav

Inputs:Selection of the default input data or enter the following input data from keyboard:- initial ECEF x-component position, in meters,- initial ECEF y-component position, in meters,- initial ECEF z-component position, in meters,- initial ECEF x-component velocity, in meters/second,- initial ECEF y-component velocity, in meters/second,- initial ECEF z-component velocity, in meters/second,- time step, in seconds,- number of steps- selection of the output data file or exit the results on screen

Outputs:- the recorded output data (at each time step) are as follows: - time, in seconds, - ECEF position, the components in meters, - great circle velocity, the components in meters/second, - great circle acceleration, the components in meters/second^2, on a specified file or on

screen- plot of the generated ECEF trajectory in 3D and/or longitude-latitude trajectory (optional)

External Matlab macros used: gcnav, tecefgd, uverv, wgs84con

5.14 XGDOPV

Scope:This MATLAB program computes an approximate value for the geometric dilution ofprecision (GDOP) by using an approximate geometric method [18].

Page 169: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XGENRN

- Page 5-9 -

Usage: xgdopv

Inputs:- name of the output file containing the results- name of the input file containing line-of-sight unit vectors; each row contains a line-of- sight unit vector

Outputs:- input/output data stored on the selected output file or displayed on screen

Reference: [18]

External Matlab modules used: gdopv

5.15 XGENRN

Scope:This MATLAB program generates random numbers with normal (Gaussian) distribution,with mean and standard deviation specified; plots the generated sequence, histogram, and thenormalized auto-correlation sequence (optional).

Usage: xgenrn

Inputs:- number of random numbers to be generated (nstep)- mean of random numbers to be generated- standard deviation of random numbers to be generated- value of the initial seed- name of the output file, if the generated data are saved

Remarks:The generation of the random number sequence is executed in one step, i.e. one call to themodule genrn.

Outputs:- random numbers sequence plot- histogram plot- plot of the normalized auto-correlation sequence (optional)

External Matlab modules used: genrn1, rms, xcorr (optional, from Signal Processing Toolbox)

Page 170: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XGEODES, XGEOIDH

- Page 5-10 -

5.16 XGEODES

Scope:This MATLAB program determines geodesic when the departure and destination points arespecified [1], [2]; WGS-84 earth model is used.

Usage: xgeodes

Inputs:- default data are given. The data are specified in the following order (each row represents a departure-destination pair): - lat1, departure point latitude, in degrees - lon1, departure point longitude, in degrees - lat2, departure point latitude, in degrees - lon2, departure point longitude, in degrees- name of the input data file (optional)- departure-destination data (optional)- name of the output file (optional)- selection of the longitude-latitude plot of the selected waypoints (optional)

Outputs:- input/output data stored on the selected output file or displayed on screen. For each pair of departure-destination point the range, departure bearing and destination bearing are determined- plot of the longitude-latitude of the specified waypoints (with geodesic distance) - optional

Remark:The program can be easily modified to input latitude/longitude data in radians or degrees/minutes/ seconds.

References: [1], [2]

External Matlab macros used: convcon, geodes, wgs84con

5.17 XGEOIDH

Scope:This MATLAB program computes the WGS-84 geoid height correction for the currentlocation specified by latitude and longitude. Optional, the worldwide WGS-84 geoid heightcorrection contour map is plotted.

Usage: xgeoidh

Inputs:- name of the output file containing the results

Page 171: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XGMP1

- Page 5-11 -

- default - WGS-84 geoid heights data file (tgeoid84.dat) - latitude in radians, - pi/2 to pi/2 - longitude in radians, 0 to 2*pi (automatically adjustable -2*pi to 4*pi) - selection of the contour map (optional)

Outputs:- input/output data stored on the selected output file or displayed on screen; geoid height correction in meters- plot of the worldwide WGS-84 geoid height correction contour map

Remark:The program can be easily modified to enter a generic geoid height correction earth modelinstead of the WGS-84 earth model (default).

Reference: [31]

External Matlab macros used: geoidh

5.18 XGMP1

Scope:This MATLAB program generates first order Gauss-Markov sequence, plots the generatedsequence, histogram, and the normalized auto-correlation sequence (optional).

Usage: xgmp1

Inputs:- number of steps in the sequence to be generated (nstep)- value of the time constant (1./beta), in seconds- standard deviation of the Gauss-Markov process (sigx)- time interval between samples (deltat), in seconds- value of the initial seed, e.g. 0- name of the output file (optional), if the generated data are saved

Outputs:- plot of the first order Gauss-Markov sequence- histogram plot- plot of the normalized auto-correlation sequence (optional)

Remark:A default set of data for beta, sigx, and deltat is provided.

External Matlab modules used: genrn2, gmp1, rms, xcorr (optional, from Signal Processing Toolbox)

Page 172: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XGMP2, XGPSLSEC

- Page 5-12 -

5.19 XGMP2

Scope:This MATLAB program generates second order Gauss-Markov sequence, plots the generatedsequence and determines and plots the normalized auto-correlation sequence.

Usage: xgmp2

Inputs:- number of steps in the sequence to be generated (nstep)- the value of the natural frequency in radians/second- the value of the damping factor (less than 1.)- the value of the constant c**2 in meters**2- the value of the time step in seconds- name of the output file, if the generated data are saved

Outputs:- plot of the second order Gauss-Markov sequence - first state component- plot of the normalized auto-correlation sequence - first state component- plot of the second order Gauss-Markov sequence - second state component- plot of the normalized auto-correlation sequence - second state component

Remark:A default set of input data is provided.

External Matlab modules used: genrn2, gmp2, rms, xcorr (optional, from Signal Processing Toolbox)

5.20 XGPSLSEC

Scope:This MATLAB program determines the UTC leap seconds value for a specified year between1980 and 2059; after the year 1999 the leap second value is only an estimate, and linearinterpolation between values is recommended.

Usage: xgpslsec

Inputs:- name of the output file if selected (the default is the screen)- year value (between 1980 and 2059)

Outputs:- input/output data stored into the specified output file or displayed on screen- plot of UTC leap seconds (for the period 1980-2000) versus year (optional)

Page 173: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XGPSTIME, XGRIDW

- Page 5-13 -

5.21 XGPSTIME

Scope:This MATLAB program performs the following GPS time related transformation:1) from (year, month, day) to (GPS week, GPS roll number, day of week)2) from (GPS week, day of week, GPS roll number) to (day of week, day, month, year)3) from (day of week, hour, minute, second) to (time of week)4) from (time of week) to (day of week, hour, minute, second)

Usage: xgpstime

Inputs:- name of the output file if selected (the default is the screen) 1) For the (year, month, day) to (GPS week, GPS roll number, day of week): - year (1980 and greater) - month (1 to 12) - day (1 to 31) 2) For the (GPS week, day of week, GPS roll number) to (day of week, day, month, year): - GPS week (0 to 1023) - day of week (0 to 6) - GPS roll number (0 to ...)3) For the (day of week, hour, minute, second) to (time of week): - day of week (0 to 6) - hour (0 to 23) - minute (0 to 59) - second (0 to 60) 4) For the (time of week) to (day of week, hour, minute, second):- time of week (0 to 604800)

Outputs:- input/output data stored into the specified output file or displayed on screen

5.22 XGRIDW

Scope:This MATLAB program generates and plots the longitude-latitude WAAS grid as specifiedin [30].

Usage: xgridw

Inputs:- selection of option to save the generated data; the mat-file fgridw.mat is the output file

Outputs:

Page 174: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XHMATALL, XHPE

- Page 5-14 -

- generated latitude-longitude WAAS grid data into the specified mat-file (optional)- graph of the latitude-longitude WAAS grid (2353 space points)

Reference: [30]

External Matlab macros used: gridwaas

5.23 XHMATALL

Scope:This Matlab program tests the construction of the H matrix (based on line-of-sight, baro andclock measurements). The following macros are tested: hmat, hmatb, hmatc and hmatbc.

Usage: xhmatall

Inputs:- name of the input file containing ECEF satellite position- name of the input file containing ECEF user position- name of the output file, if the selection to store the data is made

Outputs:- results stored into the output file or displayed on screen

Remark:At least 4 measurements are required for the construction of H matrix.

External Matlab macros used: hmat, hmatb, hmatc, hmatbc.

5.24 XHPE

Scope:This MATLAB program determines the horizontal position error (range) when latitude andlongitude for two points are given; WGS-84 constants are used.

Usage: xhpe

Inputs:- selection of the output data file or dispay the results on screen- input from keyboard, latitude of the first position point, in radians or degrees/minutes/ seconds- input from keyboard, longitude of the first position point, in radians or degrees/minutes/ seconds- input from keyboard, latitude of the second position point, in radians or degrees/minutes/ seconds

Page 175: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XIONOC

- Page 5-15 -

- input from keyboard, longitude of the second position point, in radians or degrees/minutes/ seconds

Outputs:- save on a specified file or display on screen, the input data and the horizontal position

error (range) between the two defined position points

Remark:The computation accuracy is limited due to algorithm approximations; it is recommendedonly when the range is less than 100 km.

External Matlab modules used: hpe, tadmsrad, wgs84con

5.25 XIONOC

Scope:This Matlab program determines iono corrections for a specified satellite, time interval, and aselected location by using the Klobuchar model; several representative plots are available.WGS-84 constants are used.

Usage: xionoc

Inputs:- name of the input almanac data file; the default is data file wk749.dat. Each record contains the data related to a specific satellite in the following order: 1) satellite id, 2) satellite time of applicability (toa), in seconds, 3) satellite semi-major axis (a), in meters, 4) satellite eccentricity (e), 5) satellite orbital inclination (I_0), in radians, 6) satellite right ascension at toa (OMEGA_0), in radians, 7) satellite argument of perigee (omega), in radians, 8) satellite mean anomaly (M_0), in radians, 9) satellite rate of right ascension (OMEGA_DOT), radians/second- geographic location for the test (latitude in degrees, longitude in degrees, altitude in meters); the default is data file locat1.dat- elevation angle limit; the default value is 5 degrees- initial simulation time (GPS time of week), in seconds; the default value is 0.- number of time samples and time step value (if more than one time step); the default values are 1 and 300, respectively,- name of the output file (optional); the default name is xionoc1.out- other parameters are initialized by default

Outputs:- iono correction data into a specified file (optional); each record contains iono correction

Page 176: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XKFCOV

- Page 5-16 -

data for all satellites at a time sample (the value 0. is recorded when the satellite is not visible)- plot of number of visible satellites versus time sample number, when time sample number is greater than 1- 3-D plot of iono correction versus time sample number and satellite id, when time sample number is greater than 1- plot of iono correction versus satellite id for a selected time sample number- plot of iono correction versus time number for a selected satellite, when time sample number is greater than 1

References: [25], [29]

External Matlab macros used: eleva, ionoc, ionocon, svpalm, tecefgd, tgdecef, uverv,vecefenu, wgs84con

5.26 XKFCOV

Scope:This MATLAB program performs covariance analysis by using the conventional or alternateconventional Kalman filter formulation.

Usage: xkfcov

Inputs:- number of steps to be processed (nstep)- selection of the variant to be used- selection of the input data from a selected input data file or the default input data set. The structure of the input file is as follows: -- first row contains the values for state dimension (n) and measurement dimension (m) -- next n rows contain the corresponding rows of the transition matrix (phi) -- next n rows contain the corresponding rows of the process noise matrix (q) -- next m rows contain the corresponding rows of the observation matrix (h) -- next m rows contain the corresponding rows of the measurement noise matrix (r)

-- next n rows contain the corresponding rows of the initial covariance matrix (depending on the variant used)

- index of the state covariance to be saved or/and plotted - name of the output file, if the generated data are saved

Outputs:- output file containing the generated data (optional). At each time step the following data are stored: step number, standard deviation after and before measurement incorporation- plot of the selected state standard deviation versus time sequence

External Matlab macros used: kfcov, kfcova

Page 177: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XMAPDOP

- Page 5-17 -

5.27 XMAPDOP

Scope:This Matlab program determines repartition of the number of visible satellites and thecorresponding DOPs for a specified geographical area.

Usage: xmapdop

Inputs:- name of the input almanac data file; the default is data file wk749.dat. Each record contains the data related to a satellite in the following order: 1) satellite id, 2) satellite time of applicability (toa), in seconds, 3) satellite semi-major axis (a), in meters, 4) satellite eccentricity (e), 5) satellite orbital inclination (I_0), in radians, 6) satellite right ascension at toa (OMEGA_0), in radians, 7) satellite argument of perigee (omega), in radians, 8) satellite mean anomaly (M_0), in radians, 9) satellite rate of right ascension (OMEGA_DOT), radians/second- geographic locations for the test; the default is data file map01.dat. The first record of the file should contain the latitude limits while the second record should contain the longitude limits, both in degrees- elevation angle limit; the default value is 5 degrees- simulation time (GPS time of week), in seconds; the default value is 0.- selection of xdop to be plotted- number of time samples and time step value, in seconds (if more than one time step is selected)- name of the output file for satellite visibility statistics (optional)- other parameters are initialized by default; the default latitude-longitude grid is 25 by 41 (default)

Outputs:- plot presenting selected dop value and/or number of visible satellites versus latitude- longitude location- table containing test summary and satellite visibility statistics (optional)

Remark:If more than one step then only the results from the last time sample are plotted.

External Matlab macros used: dop1, eleva, svpalm, tgdecef, uverv, vecefenu,wgs84con, and world map data file worldmap.mat (optional)

Page 178: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XMISDAT, XMPATH

- Page 5-18 -

5.28 XMISDAT

Scope:Determine the missing data into a specified column of an input table, when the expectedincrement between two consecutive data is given.

Usage: xmisdat

Inputs:- selection of the input data file (with extension), e.g. xmisdat1.dat- selection of the column number to be analyzed, e.g. 3- selection the increment value between two consecutive data, e.g. 0.1

Outputs:- the following output data are listed for the selected column of the specified data table: first record value, last record value, maximum number of records, number of missing records, and specific missing values.

5.29 XMPATH

Scope:This MATLAB program generates and saves the multipath pseudorange errors for a specifiednumber of satellites and time steps.

Usage: xmpath

Inputs:From keyboard the user should enter the following data:- maximum number of satellites used, nrsv (default is 12)- number of time steps to be generated, nrstep (default is 1800)- random number seed value (default is 0)- selection of the storage data file -- mpfile.mat -- selected name for ASCII data file -- none, no storage (default)- selection of multipath plots from generated data- satellite(s) number for which the generated data is plotted- application specific parameters are initialized by default (see sigma, order and wn) and time step is 1 second

Outputs:- output file storing the generated multipath pseudorange errors, mat-file pfile.mat or defined

ASCII data file; the output array has nrstep rows and nrsv columns, each row containsmultipath data for a specific time step and all selected satellites

Page 179: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XMTRANSF

- Page 5-19 -

- plot of multipath pseudorange errors versus time step, for specified satellites

Reference: [28]

External Matlab macros used: rms

5.30 XMTRANSF

Scope:This MATLAB program constructs the following coordinate transformation matrices: 1) from ECEF to ENU coordinates 2) from ENU to ECEF coordinates 3) from ECEF to LLWA coordinates 4) from LLWA to ECEF coordinates 5) from ECEF to INS coordinates 6) from INS to ECEF coordinates 7) from ENU to LLWA coordinates 8) from LLWA to ENU coordinates 9) from LLWA to GPS body coordinates10) from GPS body to LLWA coordinates11) from ECEF to ECI coordinates12) from ECI to ECEF coordinates

Usage: xmtransf

Inputs:- name of the output file if selected (the default is the screen)1) For the ECEF/ENU to ENU/ECEF transformation: - latitude, in radians - latitude, in radians2) For the ECEF/LLWA to LLWA/ECEF transformation: - latitude, in radians - longitude, in radians - wander azimuth angle, in radians3) For the ECEF/INS to INS/ECEF transformation: - latitude, in radians - longitude, in radians - wander azimuth angle, in radians4) For the ENU/LLWA to LLWA/ENU transformation: - wander azimuth angle, in radians5) For the LLWA/GPS Body to GPS Body/LLWA transformation: - yaw angle, in radians - pitch angle, in radians - roll angle, in radians

Page 180: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XMUDDU, XMUDM

- Page 5-20 -

6) For the ECEF/ECI to ECI/ECEF transformation:- time elapsed since reference time, in seconds

Outputs:- input/output data stored into the specified output file or displayed on screen

External Matlab modules used: mecefenu, menuecef, mecefllw, mllwecef, mecefins, minsecef, menullw, mllwenu, mllwb, mbllw, mecefeci, meciecef, wgs84con

5.31 XMUDDU

Scope:This MATLAB program executes the decomposition and reconstruction of a real symmetricpositive (semi)definite matrix into and from its U-D factors.

Usage: xmuddu

Inputs:- name of the output file if selected; the default is the screen- dimension of state vector n, n ≥ 2- elements of the input matrix A, real array of length n*(n+1)/2, only the upper triangular part, columnwise, is stored- computation accuracy (tolerance), selected default is machine dependent accuracy eps

Outputs:- input/output data stored into the specified output file or displayed on screen

External Matlab modules used: mudd, msc2f, mudc2f, mcud

5.32 XMUDM

Scope:This MATLAB program tests the macros: mudm, mudm1 and mreast, the implementation ofthe discrete Kalman filter measurement updating using Bierman's U-D measurement updatealgorithm. Only a scalar measurement is processed, and the U-D covariance factors and thestate estimate (optional) are updated. The macro mudm has the scalar measurement as aninput, while the macro mudm1 has the measurement residual as an input. The macro mreastexecutes the measurement reasonableness test for a specific measurement.

Usage: xmudm

Inputs:- name of the output file if selected; the default is the screen- dimension of state vector n, n ≥ 2

Page 181: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XOPCR

- Page 5-21 -

- elements of the U-D factors, ud, real array of length (n+1)*(n+2)/2. The first n*(n+1)/2 elements store the input/output U-D factors; the D elements are stored on diagonal. The last n+1 elements store the input/output state vector x and the scalar value z- h**(transpose)*x(a priori) in ud((n+1)*(n+2)/2). If index = 0 then the state x (and z) need not be included and the dimension of the array should be n*(n+1)/2.- measurement variance, r- vector of measurement coefficients (first n elements) and h(n+1) = z if index = 0. If index = 0 the dimension of the array h should be n.- index of updating type = 0 then only the U-D factors are updated (the state is not updated) ≠ 0 then the U-D factors and state are updated- reasonableness test threshold

Outputs:- input/output data stored into the specified output file or displayed on screen The output data are as follows: - for the computation executed by using macro mreast - a pass/fail test message - for the computation executed by using macro mudm - UD matrix (output) - state vector (output), optional - for the computation executed by using macro mudm1 - UD matrix (output) - state vector (output), optional

External Matlab modules used: mreast, mudc2f, mudm, mudm1

5.33 XOPCR

Scope:This program determines operation counts (flops) for four different implementations ofRAIM algorithm (only the computation of the. decision variable for the RAIM algorithmproposed by Sturza [22]).

Usage: xopcr

Inputs:- name of the input file containing line-of-sight unit vectors, each vector is stored in another

row (it should be 3 columns)- name of the output file containing the results

Outputs:- table containing the computed operation counts (flops) for all four implementations

Page 182: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XPBAR, XPBIAS

- Page 5-22 -

References: [10], [22]

5.34 XPBAR

Scope:This MATLAB program plots a bar graph for a selected column from an ASCII data fileagainst the selected x-axis column from the same ASCII file; manual scaling is available. Inaddition, the selected bar graph can incorporate statistics, i.e. mean, standard deviation androot mean square (rms).

Usage: xpbar

Inputs:- name of the ASCII input data file,- selected x-axis column index, - column number to be bar-plotted, - title of the plot, - y-axis label, - x-axis label,- optional, new axes limits [xmin xmax ymin ymax].

Outputs:- selected bar-graph

Remarks:The user can select the x-axis column; the other columns are used for y-axis coordinates.Each y column data (when selected) is independently bar-plotted against x column data.The computed/listed statistics is for the selected range of the specified bar-graph.

External Matlab modules used: rms

5.35 XPBIAS

Scope:This MATLAB program computes the value of the parity bias (pbiasb); for the 5 satellitescase the Gaussian distribution is used, while for 6 up to 14 satellites case the Chi-squaredistribution is used [26].

Usage: xpbias

Inputs:- probability of missed detection (pmd)- td_table, table containing fault detection normalized thresholds td for degree-of-freedom (dof) 1 to 10 and the corresponding probability of false alarm (pfa); a default table is given

Page 183: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XPELAZA

- Page 5-23 -

for pfa = 3.3333e-7- for degree-of-freedom = 1 (Gausssian ditribution) --> initial guess for pbiasb for degree-of-freedom >= 2 (Chi-square distribution) --> initial guess for lambda

Outputs:- input data (normalized thresholds, pfa and pmd) for dof 1 to 10- parity bias (pbiasb) for a specified set of input data for dof 1 to 10

Remark:1) Table td_table can be generated by using the program XFDNT.m.2) The parity bias values can be used in the computation of horizontal protection limit, and fault detection availability in the case of RAIM with constant false alarm

Reference: [26]

External Matlab macros used: fbias_c.m, fbias_g.m, ncchi2_2.m, ncchi2_3.m, ncchi2_4.m, ncchi2_5.m , ncchi2_6.m, ncchi2_7.m, ncchi2_8.m ncchi2_9.m, ncchi2_10.m

5.36 XPELAZA

Scope:This Matlab program executes the plots of azimuth-elevation and number of visible satellitesfor a specified user's position, almanac and time interval, for all satellites in-view; WGS-84constants are used.

Usage: xpelaza

Inputs:- reduced almanac data; the default is data file wk749.dat. To create an input data file each row contains the following quantities, for each satellite: 1) satellite id, 2) time of applicability (toa), in seconds, 3) semi-major axis (a), in meters, 4) eccentricity (e), 5) inclination angle at reference time (I_0), in radians, 6) right ascension at reference time (OMEGA_0), in radians, 7) argument of perigee (omega), in radians 8) mean anomaly at reference time (M_0), in radians, 9) rate of right ascension (OMEGA_DOT), in radians/ second- geographic location(s) for the test; the default is data file xelaz1.dat. The data can be entered from a selected input file or from keyboard by specifying latitude in radians, longitude in radians, and altitude above the ellipsoid in meters- elevation mask angle limit; the default value is 5. degrees- simulation time (GPS time of week); the default value is 0.- time step; the default value is 120 seconds- number of time samples; the default value is 60

Page 184: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XPELAZS

- Page 5-24 -

- name of the output file; the default is xelaz1.out- other parameters are initialized by default

Outputs:- azimuth-elevation plot, for all satellites in view, and for selected- number of visible satellites plot

External Matlab macros used: elevaz, svpalm, tecefgd, tgdecef, vecefenu, wgs84con

5.37 XPELAZS

Scope:This MATLAB program plots graphs related to the number of visible satellites, elevation andazimuth angles, and azimuth-elevation configuration for a specified satellite and selecteduser; the input file can be generated by the program xelaz.m.

Usage: xpelazs

Inputs:- name of the input file; the default is xpgelaz1.dat (i.e. xelaz1.out generated by the program xelaza.m). The file contains for each time step and for each visible satellite the following:

1)time step number, 2) user's position index, 3) number of visible satellites, 4) id of visiblesatellite, 5) elevation angle, 6) azimuth angle

- selected time steps in seconds (see also program xelaza.m) - from keyboard; the default is 120 seconds- selected satellite index to be analyzed - from keyboard- selected user's location index to be analyzed - from keyboard- selected graph type (from the menu) for a selected satellite and specified user, namely: 1) number of visible satellites versus Time, 2) elevation angle versus Time, 3) azimuth angle versus time, 4) elevation and azimuth angles versus Time, 5) elevation versus azimuth (polar plot)

Outputs:- selected graphs

Remarks:For a specific interval, manual scaling and statistics are available by using several otherprograms, for example xyp1s.

External Matlab macros used: selectd

Page 185: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XPFWLS

- Page 5-25 -

5.38 XPFWLS

Scope:This Matlab program determines position fix using weighted least squares algorithm; thehorizontal position error can be plotted and/or recorded into a specified output file. It isassumed that the user is stationary and the pseudorange error at each time step are randomlygenerated. WGS-84 constants are used.

Usage: xpfwls

Inputs:- name of the input almanac data file; the default is data file wk749.dat. Each record contains the nine data related to a satellite in the following order: 1) satellite id, 2) satellite time of applicability (toa), in seconds, 3) satellite semi-major axis (a), in meters, 4) satellite eccentricity (e), 5) satellite orbital inclination (I_0), in radians, 6) satellite right ascension at toa (OMEGA_0), in radians, 7) satellite argument of perigee (omega), in radians, 8) satellite mean anomaly (M_0), in radians, 9) satellite rate of right ascension (OMEGA_DOT), radians/second- user's true position (latitude, longitude and altitude) entered from keyboard or a specified data file -- elevation angle limit in degrees; the default is 5. degrees

-- selection of the measurement error standard deviation; the default is 33.3 meters for SPS with SA on and 6.5 meters for SPS with SA off; at the same time specific uniformly distributed weighted factors are selected for up to 33 satellite measurements

-- initial simulation time (GPS time of week); the default value is 0. -- number of time steps -- time step, in seconds -- name of the output file (optional) -- selection of the graph- other parameters are initialized by default (for example, weighting factors)

Outputs:- file containing data for each time step (time step number, time, number of visible satellites, horizontal position error, 3-component position error in ENU frame) (see file pf2)- graph of horizontal (East-North) position error- graph of East/North/Up position error versus time step- graph of magnitudes of horizontal/vertival/3-dimensional position error versus time step

Remark:The program can be modified to have a selection of weighting factors instead of using thedefault values.

Page 186: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XPPVA, XPPVAJ

- Page 5-26 -

External Matlab macros used: convcon, eleva, genrn, svpalm, uverv, vecefenu, wgs84con

5.39 XPPVA

Scope:This MATLAB program determines acceleration from the input data of time, position andvelocity, and plots all relevant trajectory information.

Usage: xppva

Inputs:- selection of the (1) default data file(s) or (2) user's defined data file. Each record of the ASCII input data file contains the following data: -- time, in seconds -- latitude, in radians -- longitude, in radians -- altitude, in meters -- East velocity component, in meters/second -- North velocity component, in meters/second -- Up velocity component, in meters/second- name of the scenario/trajectory, e.g. Low/Medium/High Dynamics

Outputs:- the following plots are executed -- plot 1 - trajectory latitude/longitude/altitude versus time -- plot 2 - trajectory latitude versus longitude -- plot 3 - trajectory East/North/Up velocity versus time -- plot 4 - trajectory East/North/Up acceleration versus time -- plot 5 - trajectory velocity/acceleration magnitude versus time

5.40 XPPVAJ

Scope:This MATLAB program determines acceleration and jerk from the input data of time,position and velocity, and plots all relevant trajectory information.

Usage: xppvaj

Inputs:- name of the ASCII input data file, Each record of the ASCII input data file contains the following data: -- time, in seconds -- latitude, in radians

Page 187: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XPRADR

- Page 5-27 -

-- longitude, in radians -- altitude, in meters -- East velocity component, in meters/second -- North velocity component, in meters/second -- Up velocity component, in meters/second- name of the scenario/trajectory, e.g. Low/Medium/High Dynamics

Outputs:- the following plots are executed -- plot 1 - trajectory latitude/longitude/altitude versus time -- plot 2 - trajectory latitude versus longitude -- plot 3 - trajectory East/North/Up velocity versus time -- plot 4 - trajectory East/North/Up acceleration versus time -- plot 5 - trajectory East/North/Up jerk versus time -- plot 6 - trajectory velocity/acceleration magnitude versus time

5.41 XPRADR

Scope:This Matlab program determines pseudorange and accumulated delta range for a specifiedsatellite. WGS-84 constants are used.

Usage: xpradr

Inputs:- name of the input almanac data file; the default is data file wk749.dat. Each record contains the eight data related to a satellite in the following order: (1) satellite id, (2) satellite time of applicability (toa), in seconds, (3) satellite semi-major axis (a), in meters, (4) satellite eccentricity (e), (5) satellite orbital inclination (I_0), in radians, (6) satellite right ascension at toa (OMEGA_0), in radians, (7) satellite argument of perigee (omega), in radians, (8) satellite mean anomaly (M_0), in radians, (9) satellite rate of right ascension (OMEGA_DOT), radians/second- geographic location for the test (latitude in degrees, longitude in degrees, altitude in meters); the default is data file locat1.dat- elevation angle limit; the default value is 5 degrees- initial simulation time (GPS time of week), in seconds; the default value is 0.- number of time samples and time step value (if more than one time step); the default values are 1 and 300, respectively,- selection of value for model flags as follows flags(1) - iono error flag (0 value means iono is not used) flags(2) - tropo error flag (0 value means tropo is not used)

Page 188: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XPTRANSF

- Page 5-28 -

flags(3) - SA error flag (0 value means SA error is not used) flags(4) - multipath flag (0 value means multipath is not used) flags(5) - user clock bias flag (0 value means clock bias is not used) flags(6) - earth rotation error flag (0 value means it is not used) flags(7) - pseudorange noise flag (0 value means it is not used) flags(8) - carrier phase flag (0 value means is not generated) flags(9) - delta range noise flag (0 value means is not used)- selection of a satellite index to be plotted (pseudorange and accumulated delta range)- other parameters are initialized by defaultNote that some data are transmitted to the module pradr by globals.

Outputs:- plots of number of visible satellites and repartition of visible satellites versus time sample number,- plot of all pseudoranges versus time sample number- plot of all accumulated delta ranges versus time sample number- plot of pseudorange and accumulated delta range for a selected satellite

References: [25], [29]

External Matlab macros used: eleva, ionoc, ionocon, svpalm, tecefgd, tgdecef, uverv,vecefenu, wgs84con,

5.42 XPTRANSF

Scope:This MATLAB program performs the following coordinate transformations:1) from ECEF to Geodetic coordinates2) from Geodetic to ECEF coordinatesWGS-84 constants are used.

Usage: xptransf

Inputs:- name of the output file if selected (the default is the screen)- input data from keyboard as follows:1) For the ECEF to Geodetic transformation: - x-component of the ECEF position, in meters - y-component of the ECEF position, in meters - z-component of the ECEF position, in meters The ECEF coordinates can be entered from keyboard or from a specified file (in this case each row/record contains the x, y, and z components)2) For the Geodetic to ECEF transformation: - latitude of the position, in radians or degrees/minutes/seconds - longitude of the position, in radians or degrees/minutes/seconds - altitude (above ellipsoid) of the position, in meters

Page 189: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XQRUPA, XRAIMDA

- Page 5-29 -

The Geodetic coordinates can be entered from keyboard or from a specified file (in this caseeach row/record contains the latitude, longitude and altitude of a specific point) with 3 or 7columns when latitude/longitude is entered in radians or in degrees/minutes/seconds,respectively.

Outputs:- input/output data stored into the specified output file or displayed on screen

External Matlab modules used: tadmsrad, taraddms, tecefgd2, tgdecef, wgs84con

5.43 XQRUPA

Scope:This MATLAB program tests the updating algorithm for Q-R factorization of the modifiedmeasurement matrix when a new clock measurement is added.

Usage: xqrupa

Inputs:- name of the output file if selected; the default is the screen- line-of-sight for the satellites used, entered from a specified file or the specified default values- ratio between pseudorange measurements standard deviation and clock standard deviation (denoted by alpha), entered from a specified file or the specified default values

Outputs:- input/output data stored into the specified output file or displayed on screen; operation count summary for two methods (direct Q-R re-factorization and updating Q-R factoriza- tion) is included

Reference: [10]

External Matlab modules used: qrupa

5.44 XRAIMDA

Scope:This Matlab program determines the Receiver Autonomous Integrity Monitoring (RAIM)fault detection availability based on a constant false alarm rate algorithm [1], [7]. WGS-84constants are used.

Usage: xraimda

Inputs:- almanac data; the default file is svprime.dat. Each record contains the nine data related

Page 190: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XRAIMDA

- Page 5-30 -

to a satellite in the following order: 1) satellite id, 2) satellite time of applicability (toa), in seconds, 3) satellite semi-major axis (a), in meters, 4) satellite eccentricity (e), 5) satellite orbital inclination (I_0), in radians, 6) satellite right ascension at toa (OMEGA_0), in radians, 7) satellite argument of perigee (omega), in radians, 8) satellite mean anomaly (M_0), in radians, 9) satellite rate of right ascension (OMEGA_DOT), radians/second- geographic locations for the test; the default is data file mops24.dat. Each record contains the data related to a location in the following order: latitude (degrees), longitude (degrees), altitude (meters)- elevation mask angle limit in degrees; the default is 5. degrees- GPS receiver type: Standard Position System (SPS) with SA on, SPS without SA, or user's selected standard deviation of measurement error, in meters- phase-of-flight (Non-Precision Approach, Terminal, En-Route, Oceanic and user defined HAL)- probability of false alarm, probability of missed detection, and the corresponding pbias thresholds; default values are provided- initial simulation time (GPS time of week); the default value is 0.- number of time steps; default value is 48 [1]- time increment, in seconds; default value is 1800 [1]- name of the statistics output file, the default is the screen- name of the output file containing unavailable cases (optional)- selection of the bar graph of visible satellites (optional)- selection of the histogram plot of horizontal protection level (HPL) repartition (optional)- other parameters are initialized by default

Outputs:- table containing RAIM fault detection availability test summary and satellite visibility statistics (see file pf1 or on sceen)- file containing data for RAIM unavailable cases (time, location, number of visible satellites, critical satellite index, horizontal protection level and horizontal alarm limit) (see file pf2)- bar graph presenting repartition of visible satellites (optional)- histogram plot presenting repartition of horizontal protection level for all available cases (optional)

References: [1], [7], [26]

External Matlab macros used: eleva, svpalm, tgdecef, uverv, vecefenu, wgs84con

Page 191: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XRAIMEA

- Page 5-31 -

5.45 XRAIMEA

Scope:This Matlab program determines the Receiver Autonomous Integrity Monitoring (RAIM)fault exclusion availability based on a constant false alarm rate algorithm [1], [7]. WGS-84constants are used.

Usage: xraimea

Inputs:- almanac data; the default is data file svprime.dat. Each record contains the nine data related

to a satellite in the following order: 1) satellite id, 2) satellite time of applicability (toa), in seconds, 3) satellite semi-major axis (a), in meters, 4) satellite eccentricity (e), 5) satellite orbital inclination (I_0), in radians, 6) satellite right ascension at toa (OMEGA_0), in radians, 7) satellite argument of perigee (omega), in radians, 8) satellite mean anomaly (M_0), in radians, 9) satellite rate of right ascension (OMEGA_DOT), radians/second- geographic locations for the test; the default is data file mops24.dat. Each record contains the data related to a location in the following order: latitude (degrees), longitude (degrees), altitude (meters)- elevation mask angle limit in degrees; the default is 5. degrees- GPS receiver type: Standard Position System (SPS) with SA on, SPS without SA, or user's selected standard deviation of measurement error, in meters- phase-of-flight (Non-Precision Approach, Terminal, En-Route, Oceanic and user defined HAL)- probability of false alarm, probability of missed detection, and the corresponding pbias thresholds; default values are provided- initial simulation time (GPS time of week); the default value is 0.- number of time steps; default value is 48 [1]- time increment, in seconds; default value is 1800 [1]- name of the statistics output file, the default is the screen- name of the output file containing unavailable cases (optional)- selection of the bar graph of visible satellites (optional)- selection of the histogram plot of horizontal exclusion level (HEL) repartition (optional)- other parameters are initialized by default

Outputs:- table containing RAIM fault exclusion availability test summary and satellite visibility statistics (see file pf1 or on screen)- file containing data for RAIM unavailable cases (time, location, number of visible satellites, critical satellite index, horizontal protection level and horizontal alarm limit) (see file pf2)

Page 192: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XRAIMFD, XRAIMST

- Page 5-32 -

- bar graph presenting repartition of visible satellites (optional)- histogram plot presenting repartition of horizontal exclusion level of all available cases (optional)

References: [1], [7], [26]

External Matlab macros used: eleva, elimcol, svpalm, tgdecef, uverv, vecefenu, wgs84con

5.46 XRAIMFD

Scope:This MATLAB program implements the fault detection algorithm for the ReceiverAutonomous Integrity Monitoring (RAIM), for a specified set of input data.

Usage : xraimfd

Inputs :- name of the data file containing line-of-sight unit vectors, each vector is stored in another row (it should be 3 columns); a set of default values is specified- number of steps to be executed; the default is 1- number of measurements for each step; the default is 7- name of the output file (optional); the default is the screenNote: Values for probability of false alarm, probability of missed detection and standarddeviation of measurement noise are automatically selected.

Outputs:- values of the selected input data set- status of the output flags (false alarm, true alarm, missed detection, normal operation and unavailable) for each step

Reference: [23]

External Matlab modules used : raimfd

5.47 XRAIMST

Scope:This MATLAB program determines availability and failure flags for the ReceiverAutonomous Integrity Monitoring (RAIM) baseline standard algorithm (constant alarm ratealgorithm) [7] for a specified set of input data.

Usage: xraimst

Page 193: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XREADALM

- Page 5-33 -

Inputs:- name of the data file containing line-of-sight unit vectors, each vector is stored in another row (it should be 3 columns); a set of default values is specified- name of the data file containing errors in true ranges; a set of default values is specified- name of the output file (optional); the default is the screenNote: Values for threshold and approximate radial error protected ceiling are automatical-lyselected.

Outputs:- alues of the selected input data set- status of the availability flag and the test statistic / failure flag

References: [1], [7]

External Matlab modules used: raimst

5.48 XREADALM

Scope:This MATLAB program reads almanac data from a Yuma format input file and stores thedata into an ASCII data file (each record contains the data related to a satellite); a reducedalmanac data set is stored into another file.

Usage: xreadalm

Inputs:- name of the Yuma format almanac input data file- name of the output data files (for the complete almanac and the reduced almanac used by the module svpalm.m)

Outputs:- almanac data into the specified output files. For the complete almanac data each record contains the data related to a satellite in the following order: (1) satellite id number (2) satellite health (3) satellite eccentricity (e) (4) satellite time of applicability (toa), in seconds (5) satellite orbital inclination (I_0), in radians (6) satellite rate of right ascension (OMEGA_DOT), radians/second (7) satellite square root of semi-major axis (sqrt(a)), in meters^1/2 (8) satellite right ascension at toa (OMEGA_0), in radians (9) satellite argument of perigee (omega), in radians (10) satellite mean anomaly (M_0), in radians (11) satellite af0, in seconds

Page 194: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XRINEXN

- Page 5-34 -

(13) satellite af1, in second/second (14) satellite week For the reduced almanac data each record contains the data related to a healthy satellite in the following order: (1) satellite id number

(2) satellite time of applicability (toa), in seconds(3) satellite semi-major axis (a), in meters(4) satellite eccentricity (e)

(5) satellite orbital inclination (I_0), in radians (6) satellite right ascension at toa (OMEGA_0), in radians (7) satellite argument of perigee (omega), in radians (8) satellite mean anomaly (M_0), in radians

(9) satellite rate of right ascension (OMEGA_DOT), radians/second number of satellites read (on screen)

5.49 XRINEXN

Scope:This Matlab program reads a RINEX 2 navigation message file and writes the data into threefiles; one output file contains the complete navigation information, while the other outputfiles contain the reduced ephemeris and almanac data.

Usage: xrinexn

Inputs:- name of the ephemeris data file, RINEX 2 navigation message file- name of the output file containing all navigation data information- name of the output file containing reduced ephemeris data- name of the output file containing reduced almanac data

Outputs:- file containing all navigation data information; each record includes the data in the same order as the input file- file containing the reduced ephemeris data; each record includes the following data: svprn, toe, smaxis, ecc, i0, Omega0, omega, M0, Omegadot, deltan, idot, cic, cis, crc, crs, cuc, cus- file containing the reduced almanac data; each record includes the following data: svprn, toe, smaxis, ecc, i0, Omega0, omega, M0, Omegadot

Remark:The reduced ephemeris and almanac data files can be used by macros svpeph and svpalm,respectively; both files contain data only for healthy satellites.

Page 195: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XRWALK, XSAERR

- Page 5-35 -

5.50 XRWALK

Scope:This MATLAB program generates a random walk process, and plots the random walksequence and the normalized auto-correlation sequence (optional).

Usage: xrwalk

Inputs:- number of random number to be generated- value of the noise covariance, q*dt- name of the output file (optional), if the generated data are saved

Outputs:- plot of the random walk sequence- plot of the normalized auto-correlation sequence (optional)

External Matlab modules used: genrn, rms, rwalk, xcorr (optional, from SignalProcessing Toolbox)

5.51 XSAERR

Scope:This MATLAB program generates and saves the SA (Selective Availability) errors for aspecified number of satellites and time steps.

Usage: xsaerr

Inputs:From keyboard the user should enter the following data:- maximum number of satellites used, nrsv (default is 12)- number of time steps to be generated, nrsteps (default is 1800)- random number seed value (default is 0)- SA model data (second order Gauss-Markov process); default data is available- selection of the storage data file - safile.mat - selected name for ASCII data file - none, no storage (default)- selection of multipath plots from generated data- satellite(s) number for which the generated data is plotted- application specific parameters are initialized by default (see sigma, order and wn) and time step is 1 second

Outputs:- output file storing the SA errors, mat-file safile.mat or defined ASCII data file; the output

Page 196: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XSDOP, XSLOPE

- Page 5-36 -

array has nrsteps rows and nrsv columns, each row contains multipath data for a specific SA model and all selected satellites- plot of SA errors versus time step, for the specified satellites

References: {1], [2]

5.52 XSDOP

Scope:This MATLAB program computes sub-dilution of precision (sub-DOP) quantities, i.e. DOPquantities for all satellites subsets obtained from eliminating one satellite from the originalset.

Usage: xsdop

Inputs:- name of the output file containing the results if selected; the default in on screen- name of the input file containing line-of-sight unit vectors; each row contains a line-of- sight unit vector

Outputs:- input/output data stored on the selected output file or displayed on screen

Remark:Five or more satellites are needed for the computation of sub-DOP. The sub-HDOP is usefulin the RAIM detection process [7], [27].

References: [7], [27]

External Matlab macros used: sdop

5.53 XSLOPE

Scope:This MATLAB program determines slope_max and delta_h_max for the ReceiverAutonomous Integrity Monitoring (RAIM) baseline standard algorithm (constant alarm ratealgorithm) [7] for a specified set of input data.

Usage: xslope

Inputs:- name of the data file containing line-of-sight unit vectors, each vector is stored in another row (it should be 3 columns); set of default values is specified- name of the output file (optional); the default is the screen

Page 197: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XSORTREC, XSTAT

- Page 5-37 -

Outputs:- values of the selected input data set- computed slope_max and delta_h_max- computed error = (slope_max - delta_h_max * sqrt(number of measurements - 4))

Remark:The following related formula may be used

slopemax = delta_h_max * sqrt(number of measurements - 4)

References: [7], [27]

External Matlab macros used:dhmax, slopemax

5.54 XSORTREC

Scope:This MATLAB program reads a data file (each row is a record), sorts the records by theelements of a specified column in ascending order, and writes the result into an external file.

Usage: xsortrec

Inputs:- name of the input file- index of the column used in ordering the records- name of the output file (optional)

Outputs:- ordered data records on the specified file or on screen

Remark:The format of the output file should be changed to reflect the number and data types used ineach record (the default is for the structure used in file data2.dat).

5.55 XSTAT

Scope:This MATLAB program tests the following modules: rms, rss, rssxy, and statup. In addition,results from internal modules mean and std are recorded.

Usage: xstat

Inputs:- name of the input file containing one column data

Page 198: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XSTATC, XSVPALM

- Page 5-38 -

- name of the output file if selected, otherwise the data are displayed on screen

Outputs:- input/output data stored on the selected output file or displayed on the screen

External Matlab modules used: rms, rss, rssxy, statup

5.56 XSTATC

Scope:This MATLAB program determines mean, standard deviation and root mean square (rms) ofthe elements of a specified column of the input array.

Usage: xstatc

Inputs:- name of the input file containing the input data array- name of the output file if selected, otherwise the data are displayed on screen- index for the selected column

Outputs:- output data stored on the selected output file or displayed on the screen

Remark:

External Matlab macros used: rms

5.57 XSVPALM

Scope:This MATLAB program computes ECEF satellite position based on satellite almanac data;WGS-84 constants are used.

Usage: xsvpalm

Inputs:- tsim, GPS system time at time of transmission, i.e. GPS time corrected for transit time (range/speed of light), in seconds- satellite almanac data from a specified data file; default data are given. The almanac satellite data is specified in the following order (each record is for a different satellite): (1) satelitte number (2) toa, reference time almanac (toa, time of applicability), in seconds (3) smaxis, satellite semi-major axis (a), in meters (4) ecc, satellite eccentricity (e)

Page 199: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XXSVPCOMP

- Page 5-39 -

(5) izero, inclination angle at reference time (I_0), in radians(6) razero, right ascension at reference time (OMEGA_0), in radians (longitude of ascending node of orbit plane at weekly epoch)

(7) argper, argument of perigee (omega), in radians (8) mzero, mean anomaly at reference time (M_0), in radians (9) radot, rate of right ascension (OMEGA_DOT), in radians/second- name of the input data file (optional)- name of the output file (optional)

Outputs:- input/output data stored on the selected output file or displayed on screen

External Matlab modules used: svpalm, , wgs84con

5.58 XSVPCOMP

Scope:This MATLAB program computes RSS between ECEF satellite position based on satelliteephemeris data and the corresponding ECEF satellite position based on almanac data; WGS-84 constants are used.

Usage: xsvpcomp

Inputs:- tsim, GPS system time at time of transmission, i.e. GPS time corrected for transit time (range/speed of light), in seconds- satellite ephemeris data from a specified data file; default data are given. The ephemeris satellite data are specified in the following order: (1) satellite number (2) toe, reference time ephemeris, in seconds (3) smaxis (a), satellite semi-major axis, in meters (4) ecc (e), satellite eccentricity (5) izero (I_0), inclination angle at reference time, in radians

(6) razero (OMEGA_0), right ascension at reference time, in radians, (longitude of ascending node of orbit plane at weekly epoch)

(7) argper (omega), argument of perigee, in radians (8) mzero (M_0), mean anomaly at reference time, in radians (9) radot (OMEGA_DOT), rate of right ascension, in radians/second (10) deln (delta_n), mean motion difference from computed value, in radians/second (11) idot (I_DOT), rate of inclination angle, in radians/second

(12) cic, amplitude of the cosine harmonic correction term to the angle of inclination, in radians(13) cis, amplitude of the sine harmonic correction term to the angle of inclination, in radians

(14) crc, amplitude of the cosine harmonic correction term to the orbit radius, in meters

Page 200: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XXSVPEPH

- Page 5-40 -

(15) crs, amplitude of the sine harmonic correction term to the orbit radius, in meters(16) cuc, amplitude of the cosine harmonic correction term to the argument of latitude, in

radians(17) cus, amplitude of the sine harmonic correction term to the argument of latitude, in radians

- satellite almanac data from a specified data file; default data are given. The almanac satellite data are specified in the following order: (1) satellite number (2) toe, reference time ephemeris, in seconds (3) smaxis (a), satellite semi-major axis, in meters (4) ecc (e), satellite eccentricity (5) izero (I_0), inclination angle at reference time, in radians (6) razero (OMEGA_0), right ascension at reference time, in radians, (longitude of

ascending node of orbit plane at weekly epoch) (7) argper (omega), argument of perigee, in radians (8) mzero (M_0), mean anomaly at reference time, in radians (9) radot (OMEGA_DOT), rate of right ascension, in radians/second- name of the input data files (optional)- number of time steps (integer)- time step value, in seconds; initial time is tsim- name of the output files (optional)

Outputs:- plot of the RSS between the satellite ephemeris position and satellite almanac position- two output data files (optional) storing the ECEF satellite position based on ephemeris/ almanac; each record contains the following data: time step number, satellite ECEF x- component, satellite ECEF y-component, and satellite ECEF z-component

External Matlab macros used: svpalm, svpeph, wgs84con

5.59 XSVPEPH

Scope:This MATLAB program computes ECEF satellite position based on satellite ephemeris data;WGS-84 constants are used.

Usage: xsveph

Inputs:- tsim, GPS system time at time of transmission, i.e. GPS time corrected for transit time (range/speed of light), in seconds- satellite ephemeris data from a specified data file; default data are given. The ephemeris satellite data are specified in the following order: (1) satellite number (2) toe, reference time ephemeris, in seconds

Page 201: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XSVSEL

- Page 5-41 -

(3) smaxis (a), satellite semi-major axis, in meters (4) ecc (e), satellite eccentricity (5) izero (I_0), inclination angle at reference time, in radians

(6) razero (OMEGA_0), right ascension at reference time, in radians, (longitude of ascending node of orbit plane at weekly epoch)

(7) argper (omega), argument of perigee, in radians (8) mzero (M_0), mean anomaly at reference time, in radians (9) radot (OMEGA_DOT), rate of right ascension, in radians/second (10) deln (delta_n), mean motion difference from computed value, in radians/second (11) idot (I_DOT), rate of inclination angle, in radians/second (12) cic, amplitude of the cosine harmonic correction term to the angle of inclination, in

radians (13) cis, amplitude of the sine harmonic correction term to the angle of inclination, in

radians (14) crc, amplitude of the cosine harmonic correction term to the orbit radius, in meters (15) crs, amplitude of the sine harmonic correction term to the orbit radius, in meters (16) cuc, amplitude of the cosine harmonic correction term to the argument of latitude, in radians (17) cus, amplitude of the sine harmonic correction term to the argument of latitude, in

radians- name of the input data file (optional)- name of the output data file (optional)

Outputs:- input/output data stored on the selected output file or displayed on screen

External Matlab modules used: svpeph

5.60 XSVSEL

Scope:This MATLAB program executes the selection of 4, 5 or 6 satellites based on minimumgeometric dilution of precision (GDOP) criteria from all possible sets available. For theselected set of 4, 5 or 6 satellites the computed dilution-of-precision (DOP) values areoutputted.

Usage: xsvsel

Inputs:- name of the input filename; the default file is xsvsel1.dat- name of the output filename; the default file is xsvsel.out- number of satellites to be selected

Outputs:- number of satellites available

Page 202: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XSWDOP, XTRAJS

- Page 5-42 -

- number of satellites to be used- indices of the selected satellites- dilution-of-precision (DOP) values for the selected satellites set

External Matlab modules used: svsel4, svsel5, svsel6, dop1

5.61 XSWDOP

Scope:This MATLAB program computes sub-weighted dilution of precision (sub-WDOP)quantities, i.e. WDOP quantities for all satellite subsets obtained by eliminating one satellitefrom the original set.

Usage: xswdop

Inputs:- name of the output file containing the results; the default is on screen- name of the input file containing line-of-sight unit vectors; each row contains a line-of- sight (LOS) unit vector- weighting factors (from keyboard) for each LOS

Outputs:- input/output data stored on the selected output file or displayed on screen

Remark:Five or more satellites are needed for the computation of sub-WDOP. The sub-WHDOP isuseful in the RAIM detection process [7], [27].

References: [7], [27]

External Matlab macros used: swdop

5.62 XTRAJS

Scope:This MATLAB program determines the vehicle trajectory with the following characteristics:straight segment with constant speed in ENU frame; the trajectory is specified in ECEF andENU frames. WGS-84 constants are used.

Usage: xtrajs

Inputs:- selection of the default input data or enter the following input data from keyboard:- initial ECEF position, the components in meters

Page 203: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XTROPOC1, XUCLOCK

- Page 5-43 -

- ENU velocity (constant), the components in meters/second,- t ime step, in seconds,- number of steps- selection of the output data file or exit the results on screen

Outputs:- the recorded output data (at each time step) are as follows:- trajecef, ECEF position, the components are in meters; trajecef(k+1,:) is the k-th time step value- trajenu , ENU position, the components are in meters; trajenu(k+1,:) is the k-th time step value; the origin is the initial user's position on a specified file or on screen- plots of the generated 3-D ECEF trajectory, 2-D ENU trajectory, and longitude-latitude trajectoru (optional).

External Matlab macros used: tecefgd, trajs, venuecef, wgs84con

5.63 XTROPOC1

Scope:This Matlab program determines tropospheric delay contours for a specified location(latitude/longitude), elevation range, and altitude range by using a simplified model [29];WGS-84 constants are used.

Usage: xtropoc1

Inputs:- WGS-84 geoid heights data file, by default tgeoid84.dat- location (latitude/longitude), in radians- other parameters are initialized by default

Outputs:- plot of tropo corrections (contour grapg) for the specified location

Reference: [29]

External Matlab macros used: geoidh, tropoc1

5.64 XUCLOCK

Scope:This MATLAB program generates and saves the user clock bias and drift for a specifiednumber of time steps and number of users (receivers), by using a simplified second ordermodel [8]; WGS-84 constants are used.

Page 204: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XUERCOR

- Page 5-44 -

Usage: xuclock

Inputs:From keyboard the user should enter the following data:- maximum number of users (receivers), nru (default is 6)- number of time steps to be generated, nrsteps (default is 1800)- time step value, in seconds (default is 1 second)- white noise spectral density amplitude (Sb) for the first component corresponding to clock bias, in seconds- white noise spectral density amplitude (Sd) for the second component corresponding to clock drift, in second/second- random number seed value (default is 0)- selection of the storage data file - mat-files: ucbfile.mat and ucdfile.mat - selected name for two ASCII data files - none, no storage (default)- selection of user clock bias and drift plots from generated data- some application specific parameters are initialized by default (see Sb and Sd for a clock with crystal oscillator)

Outputs:- output file storing the generated user clock bias and drift, mat-files ucbfile.mat and ucdfile.mat, or two selected ASCII data file; each output array has nrsteps rows and nru columns- plot of clock bias and drift versus time step

Reference: [8]

External Matlab macros used: uclock, rms, wgs84con

5.65 XUERCOR

Scope:This MATLAB program generates and plots the magnitude of the user earth rotationcorrection vector (Coriolis factor) for a specified longitude/latitude grid. WGS-84 constantsare used.

Usage: xuercor

Inputs:- name of the input almanac data file; the default is data file wk749.dat. Each record contains the data related to a satellite in the following order: (1) satellite id, (2) satellite time of applicability (toa), in seconds, (3) satellite semi-major axis (a), in meters,

Page 205: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XUPOSD4

- Page 5-45 -

(4) satellite eccentricity (e), (5) satellite orbital inclination (I_0), in radians, (6) satellite right ascension at toa (OMEGA_0), in radians, (7) satellite argument of perigee (omega), in radians, (8) satellite mean anomaly (M_0), in radians, (9) satellite rate of right ascension (OMEGA_DOT), radians/second- elevation mask angle, in degrees; the default value is 5 degrees- simulation time, time of week, in seconds; the default value is 0.- index of the selected satellite (prn)- longitude/latitude/altitude grid by default (longitude and latitude by 10 degrees from 0 to 360, and -90 to 90, respectively, and altitude is always 0 meters); the grid can be easily modified- option to save the generated data in the file ercor.mat

Outputs:- generated earth rotation correction vector magnitude for the longitude/latitude/altitude grid into the file ercor.mat (optional)- surface plot of the magnitude of the earth rotation correction vector magnitude for the longitude/latitude/altitude grid

References: [4], [36]

External Matlab macros used: eleva, svpalm, tgdecef, uercor, uverv, wgs84con

5.66 XUPOSD4

Scope:This MATLAB program computes GPS user's position by using a direct (non-iterative) GPSsolution method proposed by Bancroft [5], [9], when four satellite positions and thecorresponding pseudoranges are known.

Usage: xuposd4

Inputs:- name of the output file if selected, otherwise the data are displayed on screen- name of the ASCII input file with four rows and four columns; each row contains the three components of the ECEF satellite position and the corresponding pseudorange (all values are in meters)

Outputs:- input data, ECEF position and corresponding pseudorange for each satellite- computed ECEF user's position and computed user's clock bias measurement in units of distance (for each solution)

References: [5], [9]

Page 206: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XUPOSDG, XUPOSIT

- Page 5-46 -

External Matlab modules used: uposd4

5.67 XUPOSDG

Scope:This MATLAB program computes GPS user's position by using a direct (non-iterative) GPSsolution method proposed by Bancroft [5], [9], when at least four satellite positions and thecorresponding pseudoranges are known.

Usage: xuposdg

Inputs:- name of the output file if selected, otherwise the data are displayed on screen- name of the ASCII input file with at least four rows and four columns; each row contains the three components of the ECEF satellite position and the corresponding pseudorange (all values are in meters)

Outputs:- input data, ECEF position and corresponding pseudorange for each satellite- computed ECEF user's position and computed user's clock bias measurement in units of distance (for each solution)

References: [5], [9]

External Matlab modules used: uposdg

5.68 XUPOSIT

Scope:This MATLAB program computes GPS user's position by using an iterative method, whenfour ECEF satellite positions and the corresponding pseudoranges are known.

Usage: xuposit

Inputs:- name of the output file if selected, otherwise the data are displayed on screen- name of the ASCII input data file; each row contains the three components of the ECEF satellite position and the corresponding pseudorange (all values are in meters)- number of iterations to be executed; at least 3 iterations is recommended- initial user's position in ECEF; the default value is (0., 0., 0.)

Outputs:- input data, ECEF position and corresponding pseudorange for each satellite

Page 207: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XVTRANSF

- Page 5-47 -

- computed ECEF user's position and computed user's clock bias measurement in units of distance (for each solution)

External Matlab modules used: uposit

5.69 XVTRANSF

Scope:This MATLAB program performs the following coordinate transformations of a given vectorand reference point/angles (optional): 1) from ECEF to ENU coordinates 2) from ENU to ECEF coordinates 3) from ECEF to LLWA coordinates 4) from LLWA to ECEF coordinates 5) from ECEF to INS coordinates 6) from INS to ECEF coordinates 7) from ENU to LLWA coordinates 8) from LLWA to ENU coordinates 9) from LLWA to GPS body coordinates10) from GPS body to LLWA coordinates11) from ECEF to Geodetic coordinates12) from Geodetic to ECEF coordinates13) from ENU to Geodetic coordinates14) from Geodetic to ENU coordinates15) from ECEF to ECI coordinates16) from ECI to ECEF coordinates17) from ECEF WGS-84 to SGS-85 coordinates18) from SGS-85 to ECEF WGS-84 coordinates19) from ECEF WGS-84 to PZ-90 coordinates20) from PZ-90 to ECEF WGS-84 coordinates

Usage: xvtransf

Inputs:- name of the output file if selected (the default is the screen)1) For the ECEF/ENU to ENU/ECEF transformation: - input vector - reference latitude, in radians - reference latitude, in radians2) For the ECEF/LLWA to LLWA/ECEF transformation: - input vector - reference latitude, in radians - reference longitude, in radians - reference wander azimuth angle, in radians

Page 208: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XWDOP

- Page 5-48 -

3) For the ECEF/INS to INS/ECEF transformation: - input vector - reference latitude, in radians

- reference longitude, in radians - reference wander azimuth angle, in radians

4) For the ENU/LLWA to LLWA/ENU transformation: - input vector - reference wander azimuth angle, in radians5) For the LLWA/GPS Body to GPS Body/LLWA transformation: - input vector - yaw angle, in radians - pitch angle, in radians - roll angle, in radians6) For the ECEF/Geodetic to Geodetic/ECEF transformation: - input vector - reference latitude, in radians - reference longitude, in radians - reference altitude, in meters7) For the ENU/Geodetic to Geodetic/ENU transformation: - input vector - reference latitude, in radians - reference longitude, in radians

- reference altitude, in meters8) For the ECEF/ECI to ECI/ECEF transformation: - input vector - time elapsed since reference time, in seconds9) For the ECEF WGS-84/SGS-85 to SGS-85/ECEF WGS-84 transformation: - input vector10) For the ECEF WGS-84/PZ-90 to PZ-90/ECEF WGS-84 transformation: - input vector

Outputs:- input/output data stored into the specified output file or displayed on screen

External Matlab modules used: vecefenu, venuecef, vecefllw, vllwecef, vecefins,vinsecef, venullw, vllwenu, vllwb, vbllw, vecefgd, vgdecef, venugd, vgdenu, vecefeci,veciecef, vecefs85, vs85ecef, vecefp90, vp90ecef, tecefgd, tgdecef, wgs84con

5.70 XWDOP

Scope:This MATLAB program computes weighted dilution of precision (WDOP) quantities whenat least three line-of-sight unit vectors are specified by using macro WDOP1.m or WDOP2.mfour line-of-sight unit vectors are specified.

Page 209: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XWDOPV, XYP1

- Page 5-49 -

Usage: xwdop

Inputs:- name of the output file containing the results; the default is the display on the screen- selection of the macro to be used (wdop1 or wdop2)- name of the input file containing line-of-sight unit vectors, e.g. geom7.dat; each row contains a line-of-sight unit vector- weighting factors (from keyboard) for each line-of-sight

Outputs:- input/output data stored on the selected output file or displayed on screen

External Matlab modules used: wdop1, wdop2

5.71 XWDOPV

Scope:This MATLAB program computes the weighted dilution of precision (WDOP) quantitieswhen four line-of-sight unit vectors and the corresponding weighting factors are specified, byusing a geometric method [18].

Usage: xwdopv

Inputs:- name of the output file containing the results- name of the input file containing line-of-sight unit vectors; each row contains a line-of- sight (LOS) unit vector- weighting factors (from keyboard) for each line-of-sight (LOS) unit vector

Outputs:- input/output data stored on the selected output file or displayed on screen

Reference: [18]

External Matlab modules used: wdopv

5.72 XYP1

Scope:This MATLAB program plots a x-y graph for a selected column from an ASCII data file;manual scaling is available.

Usage: xyp1

Page 210: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XYP1S

- Page 5-50 -

Inputs:- name of the ASCII input data file (with extension),- selected x-axis column index,- column number to be plotted,- title of the plot,- y-axis label,- x-axis label,- optional, new axes limits [xmin xmax ymin ymax].

Outputs:- selected graph

Remark:The user can select the x-axis column; the other columns are used for y-axis coordinates.Each y column data (when selected) is independently plotted against x column data. Ifstatistics is needed use xyp1s.

5.73 XYP1S

Scope:This MATLAB program plots a x-y graph for a selected column from an ASCII data file;manual scaling is available. In addition, the plot can incorporate statistics related to theselected graph, i.e. mean, standard deviation and root mean square (rms).

Usage: xyp1s

Inputs:- name of the ASCII input dta file (with extension),- selected x-axis column index,- column number to be plotted,- title of the plot,- y-axis label,- x-axis label,- optional, new axes limits [xmin xmax ymin ymax].

Outputs:- selected graph

Remarks:The user can select the x-axis column; the other columns are used for y-axis coordinates.Each y column data (when selected) is independently plotted against x column data. Thecomputed/listed statistics is for the selected range of the specified plot.

External Matlab modules used: rms

Page 211: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XYP2W, XYP3W

- Page 5-51 -

5.74 XYP2W

Scope:This MATLAB program plots a x-y graph for two selected columns in two different windows/subplots from an ASCII data file; manual scaling is available. In addition, the plots canincorporate statistics related to the selected graphs, i.e. mean, standard deviation and rootmean square (rms).

Usage: xyp2w

Inputs:- the name of the ASCII input data file (with extension),- x-axis column number,- y-axis column number (for each subplot),- title of the plot (for each subplot),- y- axis label (for each subplot),- x- axis label (for each subplot),- optional, new axes limits [xmin xmax ymin ymax] for both plots.

Outputs:- selected graphs

Remark:The computed/listed statistics is for the selected range of the specified plot. The program canbe easily modified to allow the selection of columns for x-axes independently.

External Matlab macros used: rms

5.75 XYP3W

Scope:This MATLAB program plots a x-y graph for three selected columns in three differentwindows/subplots from an ASCII data file; manual scaling is available. In addition, the plotscan incorporate statistics related to the selected graphs, i.e. mean, standard deviation and rootmean square (rms).

Usage: xp3w

Inputs:- name of the ASCII input data file (with extension),- x-axis column number,- y-axis column number (for each subplot),- title of the plot (for each subplot),- y-axis label (for each subplot),

Page 212: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XYPC2

- Page 5-52 -

- x-axis label (for each subplot),- optional, new axes limits [xmin xmax ymin ymax] for all plots.

Outputs:- selected graphs

Remark:The computed/listed statistics is for the selected range of the specified plot. The program canbe easily modified to allow the selection of columns for x-axes independently.

External Matlab macros used: rms

5.76 XYPC2

Scope:This MATLAB program plots a x-y graph of the difference between two data columns fromdifferent data files against a selected data column from the first input file as x-axis; manualscaling is available. In addition, the plot can incorporate statistic related to the selected graph,i.e. mean, standard deviation, and root mean square (rms).

Usage: xypc2

Inputs:- name of the first ASCII data input file (with extension),- name of the second ASCII data input file (with extension),- selected x-axis column index,- column number to be compared between data files,- title of the plot,- y-axis label,- x-axis label,- optional, new axes limits [xmin xmax ymin ymax].

Outputs:- selected graph

Remark:The column used as x-axis is selected from the first input data file. The computed/listedstatistics is for the selected range of the x-axis. The comparison can use the same file.

External Matlab macros used: rms

Page 213: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XYPC2RSS, XYPM

- Page 5-53 -

5.77 XYPC2RSS

Scope:This MATLAB program plots a x-y graph for root sum square (RSS) of three specifiedcolumns from the difference of two ASCII data files; manual scaling is available. In addition,the plot can incorporate statistics related to the selected graph, i.e. mean, standard deviationand root mean square (rms).

Usage: xypc2rss

Inputs:- name of the first ASCII input data file (with extension),- name of the second ASCII input data file (with extension),- selected x-axis column index,- columns number for the RSS plotting,- title of the plot,- y-axis label,- x-axis label,- optional, new axes limits [xmin xmax ymin ymax].

Outputs:- selected graph

Remark:The column used as x-axis is selected from the first input data file. The computed/listedstatistics is for the selected range of the x-axis. The comparison can use the same file

External Matlab macros used: rms

5.78 XYPM

Scope:This MATLAB program plots a x-y graph for the selected columns of the specified ASCIIdata file; manual scaling is available.

Usage: xypm

Inputs:- name of the ASCII input data file (with extension),- number of the columns to be plotted,- the indices for the columns to be plotted,

- title of the plot,- y-axis label,- x-axis label,

Page 214: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XYPRSS, XYPRSS2W

- Page 5-54 -

- optional, new axes limits [xmin xmax ymin ymax].

Outputs:- selected graphs

Remark:The first column of the input array contains the x coordinates, and other columns store the ycoordinates.

5.79 XYPRSS

Scope:This MATLAB program plots a x-y graph for root sum square (RSS) of three specifiedcolumns with data from an ASCII data file; manual scaling is available.

Usage: xyprss

Inputs:- the name of the ASCII input file which must have a "dat" extension,- the columns number for the RSS plotting,- title of the plot,- y-axis label,- x-axis label,- new axes limits [xmin xmax ymin ymax], optional.

Outputs:- selected graph

Remark:The first column of the input array contains the x coordinates, and other columns store the ycoordinates. From the three selected y columns data, for each x coordinate a RSS value isdetermined and plotted against x column data.

5.80 XYPRSS2W

Scope:This MATLAB program plots a x-y graph for root sum square (RSS) of three columnscorresponding to the position and velocity errors from an ASCII data file; manual scaling isavailable. In addition, the plots can incorporate statistics related to the selected graphs, i.e.mean, standard deviation and root mean square (rms).

Usage: xyprss2w

Inputs:- name of the ASCII input data file (with extension),

Page 215: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5 XYPVSTD

- Page 5-55 -

- title of the plot,- optional, new axes limits [xmin xmax ymin ymax] for both plots.

Outputs:- selected graphs

Remark:The first column of the input array contains the x coordinates, columns 2 to 4 containposition error components, and columns 5 to 7 contain velocity error components. The unitsused in the legend are: seconds, meters, and meters/second. The computed/listed statistics isfor the selected range of the specified plot. The program can be easily modified to allow theselection of columns for x and y axes.

External Matlab macros used: rms

5.81 XYPVSTD

Scope:This MATLAB program plots a x-y graph for a selected variable and the associated envelope(standard deviation) from two specified columns of an ASCII data file when the first columndata is used as x-axis; manual scaling is available. In addition, the plot can incorporatestatistics related to the selected graph, i.e. mean, standard deviation and root mean square(rms) of the selected variable.

Usage: xypvstd

Inputs:- name of the ASCII input data file (with extension),- column number for the selected variable to be plotted,- the column number for the associated standard deviation,- title of the plot,- y-axis label,- x-axis label,- optional, new axes limits [xmin xmax ymin ymax].

Outputs:- selected graphs

Remark:The first column of the input array contains the x coordinates, and other columns store the ycoordinates. The computed/listed statistics is for the selected range of the specified graph.

External Matlab macros used: rms

Page 216: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 5

- Page 5-56 -

Page 217: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 6 References

- Page 6-1 -

6.0 REFERENCES

1 Anon., Minimum operational performance standards for airborne supplemental navigationequipment using Global Positioning System (GPS). Document No. RTCA/DO-208, July1991, Prepared by SC-159.

2 Anon., Changes to RTCA/DO-208, Minimum operational performance standards for airbornesupplemental navigation equipment using Global Positioning System (GPS). September1991, Prepared by SC-159.

3 Anon., Global Positioning System. Monographs published by The Institute of Navigation,Vol. I (1980), Vol. II (1984), Vol. III (1986), Vol. IV (1993), Vol. V (1998).

4 Anon., ICD-GPS-200C (GPS Interface Control Document). GPS Joint Program Office,October 10, 1993.

5 Bancroft, S., An algebraic solution of the GPS equations. IEEE Transactions on Aerospaceand Electronic Systems, vol. AES-21, No. 7, 1985, pp. 56-59.

6 Bierman, G, J., Factorization methods for discrete sequential estimation. Academic Press,New York, 1977.

7 Brown, R. G., A baseline RAIM scheme and a note on the equivalence of three RAIMmethods. Proceedings of the National Technical Meeting, Institute of Navigation, San Diego,CA, Jan. 27-29, 1992, pp. 127-137.

8 Brown, R. G., Hwang, P. Y. C., Introduction to random signals and applied Kalman filtering.Third Edition, John Wiley & Sons, 1997.

9 Chaffee, J. W., Abel, J. S., Bifurcation of pseudorange equations. Institute of Navigation,Proceedings of the 1993 National Technical Meeting, San Francisco, CA, Jan. 20-22, 1993,pp. 203-211.

10 Copps, E. M., Lupash, L., Extending the generality and robustness of RAIM algorithms.Proceedings of the 1994 Technical Meeting, Institute of Navigation, San Diego, 24-26, 1994,pp. 31-39.

11 Etter, D. M., Engineering problem solving with MATLAB. Prentice Hall, Englewood Cliffs,NJ, 1993.

12 Gelb, A., Applied optimal estimation. The MIT Press, Cambridge, MA, 1974.13 Green, G. B., Massatt, P. D., Rhodus, N. W., The GPS 21 primary satellite constellation.

Navigation, Journal of the Institute of Navigation, vol. 36, No. 1, Spring 1989, pp. 9-24.14 Grewald, M. S., Andrews, A. P., Kalman filtering. Theory and applications. Prentice Hall

Inc., 1993.15 Kaplan, E., Editor, Understanding GPS: Principles and Applications. Artech House, 1996.16 Leonard, N. E., Levine, W. S., Using MATLAB to analyze and design control systems. The

Benjamin/Cummings Publishing Company Inc., Redwood City, CA, 1992.17 Logsdon, T., Understanding the Navstar, GPS, GIS, and IVHS. Van Nostrand Reinhold,

1995.18 Massatt, P., Rudnick, K., Geometric formulas for dilution of precision calculations.

Navigation, Journal of the Institute of Navigation, Vol. 37, No. 4, 1990-91, pp. 379-391.19 Minkler, G., Minkler, J., Aerospace coordinate systems and transformations. Magellan Book

Company, Baltimore, MD, 1990.20 Press, W. H., and others, Numerical recipes. The art of scientific computing. Cambridge

University Press, 1986.21 Saadat, H., Computational aids in control systems using MATLAB. Mc Graw-Hill, Inc.,

1993.22 Sturza, M. A., Navigation system integrity monitoring using redundant measurements.

Navigation, Journal of the Institute of Navigation, Vol. 35, No. 4, Winter 1988-89, pp. 483-501.

Page 218: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Chapter 6 References

- Page 6-2 -

23 Van Graas, F., Farrell, J. L., Baseline fault detection and exclusion algorithm. Institute ofNavigation, Proceedings of the 49th Annual Meeting, Cambridge, MA, June 21-23, 1993, pp.413-420.

24 Lupash, L., Wlad, J., TA-12 RAIM test results and analysis. Proceedings of the ION 55th

Annual Meeting, 28-30 June 1999, Cambridge, MA, pp. 546-555.25 Parkinson, B. W., Spilker, J. J. jr, and others, Global Positioning System: Theory and

Applications, vol I and ii. AIAAA, Progress in Astronautics and Aeronautics, vol. 163-164,1996.

26 Brown, R. G., Chin, G. V., GPS RAIM: Calculation of thresholds and protection radius usingChi-square methods – A geometric approach. RTCA Paper No. 491-94/SC159-584,November 1994.

27 Brown, A. K., Sturza, M. A., The effect of geometry on integrity monitoring performance.The Institute of Navigation 46th Annual Meeting, June 1990, pp. 121-129.

28 Hofman,-Wellenhof, B., Lichtenegger, H., Collins, J., Global Positioning System. Theoryand Practice, Springer-Verlag, 1997.

29 Farrell, J., Barth, M., The Global Positioning System and Inertial Navigation. McGraw Hill,1998.

30 Anon., Minimum operational performance standards for Global Positioning System/WideArea Augmentation System airborne equipment. Document No. RTCA/DO-229, January 16,1996, Prepared by SC-159.

31 Anon., Department of Defense World Geodetic System 1984. DMA Technical Report8350.2, Second Edition, September 1, 1991.

32 Montenbruck, O., Gill, E., Satellite orbits. Models, methods, and applications. Springer,2000.

33 Tsui, J. B-Y., Fundamentals of Global Positioning System receivers. A software approach.John Wiley & Sons Inc., 2000.

34 Langley, R.B., GLONASS: Review and update. GPS World, vol. 8, Sept. 1997, pp. 46-51.35 Lupash, L., A new algorithm for the computation of the geodetic coordinates as a function

of Earth-Center Earth-Fixed coordinates. Journal of Guidance, Control, and Dynamics, vol.8, No. 6, 1985, pp. 787-789.

36 DiEsposti, R., Time-dependency and coordinate system issue in GPS measurement models.ION GPS-2000, Salt Lake City, UT, Sept. 19-23, 2000.

37 Misra, P. N., Abbott, R. I., Gaposchkin, E. M., Integrated use of GPS and GLONASS:Transformation between WGS84 and PZ-90. Proceedings of ION GPS-96, Kansas City,September 16-20, 1996, pp. 307-314.

38 Misra, P. N., Abbott, R. I., SGS85 - WGS84 transformation. Manuscripta geodaetica, Vol.19, 1994, pp. 300-308.

Page 219: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Appendix List of modules

- Page 7-1

APPENDIX A. List of functions and input/output files in alphabetical order

For a complete description of all modules and main programs by topics please see Table2-1.

A.1 List of m-file modules (in alphabetical order)

1. CEP2. CHI2_DOF3. CONVCON4. DHMAX5. DOP16. DOP27. ELEVA8. ELEVAR9. ELEVAZ10. ELIMCOL11. ELIMROW12. FDNT13. FOM14. FPBIAS_C15. FPBIAS_G16. GAUSS_117. GCNAV18. GDOPV19. GENRN20. GEODES21. GEOIDH22. GMP123. GMP224. GPSCON25. GPSLSEC26. GRIDWAAS27. HMAT28. HMATB29. HMATBC30. HMATC31. HPE32. IONOC33. IONOCON34. KFCOV35. KFCOVA36. MBLLW37. MCUD38. MECEFECI

Page 220: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Appendix List of modules

- Page 7-2

39. MECEFENU40. MECEFINS41. MECEFLLW42. MECIECEF43. MENUECEF44. MENULLW45. MINSECEF46. MLLWB47. MLLWECEF48. MLLWENU49. MREAST50. MSC2F51. MSF2C52. MUDC2F53. MUDD54. MUDF2C55. MUDM56. MUDM157. NCCHI2_1058. NCCHI2_259. NCCHI2_360. NCCHI2_461. NCCHI2_562. NCCHI2_663. NCCHI2_764. NCCHI2_865. NCCHI2_966. PIONOC67. PRADR68. PZ90CON69. QRUPA70. RAIMFD71. RAIMST72. RANGE73. RMS74. RMS275. RSS76. RSSXY77. RWALK78. SDOP79. SELECTD80. SGS85CON81. SLOPEMAX82. STATUP83. SVPALM84. SVPEPH

Page 221: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Appendix List of main programs

- Page 7-3

85. SVSEL486. SVSEL587. SVSEL688. SWDOP89. TADMSRAD90. TARADDMS91. TECEFGD92. TECEFGD293. TGDECEF94. TIMETR95. TRAJS96. TROPOC197. UCLOCK98. UERCOR99. UPOSD4100. UPOSDG101. UPOSIT102. UVERV103. VBLLW104. VECEFECI105. VECEFENU106. VECEFGD107. VECEFINS108. VECEFLLW109. VECEFP90110. VECEFS85111. VECIECEF112. VENUECEF113. VENUGD114. VENULLW115. VEP116. VGDECEF117. VGDENU118. VINSECEF119. VLLWB120. VLLWECEF121. VLLWENU122. VP90ECEF123. VS85ECEF124. WDOP1125. WDOP2126. WDOPV127. WGS72CON128. WGS84CON

Page 222: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Appendix List of output files

- Page 7-4

A.2 List of m-file main programs (in alphabetical order)

1. XAMBIG2. XATRANSF3. XCEPVEP4. XCON5. XDOP6. XEBUDGET7. XECEF2GD_COMP8. XELAZ9. XELIMRC10. XFDNT11. XFOM12. XGCDR13. XGCNAV14. XGDOPV15. XGENRN16. XGEODES17. XGEOIDH18. XGMP119. XGMP220. XGPSLSEC21. XGPSTIME22. XGRIDW23. XHMATALL24. XHPE25. XIONOC26. XKFCOV27. XMAPDOP28. XMISDAT29. XMPATH30. XMTRANSF31. XMUDDU32. XMUDM33. XOPCR34. XPBAR35. XPBIAS36. XPELAZA37. XPELAZS38. XPFWLS39. XPPVA40. XPPVAJ41. XPRADR42. XPTRANSF43. XQRUPA

Page 223: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Appendix List of output files

- Page 7-5

44. XRAIMDA45. XRAIMEA46. XRAIMFD47. XRAIMST48. XREADALM49. XRINEXN50. XRWALK51. XSAERR52. XSDOP53. XSLOPE54. XSORTREC55. XSTAT56. XSTATC57. XSVPALM58. XSVPCOMP59. XSVPEPH60. XSVSEL61. XSWDOP62. XTRAJS63. XTROPOC164. XUCLOCK65. XUERCOR66. XUPOSD467. XUPOSDG68. XUPOSIT69. XVTRANSF70. XWDOP71. XWDOPV72. XYP173. XYP1S74. XYP2W75. XYP3W76. XYPC277. XYPC2RSS78. XYPM79. XYPRSS80. XYPRSS2W81. XYPVSTD

A.3 List of input files (in alphabetical order)

*.dat files:1. ELLIPS.DAT2. GEOM1.DAT

3. GEOM2.DAT

Page 224: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Appendix List of output files

- Page 7-6

4. GEOM3.DAT5. GEOM4.DAT6. GEOM5.DAT7. GEOM6.DAT8. GEOM7.DAT9. LOCAT1.DAT10. MAP01.DAT11. MOPS24.DAT12. SV2POS.DAT13. SV3POS.DAT14. SV3POSR.DAT15. SV4BPOSR.DAT16. SV4POS.DAT17. SV4POSR.DAT18. SV5BPOSR.DAT19. SV5POS.DAT20. SV5POSR.DAT21. SV6BPOSR.DAT22. SV6POS.DAT23. SV6POSR.DAT24. SV7BPOSR.DAT25. SV7POS.DAT26. SV7POSR.DAT27. SVPRIME.DAT28. TGEOID84.DAT29. USER1.DAT30. WK749.DAT31. XCEPVEP1.DAT32. XELAZ1.DAT33. XGEODES1.DAT34. XGEODES2.DAT35. XKFCOV1.DAT36. XPBAR1.DAT37. XSVSEL1.DAT

RINEX 2 files:38. RINEXNAV.99N

YUMA format almanac files:39. WK749.ALM40. WK749.YUM

zip-files (large data files):41. POSVELHD.ZIP (for POSVELHD.DAT)

42. POSVELMD.ZIP (for POSVELMD.DAT)43. PVHD_200.ZIP (for PVHD_200.DAT)

Page 225: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Appendix List of output files

- Page 7-7

44. XMISDAT1.ZIP (for XMISDAT1.DAT)

A.4 List of output files

*.out files:1. DATA2.OUT2. XDOP1.OUT3. XECEF2GD_COMP1.OUT4. XECEF2GD_COMP2.OUT5. XELAZ1.OUT6. XELAZ2.OUT7. XFDNT1.OUT8. XFDNT2.OUT9. XGCDR1.OUT10. XGCNAV1.OUT11. XGCNAV2.OUT12. XGDOPV1.OUT13. XGEODES1.OUT14. XGMP1_1.OUT15. XGMP2_1.OUT16. XGPSTIME1.OUT17. XHMATALL.OUT18. XHPE1.OUT19. XIONOC1.OUT20. XKFCOV.OUT21. XKFCOV1_1.OUT22. XKFCOV1_2.OUT23. XMAPDOP1.OUT24. XMAPDOP2.OUT25. XMPATH1.OUT26. XOPCR1,OUT27. XPBIAS1.OUT28. XPBIAS2.OUT29. XQRUPA1.OUT30. XRAIMDA1.OUT31. XRAIMDA2.OUT32. XRAIMEA1.OUT33. XRAIMEA2.OUT34. XRINEXN1.OUT35. XRINEXN2.OUT36. XRINEXN3.OUT37. XRWALK1.OUT

38. XSTAT1.OUT39. XSTAT2.OUT40. XSTATC1.OUT

Page 226: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Appendix List of output files

- Page 7-8

41. XSVCOMPA.OUT42. XSVCOMPE.OUT43. XSVPALM1.OUT44. XSVPALM2.OUT45. XSVPEPH1.OUT46. XSVSEL1.OUT47. XTRAJS1.OUT

*.dat files (from *.alm data files):48. WK749.DAT

*.dat files (from *.yum data files):49. WK749.DAT

A.5 List of input and output mat-files (in alphabetical order)

*.mat files:1. AMBFILE.MAT2. FGRIDW.MAT3. LATLON.MAT4. MPFILE.MAT5. SAFILE.MAT6. UCBFILE.MAT7. UCDFILE.MAT8. WORLDMAP.MAT

Page 227: MATLAB GPS Software Toolbox User's Guide and Reference Manual

Registration form

R E G I S T R A T I O N F O R M

Complete this form and return it to Lupash Consulting in order to become aregistered user. As a registered user, you will receive important user benefits, including:

• free technical support by fax or telephone for one year• future updates by e-mail for one year• future versions at significant discount price

Send this form to: Lupash Consulting2625 Monterey PlaceFullerton, CA 92833-2084USA

or e-mail to: [email protected] (see also the electronic form included)

________________________________________________________________________

REGISTRATION INFORMATION

GPS Toolbox Serial Number . . . . . . .

Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Company/University . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Street address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

City . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

State/Zip/Country . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Telephone/Fax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

E-mail address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

________________________________________________________________________