Main Content

gpsL1CCodes

Generate ranging and overlay codes for GPS L1C

Since R2024a

    Description

    [L1CD,L1CP,L1CO] = gpsL1CCodes(PRNID) generates ranging codes and overlay codes, as specified in the modernized Global Positioning System (GPS) L1 civil (L1C) standard IS-GPS-800 section 3.2.2 [1], for the satellite pseudo-random noise (PRN) indices specified in PRNID. The function returns the ranging codes for the data and pilot, L1CD and L1CP, respectively, and the overlay code L1CO.

    For more information, see Algorithms.

    example

    Examples

    collapse all

    Generate the ranging codes and overlay codes for GPS L1C and Quasi-Zenith satellite system (QZSS) signals.

    Generate GPS L1C Ranging and Overlay Codes

    Specify the PRN IDs for the GPS satellites.

    PRNID = [4; 70];

    Generate the ranging and overlay codes for the set PRN IDs.

    [l1cd,l1cp,l1co] = gpsL1CCodes(PRNID);

    Generate QZSS Data Ranging Codes

    Specify the PRN IDs reserved for QZSS satellites.

    PRNID = [193:200];

    Generate the data ranging codes for the set PRN IDs.

    l1cd_qzss = gpsL1CCodes(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 and overlay codes for a specific PRNID, refer to these tables in GPS L1C standard IS-GPS-800 [1].

    • PRN ID in the range [1, 63] — Table 3.2-2 for data and pilot ranging codes, and Table 3.2-3 for overlay codes.

    • PRN ID in the range [64, 210] — Table 6.3-1 for additional data and pilot codes, and Table 6.3-2 for additional overlay codes.

    Data Types: double | uint8

    Output Arguments

    collapse all

    Data ranging codes, returned as a matrix. The number of rows in the matrix, 10,230, corresponds to 10 milliseconds of the ranging code. The number of columns is equal to the length of PRNID.

    Each column of L1CD contains the ranging code used to spread the data of the L1C satellite signal specified by the corresponding element of PRNID.

    For more information, see Algorithms.

    Data Types: logical

    Pilot ranging codes, returned as a matrix. The number of rows in the matrix, 10,230, corresponds to 10 milliseconds of the ranging code. The number of columns is equal to the length of PRNID.

    Each column of L1CP contains the ranging code used to spread the pilot of the L1C satellite signal specified by the corresponding element of PRNID.

    For more information, see Algorithms.

    Data Types: logical

    Overlay code, returned as a matrix. The number of rows in the matrix is 1,800 and the number of columns is equal to the length of PRNID.

    Each column of L1CO contains the overlay code for the corresponding PRNID. Overlay code modulates the pilot ranging code.

    For more information, see Algorithms.

    Data Types: logical

    Algorithms

    GPS L1C is a modernized civil navigation signal transmitted on the L1 band at 1575.42 MHz. GPS L1C uses the binary offset carrier (BOC) modulation scheme.

    You can generate an L1C waveform by following these steps.

    1. Generate data, as defined in IS-GPS-800.

    2. Spread the data by using the ranging codes, as defined in IS-GPS-800. L1C uses two types of ranging codes: a ranging code for the data (L1CD code) and a ranging code for the pilot (L1CP code). The chip rate of both the L1CD and L1CP codes is 1.023 mega chips per second with 10 milliseconds in length. Therefore, the number of chips before repeating is 10,230.

    3. Modulate the L1CD code with the user data bits to obtain the data component. The rate of the user data bits is 100 bits per second.

    4. Modulate the L1CP code with the overlay code (L1CO code) to obtain the pilot component. The rate of the L1CO code is 100 bits per second.

    5. Modulate the data component by using BOC (1,1).

    6. Modulate the pilot component by using the time-multiplexed BOC (TMBOC) modulation technique.

    This figure shows the process to generate an L1C waveform.

    L1C waveform generation waveform - Data ranging code is modulated with user data, and the pilot ranging code is modulated with overlay code. Modulate the data component using BOC modulation and the pilot component using TMBOC modulation. Combine these two modulated components to achieve a GPS L1C waveform.

    References

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

    Extended Capabilities

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

    Version History

    Introduced in R2024a