GithubHelp home page GithubHelp logo

gps-sdr-sim's Introduction

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 bladeRF, HackRF, and USRP.

Windows build instructions

  1. Start Visual Studio.
  2. Create an empty project for a console application.
  3. On the Solution Explorer at right, add "gpssim.c" and "getopt.c" to the Souce Files folder.
  4. Select "Release" in Solution Configurations drop-down list.
  5. Build the solution.

Building with GCC

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

Generating the GPS signal file

A user-defined trajectory can be specified in either a CSV file, which contains the Earth-centered Earth-fixed (ECEF) user positions, or an NMEA GGA stream. The sampling rate of the user motion has to be 10Hz. The user is also able to assign a static location directly through the command line.

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/

These files are then used to generate the simulated pseudorange and 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.

The bladeRF command line interface requires I/Q pairs stored as signed 16-bit integers, while the hackrf_transfer and gps-sdr-sim-uhd.py supports signed bytes.

HackRF and bladeRF require 2.6 MHz sample rate, while the USRP2 requires 2.5 MHz (an even integral decimator of 100 MHz).

Usage: gps-sdr-sim [options]
Options:
  -e <gps_nav>     RINEX navigation file for GPS ephemerides (required)
  -u <user_motion> User motion file (dynamic mode)
  -g <nmea_gga>    NMEA GGA stream (dynamic mode)
  -l <location>    Lat,Lon,Hgt (static mode) e.g. 30.286502,120.032669,100
  -o <output>      I/Q sampling data file (default: gpssim.bin)
  -s <frequency>   Sampling frequency [Hz] (default: 2600000)
  -b <iq_bits>     I/Q data format [8/16] (default: 8)

The user motion can be specified in either dynamic or static mode:

> gps-sdr-sim -e brdc3540.14n -u circle.csv -b 16
> gps-sdr-sim -e brdc3540.14n -g triumphv3.txt -b 16
> gps-sdr-sim -e brdc3540.14n -l 30.286502,120.032669,100 -b 16

Transmitting the samples

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.

The simulated GPS signal file, named "gpssim.bin", can be loaded into the bladeRF for playback as shown below:

set frequency 1575.42M
set samplerate 2.6M
set bandwidth 2.5M
set txvga1 -25
cal lms
cal dc tx
tx config file=gpssim.bin format=bin
tx start

You can also execute these commands via the bladeRF-cli script option as below:

> bladeRF-cli -s bladerf.script

For the HackRF:

> hackrf_transfer -t gpssim.bin -f 1575420000 -s 2600000 -a 1 -x 0

For UHD supported devices (tested with USRP2 only):

> gps-sdr-sim-uhd.py -t gpssim.bin -s 2500000 -x 0

License

Copyright © 2015 Takuji Ebinuma
Distributed under the MIT License.

gps-sdr-sim's People

Contributors

osqzss avatar laf0rge avatar scateu avatar kaback avatar edy555 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.