gps-sdr-sim

repository·master·Indexed 25 days ago

https://github.com/osqzss/gps-sdr-sim

A tool for generating GPS baseband signal data streams that can be converted to RF signals using Software Defined Radio (SDR) platforms such as HackRF, bladeRF, ADALM-Pluto, and USRP. It supports static and dynamic user motion modes using RINEX navigation files and provides utilities like NMEA2UM for converting NMEA GGA data to user motion files.

Tokens
3.3K
Snippets
16
Records
19
Agent score
85%

What's inside gps-sdr-sim

  1. Convert NMEA GGA data to GPS-SDR-SIM user motion files with NMEA2UM

    master

    NMEA2UM is a utility used to generate ECEF (Earth-Centered, Earth-Fixed) user motion files required by GPS-SDR-SIM. It processes NMEA GGA data (typically generated by simulation software like LabSat) and converts it into the specific CSV format used for user motion simulation.

    nmea2um <nmea_gga> <user_motion>
  2. Build plutoplayer_win on Windows with Visual Studio 2022

    master

    To build the plutoplayer_win executable, you must first obtain the libiio library. Download the Windows.zip from the Analog Devices libiio releases and extract it.

    Follow these steps in Visual Studio 2022:

    1. Project Setup: Create an empty project for a console application and add the project source files to the Solution Explorer.
    2. Include Directories: In Configuration Properties -> C/C++ -> General -> Additional Include Directories, add the path to the Windows/include folder (to locate iio.h).
    3. Library Directories: In Configuration Properties -> Linker -> General -> Additional Library Directories, add the path to the Windows/Windows-VS-2022-x64 folder (to locate libiio.lib).
    4. Dependencies: In Configuration Properties -> Linker -> Input -> Additional Dependencies, add libiio.lib.
    5. Build Configuration: Set the Solution Configuration to Release and the Solution Platform to X64.
    6. Compile: Run Build -> Build Solution.

    Post-Build: After a successful build, the executable will be in the Release/x64 folder. Copy this executable into the Windows/Windows-VS-2022-x64 folder before running it.

  3. Build plutoplayer for ADALM-Pluto on Linux

    master

    To build the plutoplayer software for ADALM-Pluto, you must first install the required libraries libiio (instructions at https://wiki.analog.com/resources/tools-software/linux-software/libiio) and libad9361. After the libraries are installed, you can build the player using make.

    # Install libad9361
    $ git clone https://github.com/analogdevicesinc/libad9361-iio.git
    $ cd libad9361-iio
    $ cmake ./
    $ make all
    $ sudo make install
    
    # Build plutoplayer
    $ make plutoplayer
  4. Build GPS-SDR-SIM on Windows

    master

    To build the project on Windows, use Visual Studio with the following steps:

    1. Start Visual Studio.
    2. Create an empty project for a console application.
    3. Add gpssim.c and getopt.c to the Source Files folder in the Solution Explorer.
    4. Select Release in the Solution Configurations drop-down list.
    5. Build the solution.
  5. Workflow for generating user motion files using SatGen and NMEA2UM

    master

    To create a custom user motion file for GPS-SDR-SIM, follow these steps:

    1. Route Creation: Sketch a desired route in Google Earth.
    2. Export Path: Save the sketched path as a .kml file.
    3. Simulate NMEA: Load the .kml file into SatGen.
    4. Generate NMEA: Set the output rate to 10Hz and generate an NMEA file.
    5. Convert Format: Use nmea2um to convert the generated NMEA data into the required user motion CSV format.
  6. Configure USER_MOTION_SIZE for large motion files

    master

    By default, user motion files are limited to 30,000 samples (at 10Hz). To use larger files, set the USER_MOTION_SIZE variable to the maximum duration of the motion file in seconds during compilation or via make.

    Using make:

    $ make USER_MOTION_SIZE=4000

    Using GCC:

    $ gcc gpssim.c -lm -O3 -o gps-sdr-sim -DUSER_MOTION_SIZE=4000
  7. Transmit samples using UHD (USRP)

    master

    For UHD supported devices (tested with USRP2), use gps-sdr-sim-uhd.py or the tx_samples_from_file tool. USRP2 requires a sample rate of 2.5MHz.

    Using gps-sdr-sim-uhd.py:

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

    Using tx_samples_from_file:

    > tx_samples_from_file --file gpssim.bin --type short --rate 2500000 --freq 1575420000 --gain 0
  8. Transmit samples using HackRF

    master

    HackRF requires 8-bit signed I/Q samples. Generate the file with -b 8 and use hackrf_transfer to transmit.

    # Generate 8-bit file
    > gps-sdr-sim -e brdc0010.22n -b 8
    
    # Transmit
    > hackrf_transfer -t gpssim.bin -f 1575420000 -s 2600000 -a 1 -x 0
    > hackrf_transfer -t gpssim.bin -f 1575420000 -s 2600000 -a 1 -x 0