Main Content

gnssSignalTracker

Track phase, frequency, and delay offsets in GNSS signal

Since R2023b

Description

The gnssSignalTracker System object™ tracks the phase, frequency, and delay offsets of a global navigation satellite system (GNSS) signal. This object uses a phase locked loop (PLL), frequency locked loop (FLL), and delay locked loop (DLL) to track phase, frequency, and code phase, respectively, in the incoming signal. The object supports tracking these GNSS signals.

  • GPS — Global Positioning System for course acquisition codes (C/A-codes) [1], L1 civil (L1C)-Data codes [2], and L5 codes [5]

  • NavIC — Navigation with Indian Constellation for C/A-codes [3]

  • QZSS — Quasi-Zenith Satellite System for C/A-codes [4]

To track the phase, frequency, and delay offsets of a GNSS signal:

  1. Create the gnssSignalTracker object and set its properties.

  2. Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects?

Creation

Description

gst = gnssSignalTracker creates a default GNSS signal tracker System object.

example

gst = gnssSignalTracker(Name,Value) sets properties using one or more name-value arguments. For example, gnssSignalTracker(GNSSSignalType="QZSS C/A") sets the type of GNSS signal to "QZSS C/A".

example

Properties

expand all

Unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the release function unlocks them.

If a property is tunable, you can change its value at any time.

For more information on changing property values, see System Design in MATLAB Using System Objects.

Type of GNSS signal, specified as one of these options.

  • "GPS C/A"

  • "GPS L1CD"

  • "GPS L5I"

  • "GPS L5Q"

  • "NavIC L5 C/A"

  • "NavIC S C/A"

  • "QZSS C/A"

Data Types: char | string

Sample rate of the input signal in hertz, specified as a scalar greater than or equal to 1000.

Data Types: double

Center frequency of the input signal in hertz, specified as a nonnegative scalar.

Data Types: double

Integration time in seconds, specified as a numeric scalar. The value must be an integer multiple of 1e–3, and must be in the range [1e–3, 20e–3], corresponding to 1 to 20 milliseconds.

When you set GNSSSignalType property to these values, IntegrationTime property is not visible:

  • "GPS L1CD" — The object sets the IntegrationTime property to 10e-3 internally.

  • "GPS L5I" or "GPS L5Q" — The object sets the IntegrationTime property to 1e-3 internally.

Tunable: Yes

Data Types: double

Pseudo-random noise (PRN) IDs of the satellites to track, specified as one of these options.

  • Scalar — Use this option to input a PRN ID for a single satellite.

  • Vector — Use this option to input PRN IDs for multiple satellites. Each element in the vector creates a new receiver tracking channel.

    The object supports tracking of a maximum of eight satellites. Hence, the length of PRNID must be less than or equal to 8.

The PRN ID value depends on the GNSSSignalType property value.

  • If GNSSSignalType is set to "GPS C/A", "GPS L1CD", "GPS L5I", or "GPS L5Q" — Each element in PRNID must be an integer in the range [1, 210].

  • If GNSSSignalType is set to "NavIC L5 C/A" or "NavIC S C/A" — Each element in PRNID must be an integer in the range [1, 14].

  • If GNSSSignalType is set to "QZSS C/A" — Each element in PRNID must be an integer in the range [183, 202].

Data Types: double | uint8

Initial code phase offset of the tracking satellites, specified as one of these options.

  • Scalar in the range [0, 10230] — Use this option to assign the same offset value to each tracking channel.

  • Vector with elements in the range [0, 10230] — Use this option to assign an individual offset value to each tracking channel. The length of the vector must be equal to the length of PRNID.

The initial code phase offset value depends on the GNSSSignalType property value.

  • If GNSSSignalType is set to "GPS C/A", "NavIC L5 C/A", "NavIC S C/A", or "QZSS C/A" — Each element in InitialCodePhaseOffset must be an integer in the range [0, 1023].

  • If GNSSSignalType is set to "GPS L1CD", "GPS L5I", or "GPS L5Q" — Each element in InitialCodePhaseOffset must be an integer in the range [0, 10230].

The initial code phase offset consists of the estimated delay from the acquisition block, in number of ranging code chips.

Data Types: double

Initial frequency offset of the tracking satellites in hertz, specified as one of these options.

  • Scalar — Use this option to assign the same offset value to each tracking channel.

  • Vector — Use this option to assign an individual offset value to each tracking channel. The length of the vector must be equal to the length of PRNID.

You can initialize this offset value from the acquisition block.

Data Types: double

Option to disable the PLL, specified as a numeric or logical value of 0 (false) or 1 (true). Set this value to true to indicate the PLL is disabled.

You can specify the property using one of these options.

  • Scalar — Use this option to assign the same value to each tracking channel.

  • Vector — Use this option to assign an individual value to each tracking channel. The length of the vector must be equal to the length of PRNID.

Tunable: Yes

Data Types: logical

Order of the PLL, specified as 1, 2, or 3.

The property can be specified as a one of these options.

  • Scalar — Use this option to assign the same value to each tracking channel.

  • Vector — Use this option to assign an individual value to each tracking channel. The length of the vector must be equal to the length of PRNID.

Data Types: double | uint8

Noise bandwidth of the PLL in hertz, specified as one of these options.

  • Scalar — Use this option to assign the same value to each tracking channel.

  • Vector — Use this option to assign an individual value to each tracking channel. The length of the vector must be equal to the length of PRNID.

Tunable: Yes

Data Types: double

Option to disable the FLL, specified as a numeric or logical value of 0 (false) or 1 (true). Set this value to true to indicate the FLL is disabled.

The property can be specified as a one of these options.

  • Scalar — Use this option to assign the same value to each tracking channel.

  • Vector — Use this option to assign an individual value to each tracking channel. The length of the vector must be equal to the length of PRNID.

Tunable: Yes

Data Types: logical

Order of the FLL, specified as 1 or 2.

The property can be specified as a one of these options.

  • Scalar — Use this option to assign the same value to each tracking channel.

  • Vector — Use this option to assign an individual value to each tracking channel. The length of the vector must be equal to the length of PRNID.

Data Types: double | uint8

Noise bandwidth of the FLL in hertz, specified as one of these options.

  • Scalar — Use this option to assign the same value to each tracking channel.

  • Vector — Use this option to assign an individual value to each tracking channel. The length of the vector must be equal to the length of PRNID.

Tunable: Yes

Data Types: double

Order of the DLL, specified as 1 or 2.

The property can be specified as a one of these options.

  • Scalar — Use this option to assign the same value to each tracking channel.

  • Vector — Use this option to assign an individual value to each tracking channel. The length of the vector must be equal to the length of PRNID.

Data Types: double | uint8

Noise bandwidth of the DLL in hertz, specified as one of these options.

  • Scalar — Use this option to assign the same value to each tracking channel.

  • Vector — Use this option to assign an individual value to each tracking channel. The length of the vector must be equal to the length of PRNID.

Tunable: Yes

Data Types: double

Usage

Description

[trackedWave,trackInfo] = gst(signal) tracks the phase, frequency, and delay in the input waveform signal, and returns the integrated version of the signal trackedWave, after correcting the respective phase, frequency, and delay errors. trackInfo is returned as a structure which contains tracking information of the phase, frequency, and delay of the integrated output signal.

This object implements the tracking algorithms specified in [6].

Input Arguments

expand all

Input waveform, specified as a column vector.

signal can be of any length, but gst performs signal integration on SampleRate*IntegrationTime number of samples. signal can be a complex baseband signal or a real intermediate frequency (IF) signal, depending on the value of IntermediateFrequency.

Data Types: double
Complex Number Support: Yes

Output Arguments

expand all

Integrated output signal, returned as a matrix of the same precision type as the input.

Each row of the matrix represents the integrated value of signal for the set IntegrationTime. Each column of the matrix represents the tracked values for the corresponding PRN IDs. Hence, the number of columns is equal to the length of PRNID. Each column in the matrix is of length equal to floor(size(signal,1)/(SampleRate*IntegrationTime)).

Complex Number Support: Yes

Tracking information, returned as a structure containing these fields.

FieldDescription
PhaseError

Output of the phase discriminator in the PLL that contains the residual error in the phase of the signal.

PhaseEstimate

Output of the numerically controlled oscillator (NCO) of the PLL that contains the phase offset estimate.

FrequencyError

Output of the frequency discriminator in the FLL that contains the residual error in the frequency of the signal.

FrequencyEstimate

Output of the NCO of the FLL that contains the frequency offset estimate.

DelayError

Output of the early-late discriminator in the DLL that contains the residual error in the delay of the signal.

DelayEstimate

Output of the NCO of the DLL that contains the delay estimate.

All fields of the structure have the same data precision and length as that of the trackedWave.

Object Functions

To use an object function, specify the System object as the first input argument. For example, to release system resources of a System object named obj, use this syntax:

release(obj)

expand all

stepRun System object algorithm
releaseRelease resources and allow changes to System object property values and input characteristics
cloneCreate duplicate System object
isLockedDetermine if System object is in use
resetReset internal states of System object

Examples

collapse all

Generate a waveform from four GPS satellites without any impairments, and track the signal.

Initialize the configuration parameters.

numsat = 4;
PRNIDs = [7; 11; 20; 28];
SampleRate = 5e6;                    % In samples/sec
upfac = SampleRate/1.023e6;
numSamples = round(SampleRate*1e-3);   

Generate the spreading code with the help of the gnssCACode function.

cacode = 1 - 2*double(gnssCACode(PRNIDs,"GPS"));
[u,d] = rat(upfac);
idx = 1:d:u*size(cacode,1);
upcacode = cacode(ceil(idx/u),:);
upcacode = upcacode(1:numSamples,:);
pcoderand = (1-2*repmat([1; 0],size(upcacode,1)/2,1))/sqrt(2);  

Generate random data for 20 bits.

numBits = 20;                             % Generate waveform for 20 bits
numCACodeBlocksPerBit = 20;
data = 1 -  2*randi([0 1],numBits,1);
numsteps = numBits*numCACodeBlocksPerBit; 

Create the tracking object and set its properties.

gst = gnssSignalTracker(PRNID=PRNIDs,SampleRate=SampleRate);
tr = zeros(numsteps,numsat);
trinfo = struct("PhaseError",[],"PhaseEstimate",[],"FrequencyError",[],"FrequencyEstimate",[], ...
                "DelayError",[],"DelayEstimate",[]);  

Generate the waveform in a loop and track it.

for istep = 1:numsteps
     % Generate waveform
     bitidx = floor((istep-1)/numCACodeBlocksPerBit) + 1;
     iqsig = (pcoderand + 1j*upcacode).*data(bitidx);
     waveform = sum(iqsig,2);
   
     % Track generated waveform
     [tr(istep,:),trinfo(istep)] = gst(waveform);
end

Plot the constellation of the tracking output. While the loops are converging, frequency offset varies in the signal. You can observe this in the phase offset in the plot.

scatterplot(tr(:))

Figure Scatter Plot contains an axes object. The axes object with title Scatter plot, xlabel In-Phase, ylabel Quadrature contains a line object which displays its values using only markers. This object represents Channel 1.

Acquire and track a GPS L5 waveform at a sampling rate of 15MHz.

Load a precomputed GPS waveform.

load gnssWaveforms

Create and initialize the GNSS acquirer object.

fs = 15e6;                                            % Sample rate
gsa = gnssSignalAcquirer(GNSSSignalType="GPS L5I", ...
    SampleRate=fs);

Search for 32 GPS satellite PRN IDs, and display the frequency offset, code-phase offset, and the detection status of a satellite for each PRN ID.

acqtable = gsa(gpsL5BBWaveform,1:32)
acqtable=32×4 table
    PRNID    FrequencyOffset    CodePhaseOffset    IsDetected
    _____    _______________    _______________    __________

     27            7500               4092           true    
     30            9000               5115           true    
     10            5500               1023           true    
     23            1000               3069           true    
     17            3500               2046           true    
     26           -7000             6588.8           false   
      5            3000             1765.7           false   
      2           -4000             7049.2           false   
      9            6500             1867.3           false   
     32           -5500             3867.6           false   
     28               0             9366.6           false   
     21           -7000             3015.8           false   
      4           10000             3051.3           false   
     31            6000             8055.1           false   
      1            1500             1449.9           false   
      8           10000              10031           false   
      ⋮

Create and initialize the GNSS tracker object.

gst = gnssSignalTracker(GNSSSignalType="GPS L5I", ...
    SampleRate=fs,PRNID=acqtable.PRNID(acqtable.IsDetected), ...
    InitialCodePhaseOffset=acqtable.PRNID(acqtable.IsDetected), ...
    InitialFrequencyOffset=acqtable.FrequencyOffset(acqtable.IsDetected))
gst = 
  gnssSignalTracker with properties:

           GNSSSignalType: "GPS L5I"
               SampleRate: 15000000
    IntermediateFrequency: 0

  Use get to show all properties

Track the GPS L5 waveform.

[trout,trinfo] = gst(gpsL5BBWaveform)
trout = 2×5 complex
102 ×

   0.0062 - 0.0948i  -0.0267 + 0.0356i  -0.0378 + 0.0154i  -0.1126 + 0.0604i   0.0076 - 0.0181i
   0.4090 + 0.9648i   0.0450 + 1.5401i  -0.5548 + 1.6733i  -1.3840 - 0.0699i  -1.0065 - 1.6525i

trinfo = struct with fields:
           PhaseError: [2x5 double]
        PhaseEstimate: [2x5 double]
       FrequencyError: [2x5 double]
    FrequencyEstimate: [2x5 double]
           DelayError: [2x5 double]
        DelayEstimate: [2x5 double]

References

[1] IS-GPS-200, Rev:N. "NAVSTAR GPS Space Segment/Navigation User Segment Interfaces." GPS Enterprise Space & Missile Systems Center (SMC) - LAAFB, Aug 22, 2022.

[2] IS-GPS-800, Rev:J. "NAVSTAR GPS Space Segment/User Segment L1C Interfaces." GPS Enterprise Space & Missile Systems Center (SMC) - LAAFB, Aug 22, 2022.

[3] ISRO-IRNSS-ICD-SPS-1.1. "Signal in Space ICD for Standard Positioning Service." ISRO satellite navigation programme. August 2017.

[4] IS-QZSS-PNT-004. "Quasi-Zenith Satellite System. Interface Specification. Satellite Positioning, Navigation and Timing Service." Cabinet office, Government of Japan. January 25, 2021.

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

[6] Kaplan, Elliott D., and C. Hegarty, eds. Understanding GPS/GNSS: Principles and Applications. Third edition. GNSS Technology and Applications Series. Boston; London: Artech House, 2017.

Extended Capabilities

Version History

Introduced in R2023b

expand all