After having defined procedures to calculate satellite positions, to correct pseudoranges and finally to calculate the receivers position it's time to add everything together.
The following steps have to be taken to go from raw data to the stand-alone receiver position.
This series of steps looks straightforward, but unfortunately it isn't. First I have to make some assumptions (which hold for the majority of GPS receivers).
A reasonable guess for the signal time of transmission can be made by taking the signal time of reception and subtracting from it the pseudorange in seconds (the range in meters divided by the speed of light). This works well if the receiver clock error is not too large, e.g. within 1 millisecond from the GPS time. Many receivers keep their internal clock indeed synchronized to GPS time within 1 millisec (see the OEM table), and for these receivers the above steps will do.
Other receivers let their internal clock drift away from the GPS time for ever . In this case, it is advised to make an initial guess for the signal time of transmission of 0.075 sec (which corresponds with the average distance between a receiver at the earth surface and GPS satellites above the horizon), and do a preliminary calculation according the 5 steps above. This gives a good guess for the receivers position which enables a sufficient good re-calculation of the signal time of transmission and a calculation of the iono- and tropo delay. Carry out step 1 to 5 again, now with the proper SV signal transit times and well corrected pseudoranges.
Conclusion:
Click here to view or download a sample Turbo Pascal program containing the above steps and the procedures described in the previous pages. The sample program contains also procedures to convert position data from WGS-84 Earth Centered Earth Fixed Cartesian Coordinates (ECEF XYZ) to WGS-84 latitude, longitude and height above the ellipsiod, and vice versa. No explanation of these procedures is provided, you can find the algorithms in any textbook on geodesy. Probably you want to input and output position data in your local reference frame. I leave this task to you ! (many conversion procedures from and to WGS-84 are available on the internet).
Notes:
I also prepared an input file containing actual data. Running the sample program with this data produced an output file. Both files can be viewed or downloaded.