2015-06-15 09:04:58 +08:00
|
|
|
# GPS-SDR-SIM
|
|
|
|
|
|
|
|
GPS-SDR-SIM generates GPS baseband signal data streams, which can be converted
|
|
|
|
to RF using software-defined radio (SDR) platforms, such as
|
2015-08-21 08:18:05 +08:00
|
|
|
[bladeRF](http://nuand.com/), [HackRF](https://github.com/mossmann/hackrf/wiki), and [USRP](http://www.ettus.com/).
|
2015-06-15 09:04:58 +08:00
|
|
|
|
|
|
|
### Windows build instructions
|
|
|
|
|
|
|
|
1. Start Visual Studio.
|
|
|
|
2. Create an empty project for a console application.
|
2015-06-27 09:17:50 +08:00
|
|
|
3. On the Solution Explorer at right, add "gpssim.c" and "getopt.c" to the Souce Files folder.
|
2015-06-15 09:04:58 +08:00
|
|
|
4. Select "Release" in Solution Configurations drop-down list.
|
|
|
|
5. Open the Property Pages dialog box and expand the Configuration Properties.
|
|
|
|
6. Expand the C/C++ node and select the Language property page.
|
|
|
|
7. Enable the OpenMP Support (/openmp).
|
|
|
|
8. Build the solution.
|
|
|
|
|
2015-06-19 07:51:05 +08:00
|
|
|
### Building with GCC
|
|
|
|
|
|
|
|
```
|
|
|
|
$ gcc gpssim.c -lm -fopenmp -o gps-sdr-sim
|
|
|
|
```
|
|
|
|
|
2015-06-15 09:04:58 +08:00
|
|
|
### Generating the GPS signal file
|
|
|
|
|
2015-07-15 09:00:49 +08:00
|
|
|
A user-defined trajectory can be specified in a CSV file, which contains
|
2015-06-15 09:04:58 +08:00
|
|
|
the Earth-centered Earth-fixed (ECEF) user positions at 10Hz.
|
2015-07-15 09:00:49 +08:00
|
|
|
The user is also able to assign a static location directly through the command line.
|
2015-06-15 09:04:58 +08:00
|
|
|
|
|
|
|
The user specifies the GPS satellite constellation through a GPS broadcast
|
|
|
|
ephemeris file. The daily GPS broadcast ephemers file (brdc) is a merge of the
|
|
|
|
indiviual site navigation files into one. The archive for the daily file is:
|
|
|
|
|
|
|
|
[ftp://cddis.gsfc.nasa.gov/gnss/data/daily/](ftp://cddis.gsfc.nasa.gov/gnss/data/daily/)
|
|
|
|
|
2015-06-23 03:49:43 +08:00
|
|
|
These files are then used to generate the simulated pseudorange and
|
2015-06-15 09:04:58 +08:00
|
|
|
Doppler for the GPS satellites in view. This simulated range data is
|
|
|
|
then used to generate the digitized I/Q samples for the GPS signal.
|
2015-06-27 09:17:50 +08:00
|
|
|
|
|
|
|
The bladeRF command line interface requires I/Q pairs stored as signed
|
2015-08-21 04:32:35 +08:00
|
|
|
16-bit integers, while the hackrf_transfer and gps-sdr-sim-uhd.py
|
|
|
|
supports signed bytes.
|
|
|
|
|
2015-08-21 08:18:05 +08:00
|
|
|
HackRF and bladeRF require 2.6 MHz sample rate, while the USRP2 requires
|
2015-08-21 04:32:35 +08:00
|
|
|
2.5 MHz (an even integral decimator of 100 MHz).
|
2015-06-27 09:17:50 +08:00
|
|
|
|
|
|
|
```
|
|
|
|
Usage: gps-sdr-sim [options]
|
|
|
|
Options:
|
|
|
|
-e <gps_nav> RINEX navigation file for GPS ephemerides (required)
|
2015-07-15 08:40:34 +08:00
|
|
|
-u <user_motion> User motion file (dynamic mode)
|
2015-08-26 16:03:02 +08:00
|
|
|
-g <nmea_gga> NMEA GGA stream (dynamic mode)
|
2015-07-15 08:40:34 +08:00
|
|
|
-l <location> Lat,Lon,Hgt (static mode) e.g. 30.286502,120.032669,100
|
2015-06-27 09:17:50 +08:00
|
|
|
-o <output> I/Q sampling data file (default: gpssim.bin)
|
2015-06-27 09:34:37 +08:00
|
|
|
-s <frequency> Sampling frequency [Hz] (default: 2600000)
|
2015-06-27 09:17:50 +08:00
|
|
|
-b <iq_bits> I/Q data format [8/16] (default: 8)
|
|
|
|
```
|
|
|
|
|
2015-07-15 08:40:34 +08:00
|
|
|
The user motion can be specified in either dynamic or static mode:
|
2015-06-15 09:04:58 +08:00
|
|
|
|
|
|
|
```
|
2015-06-27 09:17:50 +08:00
|
|
|
> gps-sdr-sim -e brdc3540.14n -u circle.csv -b 16
|
2015-06-15 09:04:58 +08:00
|
|
|
```
|
|
|
|
|
2015-08-26 16:03:02 +08:00
|
|
|
```
|
|
|
|
> gps-sdr-sim -e brdc3540.14n -g triumphv3.txt -b 16
|
|
|
|
```
|
|
|
|
|
2015-07-14 23:30:07 +08:00
|
|
|
```
|
|
|
|
> gps-sdr-sim -e brdc3540.14n -l 30.286502,120.032669,100 -b 16
|
|
|
|
```
|
|
|
|
|
2015-06-27 09:17:50 +08:00
|
|
|
### Transmitting the samples
|
2015-06-15 09:04:58 +08:00
|
|
|
|
2015-06-27 09:17:50 +08:00
|
|
|
The TX port of a particular SDR platform is connected to the GPS receiver
|
|
|
|
under test through a DC block and a fixed 50-60dB attenuator.
|
2015-06-15 09:04:58 +08:00
|
|
|
|
|
|
|
The simulated GPS signal file, named "gpssim.bin", can be loaded
|
2015-06-27 09:17:50 +08:00
|
|
|
into the bladeRF for playback as shown below:
|
2015-06-15 09:04:58 +08:00
|
|
|
|
|
|
|
```
|
|
|
|
set frequency 1575.42M
|
2015-06-27 09:17:50 +08:00
|
|
|
set samplerate 2.6M
|
2015-06-15 09:04:58 +08:00
|
|
|
set bandwidth 2.5M
|
|
|
|
set txvga1 -25
|
|
|
|
cal lms
|
|
|
|
cal dc tx
|
|
|
|
tx config file=gpssim.bin format=bin
|
|
|
|
tx start
|
|
|
|
```
|
|
|
|
|
2015-07-21 06:53:43 +08:00
|
|
|
You can also execute these commands via the `bladeRF-cli` script option as below:
|
2015-07-20 15:12:00 +08:00
|
|
|
|
|
|
|
```
|
|
|
|
> bladeRF-cli -s bladerf.script
|
|
|
|
```
|
|
|
|
|
2015-06-27 09:17:50 +08:00
|
|
|
For the HackRF:
|
|
|
|
|
|
|
|
```
|
|
|
|
> hackrf_transfer -t gpssim.bin -f 1575420000 -s 2600000 -a 1 -x 0
|
|
|
|
```
|
|
|
|
|
2015-08-21 04:32:35 +08:00
|
|
|
For UHD supported devices (tested with USRP2 only):
|
|
|
|
|
|
|
|
```
|
|
|
|
> gps-sdr-sim-uhd.py -t gpssim.bin -s 2500000 -x 0
|
|
|
|
```
|
|
|
|
|
|
|
|
|
2015-06-15 09:04:58 +08:00
|
|
|
### License
|
|
|
|
|
|
|
|
Copyright © 2015 Takuji Ebinuma
|
|
|
|
Distributed under the [MIT License](http://www.opensource.org/licenses/mit-license.php).
|