Main Content

GPS HDL Reference Applications Overview

Wireless HDL Toolbox™ contains examples that implement global positioning system (GPS) receiver algorithms in Simulink®. The following are the list of available examples:

  • GPS HDL Acquisition and Tracking Using C/A Code: This example performs acquisition and tracking on a GPS baseband waveform. Acquisition computes the coarse estimates of Doppler frequency offset and C/A code phase offset. It also detects the pseudo random noise IDs (PRNIDs) of satellites that are present in the GPS waveform. Tracking fine-tunes the estimates and corrects them to recover the legacy navigation (LNAV) symbols.

  • GPS HDL Data Decode: This example performs bit synchronization, frame synchronization, and data decoding on the LNAV symbols. You can use the GPS HDL Acquisition and Tracking Using C/A Code example to extract the LNAV symbols. The extracted LNAV symbols are decoded to obtain GPS navigation message and then extract GPS parameters from the navigation message.

Construct GPS Receiver Model

You can integrate the GPS HDL Acquisition and Tracking Using C/A Code and GPS HDL Data Decode examples and generate the HDL code. The following section provides the steps on how to integrate the Simulink models in these examples and generate the HDL code for the integrated model.

Copy Files

  1. Open the GPS HDL Acquisition and Tracking Using C/A Code example and click Open Script to open its example folder.

  2. Copy the files from this example folder to a new folder and name it as GPS HDL Receiver.

  3. Open the GPS HDL Data Decode example and click Open Script to open its example folder.

  4. Copy the files from this example folder to the GPS HDL Receiver folder.

Now, the GPS HDL Receiver folder contains all the files related to GPS HDL Acquisition and Tracking Using C/A Code and GPS HDL Data Decode examples.

Create GPS HDL Receiver Model

  1. In Simulink, open a new model and save it as gpshdlReceiver.slx in the GPS HDL Receiver folder.

  2. Open the gpshdlAcquisitionTracking model in the GPS HDL Receiver folder.

  3. Except the Diagnostic Decoder subsystem, copy the Input Configuration and Acquisition and Tracking subsystems along with the connecting input blocks to the gpshdlReceiver model.

  4. Open the gpshdlDataDecode model in the GPS HDL Receiver folder.

  5. Except the input blocks to the Data Decode subsystem, copy the Data Decode and Prepare Outputs subsystems till the To Workspace blocks to the gpshdlReceiver model.

  6. Close the gpshdlAcquisitionTracking and gpshdlDataDecode models.

  7. Connect the lnavSym and valid output ports of the Acquisition and Tracking subsystem to the lnavSym and valid input ports of the Data Decode subsystem.

  8. Connect each of the PRNID, coarseDopplerOffset, and fineDopplerOffset output ports of the Acquisition and Tracking subsystem to a Terminator block.

  9. Connect the coarseCodePhOffset and fineCodePhOffset output ports of the Acquisition and Tracking subsystem to an Add block with +- signs to compute the code phase offset.

  10. Connect the Add block output to a To Workspace block with a variable name codePhOffset.

  11. Connect the input reset signal of the Acquisition and Tracking subsystem to an Upsample block and set the Upsample factor, L parameter to param.modelUpSampFac.

  12. Add a Constant block and set the Constant value parameter to false(numSatDataDecode,1).

  13. Connect the Constant block output and the Upsample block output to a Logical Operator block with OR logic.

  14. Connect the Logical Operator block output to the reset input port of the Data Decode subsystem and also to the Delay block, which is connected to the reset input port of Prepare Outputs subsystem.

  15. Run this command in the MATLAB command prompt to avoid storing all the simulation outputs into a single variable and also ignore precision loss of parameters in the model:

    set_param('gpshdlReceiver','ReturnWorkspaceOutputs','off','ParameterPrecisionLossMsg','off')

This is how your model looks after you complete the above steps successfully.

Initialize GPS HDL Receiver Model

  1. Open and run the gpshdlDataDecodeInit script and then run the gpshdlAcquisitionAndTrackingUsingCACodeInit script from the GPS HDL Receiver folder.

  2. In the gpshdlReceiver model, set the Stop Time parameter to stopTime.

  3. In the SIMULATION > SIMULATE tab, change the simulation mode from Normal to Accelerator.

  4. Select the area in the gpshdlReceiver model, shown with the shaded region in the figure, right-click and select Create Subsystem. Name the subsystem as HDL DUT.

  5. Run the hdlsetup('gpshdlReceiver') command in the MATLAB command prompt to setup the model for HDL code generation.

Because the Acquisition and Tracking subsystem runs at a high sample rate of 196.608 Msps and the Data Decode subsystem runs at a very low sample rate of 50 samples-per-second, the model takes long time to simulate. So, it is suggested to use this model only for HDL code generation.

To generate HDL code and HDL test bench for the gpshdlReceiver model, use makehdl and makehdltb functions with the HDL DUT subsystem. This table shows the post place and route resource utilization when synthesized for a Xilinx® Zynq®- 7000 ZC706 evaluation board. The maximum frequency of operation is 204.12 MHz.

ResourcesUsage
Slice LUT80,643
Slice Registers101,230
DSP48257
RAMB36160
RAMB1850

Related Topics