GPS Simulation

Democratising Wireless Innovation
Revision as of 18:53, 28 February 2017 by Cswiger (talk | contribs) (→‎Setup)
Jump to navigation Jump to search

Introduction

This page details experiences using LimeSDR to simulate GPS.

These experiments were inspired by the excellent procedure written up here [1]. We want to use a similar process to target real devices, and have had luck with a qstarz 818XT bluetooth gps device a couple of inches from an antenna. Here I am visiting Trinity College Cambridge.


Setup

Software to git clone - https://github.com/osqzss/gps-sdr-sim
Follow the instructions on the github page for how to compile, it is a very easy procedure on Ubuntu with build-essential package installed.

$ gcc gpssim.c -lm -O3 -o gps-sdr-sim

Note there is a setting in gpssim.h for USER_MOTION_SIZE default 3000 max duration at 10MHz (300 seconds). You can increase that to 6000 or more to get longer default running times.
The default sample rate for gps-sdr-sim is 2.6e6, 16 bit I/Q data format. LimeSDR will need 10e6, and 8 bit interleaved I/Q data format, so the strategy is to create an rf data file non-realtime and then transmit that with a simple gnuradio python script created in gnuradio-companion. The gps-fake-out project [2] links to a grc file, or it's easy to create your own. That example project simultaneous transmits the rf data file and also collects rf data for later analysis with Matlab and SoftGNSS. I found it useful to replace the file sink with an fft display slightly offset, and 20e6 input rate.

The last puzzle piece needed are ephemeris data to feed gps-sdr-sim (required), RINEX v2 format ( read all about it here [3] - especially the file name format). There is a global network of Internation GNSS Service installations [4] providing up to date data, which may be accessed with anonymous ftp from the Goddard Space Flight Center

ftp -p cddis.gsfc.nasa.gov

Login anonymous 'ftp' and email for password. Use the merged GPS broadcast ephemeris file found in /pub/gps/data/daily/2017/brdc/. The filename convention is

'brdc' + <3 digit day of year> + '0.' +  <2 digit year> + n.Z (compressed).

Day of year can be found with

$ date +%j

Get yesterdays - for example, today, Feb 28, 2017, I would get 'brdc0580.17n.Z', uncompress

$ uncompress brdc0580.17n.Z