Main Content

gpsL5Codes

Generate ranging codes for GPS L5

Since R2024b

    Description

    [i5code,q5code] = gpsL5Codes(prnid) generates an in-phase L5 code, i5code, and quadrature-phase L5 code, q5code, for the satellite pseudo-random noise (PRN) indices specified in PRNIprnid. The function generates the ranging codes as specified in the modernized Global Positioning System (GPS) L5 standard IS-GPS-705.

    example

    Examples

    collapse all

    Generate in-phase (I5) and quadrature-phase (Q5) codes for GPS L5 signal.

    Specify the PRN IDs for the GPS satellites.

    prnid = [1; 5];

    Generate the I5 and Q5 codes.

    [i5,q5] = gpsL5Codes(prnid);

    Input Arguments

    collapse all

    GPS satellite PRN index, specified as one of these options.

    • Integer in the range [1, 210] — Use this option to input a PRN index for a single satellite.

    • Vector of integers in the range [1, 210] — Use this option to input PRN indices for multiple satellites.

    For details on how to generate these ranging I5 and Q5 codes for a specific PRNID, refer to these tables in the GPS L5 standard IS-GPS-705 [1].

    • PRN ID in the range [1, 63] — Tables 3-Ⅰa and 3-Ⅱa

    • PRN ID in the range [64, 210] — Table 6-Ⅱ

    Data Types: double | uint8

    Output Arguments

    collapse all

    I5 ranging codes, returned as a matrix. The matrix always contains 10,230 rows, and the number of columns is equal to the length of prnid.

    Each column of this matrix contains the ranging code used to spread the in-phase component of the L5 signal of the satellite specified by its corresponding prnid.

    For more information, see Algorithms.

    Data Types: logical

    Q5 ranging codes, returned as a matrix. The matrix always contains 10,230 rows, and the number of columns is equal to the length of prnid.

    Each column of this matrix contains the ranging code used to spread the quadrature-phase component of the L5 signal of the satellite specified by its corresponding prnid.

    For more information, see Algorithms.

    Data Types: logical

    Algorithms

    GPS L5 is a modernized civil navigation signal transmitted on the L5 band at 1176.45 MHz. You can generate an L5 waveform by following these steps.

    1. Generate GPS L5 CNAV data, as defined in IS-GPS-705 standard.

    2. Generate the ranging code for in-phase (I5-code) and quadrature-phase (Q5-code) components separately, as described in the standard.

      Both I5 and Q5-code are at 10.23MHz chip rate and repeat after every 10230 chips. Hence, each code block is of 1 millisecond duration.

    3. The GPS L5 data is at 100 bits per second. XOR each data bit with 10 Newman Huffman code bits for I-branch. This makes the output after this XOR operation to be at 1 kilo baud, meaning every bit will be of 1 millisecond duration, which is equal to one code block of spreading code.

    4. XOR the 1 millisecond bit from the output of step 3 with I5-code block. Map bit 0 to +1/sqrt(2) and bit 1 to -1/sqrt(2) to get the in-phase branch signal component of the final waveform.

    5. Generate 20 bits of Newman Huffman code for Q-branch which is at 1 kilo baud.

    6. XOR each Q5-code block with the Newman Huffman code. Map bit 0 to +1/sqrt(2) and bit 1 to -1/sqrt(2) to get the quadrature-phase branch signal component of the final waveform.

    7. The final IQ waveform formed is the baseband GPS L5 waveform.

    L5 waveform generation - Generate I and Q signal components to form the final GPS L5 waveform.

    Alternatively, use gpsWaveformGenerator object to directly create a GPS L5 waveform.

    References

    [1] IS-GPS-705, Rev:J. "NAVSTAR GPS Space Segment/User segment L5 Interfaces." Aug 22, 2022.

    Extended Capabilities

    expand all

    C/C++ Code Generation
    Generate C and C++ code using MATLAB® Coder™.

    Version History

    Introduced in R2024b