Main Content

gnssmeasurements

Get GNSS measurements from observation data and navigation message

Since R2026a

    Description

    gnssmeas = gnssmeasurements(obsdata,navmsg) gets GNSS measurements from observation data and a navigation message.

    example

    gnssmeas = gnssmeasurements(___,pseudorangeCode) specifies the observation code for the pseudorange measurements, in addition to the input arguments from the previous syntax.

    Examples

    collapse all

    Read observation and navigation data from the RINEX files.

    [obsdata,obshdr] = rinexread("GODS00USA_R_20211750000_01H_30S_MO.rnx");
    [navmsg,navhdr] = rinexread("GODS00USA_R_20211750000_01D_GN.rnx");

    Get GNSS measurements from the observation and navigation data.

    meas = gnssmeasurements(obsdata.GPS,navmsg.GPS);

    Estimate the receiver position from the GNSS measurements and display the receiver position for the first time stamp of the RINEX file.

    lla = receiverposition(meas);
    lla(1,:)
    ans = 1×3
    
       39.0205  -76.8273   36.6238
    
    

    Read the data from a RINEX navigation and observation messages. These RINEX files contain GNSS data for March 29, 2025.

    navFileName = "GODE00USA_R_20250880000_01D_GN.rnx";
    obsFileName = "GODE00USA_R_20250880800_01H_30S_MO.rnx";
    [rnxnavdata,rnxnavhdr] = rinexread(navFileName);
    [rnxobsdata,rnxobshdr] = rinexread(obsFileName);

    Create ionosphere and troposphere delay models. Use the Klobuchar model for the ionosphere delay model with the GPS alpha and beta coefficients from the header file.

    ionoParams = rnxnavhdr.IonosphericCorrections;
    alpha = ionoParams(1).Parameters;
    beta = ionoParams(2).Parameters;
    ionoDelayModel = gnssIonosphere("klobuchar",alpha,beta);
    tropoDelayModel = gnssTroposphere("saastamoinen");

    Create the GNSS options for estimating the receiver position.

    opts = gnssoptions(Ionosphere=ionoDelayModel,Troposphere=tropoDelayModel);

    Get the GNSS measurements for the GPS satellites using the RINEX navigation and observation messages. Show the data for the first three time steps.

    gpsData = gnssmeasurements(rnxobsdata.GPS,rnxnavdata.GPS);
    gpsData(1:3,:)
    ans=3×8 timetable
                Time            SatelliteID    Pseudorange                SatellitePosition                SatelliteClockBias    PseudorangeRate          SatelliteVelocity          SatelliteClockDrift    EphemerisAccuracy
        ____________________    ___________    ___________    _________________________________________    __________________    _______________    _____________________________    ___________________    _________________
    
        29-Mar-2025 08:00:00         1         2.4375e+07      -2.126e+07    -1.4117e+07     7.4018e+06        0.00019738              NaN          -471.47    -855.01      -2983        1.8076e-11                 2        
        29-Mar-2025 08:00:00         2          2.566e+07     -2.0524e+07    -1.6951e+07    -2.4589e+06       -0.00020789              NaN           429.94     23.954    -3140.9         9.436e-12                 2        
        29-Mar-2025 08:00:00         3         2.2235e+07     -1.2415e+07    -9.5047e+06      2.132e+07         0.0006808              NaN           578.88    -2675.8    -837.42        3.5243e-12                 2        
    
    

    Calculate the receiver positions by using the GPS measurements and the options specified by the gnssoptions object. Show the receiver positions for the first three time steps.

    [recPos,recVel,hdop,vdop,info] = receiverposition(gpsData,opts);
    recPos(1:3,:)
    ans = 3×3
    
       39.0217  -76.8268   13.7420
       39.0217  -76.8269   13.0003
       39.0217  -76.8268   12.2894
    
    

    Input Arguments

    collapse all

    Observation data from the GNSS receiver, specified as a timetable.

    Use the rinexread function to get observation data for this argument from a RINEX file.

    Example: obsdata = rinexread("20220912-225553_log.obs")

    Navigation message from the GNSS satellites, specified as a timetable.

    Use the rinexread function to get observation data for this argument from a RINEX file.

    Example: navmsg = rinexread("20220912-225553_log.nav")

    Pseudorange observable code, specified as a string scalar of the form TNA:

    • T — Type, which must be "C".

    • N — Frequency band number, which must be a number in the range [1, 9].

    • A — Attribute, which must be a letter in the range [A, Z].

    For example, for a pseudorange observable code with a frequency band 1 and attribute M, specify this argument as "C1M". For more information about pseudorange observable codes, see Observation Type Descriptors.

    Data Types: char | string

    Output Arguments

    collapse all

    Raw GNSS measurements for estimating receiver position, returned as a timetable with these columns.

    • Time — Returned as a datetime value.

    • SatelliteID — Returned as a numeric scalar.

    • Pseudorange — Returned as a numeric scalar, in meters.

    • SatellitePosition — Returned as a three-element row vector, representing ECEF (Earth-Centered, Earth-Fixed) coordinates in meters.

    • SatelliteClockBias — Returned as a numeric scalar, in seconds.

    • PseudorangeRate — Returned as a numeric scalar, in meters per second.

    • SatelliteVelocity — Returned as a three-element row vector, representing ECEF velocity in meters per second.

    • SatelliteClockDrift — Returned as a numeric scalar, in seconds per second.

    • EphemerisAccuracy — Returned as a numeric scalar, in meters.

    Note that if obsdata does not contain Doppler values, then the PseudorangeRate column contains NaN values.

    References

    [1] International GNSS Service (for Daily 30-Second GPS Broadcast Ephemeris Data, NASA Crustal Dynamics Data Information System (CDDIS), Greenbelt, MD, USA, March 29, 2024; accessed March 29, 2024). https://dx.doi.org/10.5067/GNSS/gnss_daily_n_001.

    [2] International GNSS Service (for Hourly 30-Second Observation Data, NASA Crustal Dynamics Data Information System (CDDIS), Greenbelt, MD, USA, March 29, 2024; accessed March 29, 2024). https://dx.doi.org/10.5067/GNSS/gnss_hourly_o_001.

    Extended Capabilities

    expand all

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

    Version History

    Introduced in R2026a