주요 콘텐츠

gnssFrameSynchronizer

R2026b

Synchronize and align GNSS navigation data frames

Since R2026b

Description

The gnssFrameSynchronizer System object™ synchronizes incoming global navigation satellite system (GNSS) navigation data symbols to frame boundaries. The object searches for subframe, page, or frame boundaries in a stream of demodulated symbols and outputs complete aligned frames when a valid boundary is detected.

The object implements a three-state machine architecture with the states SEARCHING, VERIFYING, and LOCKED for all supported signals. The object automatically resolves 180° polarity ambiguity, detects loss of synchronization, and returns to the SEARCHING state when loss of synchronization is detected. For more information, see Three-State Synchronization Machine and Synchronization Mechanisms sections.

To synchronize and align GNSS navigation data frames:

  1. Create the gnssFrameSynchronizer 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

sync = gnssFrameSynchronizer creates a default GNSS frame synchronizer System object with the SignalType property set to "GPS-LNAV".

example

sync = gnssFrameSynchronizer(PropertyName=Value) sets writeable properties using one or more name-value arguments. For example, gnssFrameSynchronizer(SignalType="Galileo-INAV") creates a frame synchronizer for Galileo I/NAV signals.

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-LNAV" — Use this option to input Global Positioning System (GPS) L1 coarse acquisition (C/A) legacy navigation (LNAV) data.

  • "GPS-CNAV-L2C" — Use this option to input GPS L2 civil navigation (CNAV) data.

  • "GPS-CNAV-L5" — Use this option to input GPS L5 CNAV data.

  • "GPS-L1C" — Use this option to input GPS L1C CNAV-2 data.

  • "Galileo-FNAV" — Use this option to input Galileo freely accessible navigation (F/NAV) data, corresponding to E5a-I signal component.

  • "Galileo-INAV" — Use this option to input Galileo integrity navigation (I/NAV) data, corresponding to E1-B and E5b-I signal components.

  • "NavIC-L1" — Use this option to input NavIC L1 standard positioning service (SPS) data.

  • "NavIC-L5" — Use this option to input NavIC L5 SPS and NavIC S-SPS data.

When SignalType is set to "GPS-L1C" or "NavIC-L1", the object uses a two-input syntax that accepts both data and pilot channel symbols. For all other signal types, the object uses a single-input syntax. For more information, see Usage section.

Data Types: char | string

Input type, specified as one of these options.

  • "bit" — Use this option to input binary zeros and ones.

  • "llr" — Use this option to input any real number.

Regardless of the InputType value, the object converts the input to hard bits before performing correlation. The InputType property specifies only the input format and does not affect the correlation method.

Data Types: char | string

Pseudo-random noise (PRN) code identifier of the satellite, specified as one of these options.

  • Positive integer in the range [1, 210] — Use this option when you set the SignalType property to "GPS-L1C".

  • Positive integer in the range [1, 64] — Use this option when you set the SignalType property to "NavIC-L1".

Note

When you set the SignalType property to "NavIC-L1", the first call to the object prompts you to download the required NavIC L1 initial conditions dataset. After MATLAB® downloads and extracts the dataset to prefdir, the object uses the local files for subsequent calls that generate L1-SPS waveforms.

Dependencies

To enable this property, set the SignalType property to "GPS-L1C" or "NavIC-L1".

Data Types: double

This property is read-only.

Current synchronization state, returned as one of these values.

  • "SEARCHING" — Applies when the object scans for synchronization pattern candidates or pilot overlay code correlation peaks.

  • "VERIFYING" — Applies when the object validates a detected candidate across multiple frames.

  • "LOCKED" — Applies when the object establishes frame synchronization and outputs aligned frames at each expected frame boundary.

Data Types: char | string

This property is read-only.

Number of symbols per output frame, returned as a positive integer. The value depends on the SignalType property.

Input SignalTypeFrameLength Value
"GPS-LNAV", "GPS-CANV-L2C", or "GPS-CNAV-L5"300
"Galileo-FNAV"500
"Galileo-INAV"250
"NavIC-L5"600
"GPS-L1C" or "NavIC-L1"1800

Data Types: double

Usage

Description

alignedFrame = sync(datasymbols) searches for the frame boundary in the input demodulated symbols and returns the aligned frame when the object achieves synchronization. Until the object locks to the frame boundary, the function returns an empty vector.

Note

This syntax applies when SignalType is set to "GPS-LNAV", "GPS-CNAV-L2C", "GPS-CNAV-L5", "NavIC-L5", "Galileo-FNAV", or "Galileo-INAV".

alignedFrame = sync(dataSymbols,pilotSymbols) searches for the frame boundary by using the pilot overlay code in pilotSymbols and returns the aligned data frame from dataSymbols.

Note

This syntax applies when SignalType is set to "GPS-L1C" or "NavIC-L1".

Input Arguments

expand all

Input demodulated navigation data symbols from data channel, specified as one of these options.

  • Scalar — Use this option for streaming mode, where the tracking loop provides one symbol at a time.

  • Column vector — Use this option for frame-based processing. The length of the column vector must be equal to the FrameLength property value

The object buffers data symbols internally and extracts the aligned frame when it detects synchronization.

Data Types: double | single | logical | int8

Pilot channel overlay code correlator outputs, specified as a scalar or a column vector. The size of pilotSymbols must be the same as dataSymbols.

The object correlates the pilot symbols with a satellite-specific 1800-chip overlay code replica to detect frame boundaries and resolve polar ambiguity.

This argument applies when SignalType is set to "GPS-L1C" or "NavIC-L1".

Data Types: double

Output Arguments

expand all

Frame-aligned output symbols, returned as a column vector of length equal to the FrameLength property value when a valid frame boundary is detected in the LOCKED state, or as an empty column vector (zeros(0,1)) otherwise.

Use the info object function to retrieve boundary metadata, like synchronization index and polarity, after a frame is output.

Data Types: double

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

infoCharacteristic information about object
stepRun System object algorithm
resetReset internal states of System object
releaseRelease resources and allow changes to System object property values and input characteristics
cloneCreate duplicate System object

Examples

collapse all

Create a frame synchronizer configured for GPS LNAV with hard-bit input.

FrameSync = gnssFrameSynchronizer(SignalType="GPS-LNAV",InputType="bit");

Verify that the synchronizer starts in the SEARCHING state.

disp(FrameSync.SyncState)
SEARCHING

Generate a simulated bit stream containing 5 subframes. In a real receiver, this data would come from the output of a tracking loop.

% For GPS LNAV, each subframe is 300 bits.
fl = FrameSync.FrameLength;
numSubframes = 5;
data = randi([0 1], fl*numSubframes, 1);

Process the bit stream one subframe at a time. The synchronizer searches for the 8-bit LNAV preamble pattern (10001011) and returns an aligned 300-bit subframe after it achieves synchronization. If synchronization has not yet been achieved, the output is empty.

syncAchieved = false;
for k = 1:numSubframes
    idx = (k-1)*fl + (1:fl);
    alignedFrame = FrameSync(data(idx));
    if ~isempty(alignedFrame)
        syncAchieved = true;
        s = info(FrameSync);
        fprintf("Frame synced at SyncIndex=%d, PolarityInverted=%s\n", ...
            s.SyncIndex,s.PolarityInverted);
    end
end

Check the synchronizer state after processing.

With random data, the synchronizer is unlikely to find a valid preamble pattern and remains in the SEARCHING state.

disp(FrameSync.SyncState)
SEARCHING

In a real application with valid GPS LNAV navigation data, the synchronizer transitions through SEARCHING to LOCKED once it detects the preamble at consistent 300-bit intervals and validates the TOW field across consecutive subframes. Once locked, each call returns an aligned subframe suitable for decoding.

Create two Galileo I/NAV frames. Each frame begins with the Galileo I/NAV synchronization word followed by 240 information bits.

% Galileo INAV synchronization word (10 bits)
syncWord = [0 1 0 1 1 0 0 0 0 0]';
% Generate 240 information bits for each of two frames
infoBits = randi([0 1],240,2);
% Create two complete INAV frames (250 bits each)
bits = [repmat(syncWord,1,2); infoBits];

Create a frame synchronizer configured for Galileo INAV signals.

gfs = gnssFrameSynchronizer(SignalType="Galileo-INAV");

Pass the first frame to the synchronizer.

The synchronizer detects the synchronization pattern but does not yet declare frame synchronization because it requires confirmation from a subsequent valid frame.

% Pass the first frame to the synchronizer
syncBits = gfs(bits(:,1));
% The output is empty because synchronizer is still verifying the frame boundary
size(syncBits)
ans = 1×2

     0     1

% Display the current synchronization state
gfs.SyncState
ans = 
'VERIFYING'
% Display synchronization information
% SyncIndex is 0 because the start of the frame has not been confirmed
s = info(gfs)
s = struct with fields:
           SyncIndex: 0
    PolarityInverted: 0

Pass the second frame to the synchronizer. Because two consecutive valid frames have now been received, the synchronizer can confirm the frame boundary and achieve synchronization.

% Pass the second frame to the synchronizer
syncBits = gfs(bits(:,2));
% The synchronizer now outputs a valid frame
size(syncBits)
ans = 1×2

   250     1

% The synchronizer outputs the first detected valid frame
isequal(syncBits,bits(:,1))
ans = logical
   1

% Display the updated synchronization state
gfs.SyncState
ans = 
'LOCKED'
% Display synchronization information
s = info(gfs)
s = struct with fields:
           SyncIndex: 1
    PolarityInverted: 0

After receiving two consecutive valid Galileo INAV frames, the frame synchronizer locks to the frame boundary and outputs the synchronized frames. Once synchronized, SyncIndex is returned as 1, indicating that the first bit of the 250-bit frame corresponds to the frame start.

More About

expand all

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-705, Rev:J. "NAVSTAR GPS Space Segment/User Segment L5 Interfaces." Aug 22, 2022.

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

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

[5] European Union. "Galileo Open Service Signal-In-Space Interface Control Document (OS SIS ICD)." Issue 2.1, November 2023.

Extended Capabilities

expand all

Version History

Introduced in R2026b