Sylphase SDGPS
The software-defined GPS(/GNSS) toolkit
Synchronizing to GPSDO and system time

Example 1: Phase locking the internal OCXO to GPS time from the GPSDO antenna port and aligning the initial GNSS simulation time to the host system time

The following example demonstrates:

  • Simulating a static trajectory on a single antenna.
  • Aligning the initial GNSS simulation time to the host system time.
  • Phase locking the internal OCXO to GPS time from the GPSDO antenna port.
    • Note: The use of static-kf2 assumes that the antenna connected to the GPSDO antenna port is stationary.
    • Note: The initial phase offset between GNSS simulation time and GPS time remains present throughout the entire simulation, and deviations from it will typically be on the order of ±1 ns (as long as the simulator's internal GNSS receiver maintains a GNSS fix).
mkdir -p simlog && LOGPREFIX=simlog/$(date +%s) && mkdir "$LOGPREFIX" && \
sdgps \
    generate-simple-trajectory --rate inf --position-ecef '[-3884259, 4607249, 2082592]' \
    ! shift-gnss-time --start-now-coordinated-via "$LOGPREFIX"/start_gps_time \
    ! simulate-raw sylphase-simulator: --cn0 40 --start-stream-time 0 \
    ! sylphase-simulator-txrx --antenna-lna-gain 25 \
        --start-tx-coordinated-via "$LOGPREFIX"/start_gps_time \
    ! tracker \
    ! decoder \
    ! static-kf2 --abort-signals-ignored-for 2 --p-log 1e-9 --p-ignore 1e-12 \
    ! gpsdo --force-zero-frequency-offset --disable-fast-slew

In the above pipeline:

  • The shift-gnss-time node has the --start-now-coordinated-via FILENAME option:
Option Description
--start-now-coordinated-via FILENAME --start-now, but allow for synchronizing multiple shift-gnss-time nodes; synchronization is coordinated via the provided FILENAME, which must initially either not exist or be empty

Startup process:
1. The first shift-gnss-time node to start up will atomically write its START_TIME to FILENAME
2. Additional shift-gnss-time nodes will read their START_TIME from FILENAME

... which samples CLOCK_REALTIME and writes its value (converted to GNSS time) to FILENAME, which is read by the sylphase-simulator-txrx node below.

  • The sylphase-simulator-txrx node has the --start-tx-coordinated-via FILENAME option, which makes the simulator start transmitting such that the first sample in the raw stream coincides with the instant where the system CLOCK_REALTIME clock's value, converted from UTC to GNSS time, is equal to the GNSS time value read from FILENAME.
  • Note: The sylphase-simulator-txrx node is used (instead of the more standard sylphase-simulator node), in order to enable the simulator's internal GNSS receiver, which is fed from the "GPSDO antenna" port and used for GPSDO functionality.
  • Note: The pipeline prior to the sylphase-simulator-txrx node is a normal simulator pipeline.
  • The portion of the pipeline after the sylphase-simulator-txrx node enables GPSDO functionality, which phase locks the internal OCXO to GPS time.
  • The GPSDO functionality has been enabled and will phase lock the internal OCXO once static-kf2 obtains a GNSS fix.