Introduction
In this example, you use an ADALM-PLUTO radio to perform over-the-air transmission of a composite GPS signal. To generate a composite GPS signal, follow these steps
Get legacy GPS waveforms from multiple satellites. For more information about how to set the various parameters required to generate a GPS baseband waveform, see the GPS Waveform Generation example.
Add Doppler shift and delay to each satellite waveform, and form the composite signal.
This ADALM-PLUTO radio transmits the GPS baseband waveform in repeat mode. The same ADALM-PLUTO radio can receive the transmitted GPS signal to perform acquisition, and track the code phase and carrier frequency of the satellites detected from the acquisition operation. The acquisition and tracking shown in this example are for GPS signals that contain coarse acquisition (C/A) codes. To set up the hardware, follow the instructions on the Installation and Setup page.
You can also explore the GPS Receiver Acquisition and Tracking Using C/A-Code example for a simulation example that does not require any hardware.
This figure outlines the process of GPS signal transmission and reception.
This example consists of these sections.
Configure Simulation Parameters — Set various parameters to generate the waveform, and configure the GPS receiver.
Generate GPS Waveform — Generate GPS waveforms from multiple satellites, add delay, Doppler shift, and noise.
Configure PlutoSDR — Configure Pluto radio sample rate, center frequency, and other parameters for transmission and reception.
Acquisition and Tracking — Find the visible satellites and calculate coarse values of Doppler frequency offset and timing offset. Track the changing Doppler offset and code phase of the incoming signal.
Configure Simulation Parameters
Configure the simulation parameters by following these steps.
1. Set the control flag ShowVisualizations to true. This enables you to see all the output plots. Specify the number of GPS satellites to include in your waveform.
2. Specify the pseudorandom noise (PRN) identification numbers (ID) for the satellites visible to the receiver. The length of PRNIDs must be equal to or greater than the number of specified satellites numSat. If the length of PRINDs is greater than the value of numSat, this example considers only the first N elements of PRINDs for simulation, where N is the value of numSat.
3. Specify the number of data bits NumNavDataBits. Use the NumNavDataBits value to generate a GPS waveform for a specified number of data bits of navigation data. In general, the entire GPS legacy navigation data consists of 25 frames. Each frame comprises 1500 bits. This navigation data contains the ephemeris, clock, and almanac information. Because generating a waveform of this size can take a lot of time, this example generates the GPS waveform for a NumNavDataBits value of 200 bits.
4. Set the bit starting index of the navigation data NavDataBitStartIndex. Use NavDataBitStartIndex to generate a GPS waveform from a random index of the navigation data.
5. Set the sample rate at which to transmit GPS waveform.
6. Set the signal-delay values. Each satellite is a different distance from the GPS receiver. Therefore, the delay introduced on each signal is different for each satellite. Specify the number of C/A code chips delay for each satellite as a column vector. Delay values can be fractional because transmission time is not likely to be an integer multiple of the C/A code chip duration of 0.9775 microseconds.
7. Set the Doppler shift and Doppler rate. Because the velocity and position of each satellite is different, the Doppler shift and Doppler rate introduced for each satellite is also different. This example models Doppler shift as a sinusoidally varying frequency offset. For more information about latency and Doppler shift in a satellite scenario, see the Calculate Latency and Doppler in a Satellite Scenario example.
Receiver Configuration
To Configure the GPS receiver, set these parameters.
1. Set noise bandwidth for frequency-locked loops (FLLs), phase-locked loops (PLLs), and delay-locked loops (DLLs).
In GPS receivers, tracking algorithms track frequency, phase, and delay using frequency-locked loops (FLLs), phase-locked loops (PLLs), and delay-locked loops (DLLs), respectively. A wider loop bandwidth enables faster tracking, but can cause you to lose lock at low SNRs. A narrower loop bandwidth performs well at low SNRs, but tracks phase, frequency, and delay changes more slowly. For more information on interpreting these properties, see the Acquisition and Tracking section of this example.
2. Set the PLL integration time to 1 millisecond.
Generate GPS Waveform
A GPS waveform contains Precision-code (P-code) on the in-phase branch and C/A code on the quadrature-phase branch. In general, a GPS satellite transmits the waveform on the L1 frequency (1575.42 MHz). However, this example sets the transmitting frequency to 2.41 GHz to avoid interfering with real-time GPS signals. For more details about the GPS data generated in this example, see the IS-GPS-200 standard [1].
This example generates a GPS baseband waveform for each satellite, models the delay of each satellite signal independently, and combines all signals to generate the composite signal. Generate a GPS waveform by following these steps.
1. Set the number of extra navigation data bits for delay modeling numBitsForDelay. Setting numBitsForDelay to 1 introduces a maximum of 20 milliseconds into the signal. To introduce higher delay values, increase numBitsForDelay by an integer value.
2. Create a HelperGPSNavigationConfig object to generate a legacy GPS waveform for each satellite. Each HelperGPSNavigationConfig object contains the information transmitted by a satellite. Because the focus of this example is explaining acquisition and tracking operations, rather than decoding data, this example keeps the parameters constant for all satellites.
Configure PlutoSDR
Configure a Pluto radio transmitter by setting the sample rate, transmission frequency, transmitter gain.
## Establishing connection to hardware. This process can take several seconds.
## Waveform transmission has started successfully and will repeat indefinitely.
## Call the release method to stop the transmission.
Configure Pluto radio receiver by setting the receiving center frequency and the number of samples for each received frame. Set the sample rate of the receiver equal to the transmitter sample rate as the same radio performs both transmission and reception.
## Establishing connection to hardware. This process can take several seconds.
Acquisition and Tracking
The Acquisition module detects all visible satellites and estimates the coarse Doppler shift and coarse time offset in the received signal from each satellite. This example assumes the receiver begins in cold start mode, and starts its search by looking for all 32 GPS satellites.
The tracking module compensates for the Doppler shift and code phase offset, that remain after acquisition. You must track these three parameters: carrier frequency, carrier phase, and code delay. To track each parameter use the feedback loops. Track carrier frequency by using FLL, track phase by using PLL, and track delay (code phase offset) by using DLL.
For more information about GPS receiver starting modes, the acquisition algorithm using, and using FLL, PLL, DLL, see the GPS Receiver Acquisition and Tracking Using C/A-Code example.
To perform acquisition, initialize the gnssSignalAcquirer object and configure its properties.
initialsync =
gnssSignalAcquirer with properties:
GNSSSignalType: "GPS C/A"
SampleRate: 3410000
IntermediateFrequency: 0
FrequencyRange: [-10000 10000]
FrequencyResolution: 500
DetectionThresholdFactor: 1.9000
Initialize the parameters required for tracking. Perform acquisition to find and track the visible satellites.
The detected satellite PRN IDs: 2 8 11 4
Plot the tracking loop results. The estimated phase error does not converge until the frequency locked loop converges. You can expect this behavior because the error in frequency causes an error in phase. Also, the outputs of PLL and FLL seem to change with time because of the changing Doppler shift.
After tracking, plot the constellation of the signal.
If constellation points appear at the center in a constellation diagram, they correspond to the false detection of a satellite from the acquisition algorithm.
Further Exploration
This example has shown you how to perform GPS signal acquisition and tracking for four GPS satellites and using an ADALM-Pluto radio for over-the-air transmission. To explore further, try these variations:
Increase the number of visible GPS satellites and observe the results. Initialize the Doppler, SNR, and delay appropriately.
Simulate real-time GPS signal, by scaling the GPS signal amplitude below the noise floor, and check the acquisition and tracking using the ADALM-PLUTO radio.
Perform position estimation with the SDR device. You may need to use two PlutoSDR devices (one for transmission and another for reception). For more information on position estimation, see the End-to-End GPS Legacy Navigation Receiver Using C/A-Code example.
Appendix
This example uses these data and helper files:
References
[1] IS-GPS-200, Rev: L. NAVSTAR GPS Space Segment/Navigation User Segment Interfaces. May 14, 2020; Code Ident: 66RP1.