OpenGNSSLabSPP
Flagship tutorial

Double Difference
from Scratch

Learn carrier-phase and code double-difference positioning from real RINEX data, with every step computed numerically and explained in detail.

Real RINEX epochStep-by-step calculationsBroadcast NAVLAMBDA integrationSingle-epoch example
GPS · L1 · C1C / L1C2024-11-14 09:00:00 GPS5 common satellites · G09 reference
Double-difference geometryG04 − G09
Both receivers observe G04 and reference G09; baseline points from fixed Rover to estimated BaseEach line joins one satellite antenna to one receiver antenna phase center. Solid lines reach Base; dashed lines reach Rover. Teal identifies the reference satellite, blue the selected target. The conceptual geometry is not to scale.G09 → Base antenna phase centerG09 → Rover antenna phase centerG04 → Base antenna phase centerG04 → Rover antenna phase centerG04TARGETG07G09REFERENCEG16G30b = base − roverBaseEstimated positionRoverFixed header position
Solid: BaseDashed: RoverG09 referenceG04 target
Rover → Base baseline. Five common satellites; selected target and reference highlighted. Conceptual, not to scale.

What is a GNSS double difference?

A GNSS double difference combines simultaneous measurements from two receivers and two satellites. Receiver-clock and common satellite-clock terms cancel under the model assumptions, while shared reference observations create correlated noise. This real one-epoch lesson estimates a rover-to-base baseline with the rover header coordinates held fixed.

Prepared by OpenGNSSLabUpdated Sources, reproducibility and corrections

What you’ll build in this tutorial

A complete numerical baseline solution from one real Qelaro execution: every observation, matrix, and diagnostic remains inspectable.

One epoch, fully traced

Start with two receivers observing the same GPS satellites. Subtract within each receiver, then between receivers, to isolate the relative geometry. Build the covariance alongside the observations, solve float unknowns, search integer ambiguities, and inspect the constrained result.

Numbers before abstraction: first G04 relative to G09, then the full system.

Common satellites5
ReferenceG09
DD pairs4
DD observations8
Float unknowns7
Float DOF1
Lesson convention
For this fully traced one-epoch example, the rover RINEX approximate ECEF position is held fixed and the rover-to-base baseline is estimated. This follows the traced Qelaro implementation. Operational PPK often uses a known base and estimates the rover instead.
b=rbase−rrover,r^base=rrover,fixed+b^\mathbf b=\mathbf r_{base}-\mathbf r_{rover},\qquad \hat{\mathbf r}_{base}=\mathbf r_{rover,fixed}+\hat{\mathbf b}

Inputs and sign convention

2024-11-14 09:00:00 GPS. GPS L1, C1C metres, L1C cycles. λ = 0.19029367279836487 m/cycle.

DD=(Bj−Bm)−(Rj−Rm)DD=(B_j-B_m)-(R_j-R_m)

Where this lesson ends

Candidate baseline length: 810.359239 m. Integer candidate: [13, 7, 27, 1]. Ratio diagnostic: 1.445276.

Warning · Candidate-fixed; not validated
The candidate and centimetre-level formal sigmas do not establish external accuracy or operational fixing reliability.

1. Problem and model

Code measures a travel-time-based distance. Carrier phase measures a fractional wave plus an unknown whole-cycle count; multiplying by wavelength expresses it in metres.

Code pseudorange

Prs=ρrs+c(δtr−δts)+Trs+Irs+other terms+ϵPP_r^s=\rho_r^s+c(\delta t_r-\delta t^s)+T_r^s+I_r^s+\mathrm{other\ terms}+\epsilon_P

Code gives the distance scale without a whole-cycle ambiguity, but is noisier than phase.

Carrier phase in metres

λΦrs=ρrs+c(δtr−δts)+Trs−Irs+λNrs+other terms+ϵΦ\lambda\Phi_r^s=\rho_r^s+c(\delta t_r-\delta t^s)+T_r^s-I_r^s+\lambda N_r^s+\mathrm{other\ terms}+\epsilon_\Phi

Phase is precise, but the integer N must be estimated. The ionosphere enters code and phase with opposite signs.

Read the observation equation

Symbols and physical units
SymbolMeaningUnit
r / sreceiver / satellite—
ρexact geometric range ‖satellite − receiver‖m
cspeed of light, 299792458m/s
δtᵣ / δtˢreceiver / satellite clock offsets
T / Itropospheric / ionospheric delaym
λ / Φwavelength / measured phasem/cycle / cycle
Nwhole-cycle ambiguitycycle
εmeasurement noise and remaining errorm
First subtraction: same receiver
SDᵣ(j,m) = yᵣ,j − yᵣ,m. The same receiver-clock term cancels. The satellite-clock difference between j and m remains.
Second subtraction: two receivers
DD(j,m) = SDbase − SDrover. Simultaneous observations remove the common satellite-clock terms. Spatially correlated atmosphere and orbit errors are reduced, not guaranteed to vanish.
Warning · Structural equations, limited correction scope
These equations explain cancellation. This traced DD_linear lesson uses broadcast NAV states and the core DD numerical path; it does not apply a complete operational zero-difference correction ledger. Full PPK may explicitly model Sagnac, clocks, antenna effects, troposphere and other terms.

2. Input data (RINEX)

Read the real observation files, extract the shared epoch, and propagate broadcast navigation parameters to satellite states.

Base observations · 36.24O

RINEX 3.02. The first GPS observation fields are C1C (m), then L1C (cycles); trailing digits encode signal quality.

     3.02           OBSERVATION DATA    M (MIXED)           RINEX VERSION / TYPE
  3246705.6964  4052996.6836  3692516.1666                  APPROX POSITION XYZ 
G   16 C1C L1C D1C S1C C2W L2W D2W S2W C2S L2S D2S S2S C5Q  SYS / # / OBS TYPES 
> 2024 11 14 09 00  0.0000000  0 39       0.000000000000
G04  21325621.891 8 112066897.717 8     -1691.258 8        48.383 8  21325630.250 9  87324885.628 9     -1317.838 9        56.226 9  21325630.336 8  87324885.635 8     -1317.857 8        53.559 8  21325634.332 8  83686366.378 8     -1262.959 8        51.124 8
G09  20149741.844 8 105887607.793 8       -95.203 8        52.968 8  20149748.410 9  82509850.730 9       -74.205 9        56.226 9  20149748.785 9  82509851.734 9       -74.146 9        54.030 9  20149749.148 9  79071943.958 9       -70.984 9        54.060 9

Rover observations · 15.24O

RINEX 3.02. The first GPS observation fields are C1C (m), then L1C (cycles); trailing digits encode signal quality.

     3.02           OBSERVATION DATA    M (MIXED)           RINEX VERSION / TYPE
  3246374.5864  4052665.3939  3693176.0609                  APPROX POSITION XYZ 
G   16 C1C L1C D1C S1C C2W L2W D2W S2W C2S L2S D2S S2S C5Q  SYS / # / OBS TYPES 
> 2024 11 14 09 00  0.0000000  0 33       0.000000000000
G04  21325674.301 8 112067164.390 8     -1691.398 8        51.422 8  21325680.582 9  87325076.873 9     -1318.094 9        56.226 9  21325680.453 9  87325081.886 9     -1318.113 9        54.067 9  21325684.051 8  83686546.923 8     -1262.975 8        52.228 8
G09  20149603.512 8 105886884.690 8       -95.852 8        52.498 8  20149608.793 9  82509277.969 9       -74.344 9        56.226 9  20149609.379 8  82509273.972 8       -74.344 8        53.030 8  20149608.891 8  79071387.938 8       -71.197 8        53.381 8

Convert cycles into metres

Φm=Φcycle λL1\Phi_{m}=\Phi_{cycle}\,\lambda_{L1}

Base G04 phase

112066897.717 cycles × 0.19029367279836487 m/cycle
= 21325621.56568662 m

The phase is now in the same length unit as code. This does not remove its integer ambiguity.

Base navigation · 36.24N

Actual G04 broadcast ephemeris excerpt. D denotes a decimal exponent. These parameters feed the Kepler propagation, not the final DD solver directly.

     3.02           N: GNSS NAV DATA    G: GPS              RINEX VERSION / TYPE
G04 2024 11 14 10 00 00 0.479244161397D-03 0.648014975013D-11 0.000000000000D+00
     0.115000000000D+03 0.178125000000D+02 0.498413618071D-08-0.136268651039D+00
     0.728294253349D-06 0.314607680775D-02 0.479444861412D-05 0.515367835236D+04
     0.381600000000D+06 0.745058059692D-08 0.114317989652D+01 0.167638063431D-07
     0.965789022041D+00 0.288125000000D+03-0.300042464309D+01-0.830748889740D-08
     0.106790162525D-09 0.100000000000D+01 0.234000000000D+04 0.000000000000D+00
     0.200000000000D+01 0.000000000000D+00-0.465661287308D-08 0.115000000000D+03
     0.374406000000D+06 0.400000000000D+01 0.000000000000D+00 0.000000000000D+00

Rover navigation · 15.24N

Actual G04 broadcast ephemeris excerpt. D denotes a decimal exponent. These parameters feed the Kepler propagation, not the final DD solver directly.

     3.02           N: GNSS NAV DATA    G: GPS              RINEX VERSION / TYPE
G04 2024 11 14 10 00 00 0.479244161397D-03 0.648014975013D-11 0.000000000000D+00
     0.115000000000D+03 0.178125000000D+02 0.498413618071D-08-0.136268651039D+00
     0.728294253349D-06 0.314607680775D-02 0.479444861412D-05 0.515367835236D+04
     0.381600000000D+06 0.745058059692D-08 0.114317989652D+01 0.167638063431D-07
     0.965789022041D+00 0.288125000000D+03-0.300042464309D+01-0.830748889740D-08
     0.106790162525D-09 0.100000000000D+01 0.234000000000D+04 0.000000000000D+00
     0.200000000000D+01 0.000000000000D+00-0.465661287308D-08 0.115000000000D+03
     0.376896000000D+06 0.400000000000D+01 0.000000000000D+00 0.000000000000D+00

NAV → transmit time → ECEF → LOS

The Qelaro wrench path estimates signal transmit time from code and broadcast clock information, selects ephemeris, and propagates satellite ECEF coordinates. For base G04:

Epoch satellite state

Epoch receive time = 378000 s GPS week
Transmit time = 377999.92838615703 s
Signal time difference = 0.07161384297069162 s
Broadcast satellite clock = 0.00047922526818618074 s
ECEF = [846359.717513945, 24131563.233674087, 10905032.09222802] m

The signal time difference above is from the traced path; it is not simply P/c. Its clock handling belongs to satellite-state propagation.

NAV orbit tracks

XZYG04 · 2024-11-14T08:30:00 GPS · ECEF (2265144.3131867414, 21419847.651535816, 15454747.584069556) mG04 · 2024-11-14T08:32:00 GPS · ECEF (2150190.042626585, 21624724.593178615, 15181461.726554208) mG04 · 2024-11-14T08:34:00 GPS · ECEF (2038297.1874630395, 21826579.83263991, 14903497.66098671) mG04 · 2024-11-14T08:36:00 GPS · ECEF (1929437.8017382184, 22025312.395388044, 14620940.425676016) mG04 · 2024-11-14T08:38:00 GPS · ECEF (1823581.4907730536, 22220822.536238283, 14333876.505868517) mG04 · 2024-11-14T08:40:00 GPS · ECEF (1720695.4397801673, 22413011.806096144, 14042393.807381012) mG04 · 2024-11-14T08:42:00 GPS · ECEF (1620744.4442080222, 22601783.1178968, 13746581.6297478) mG04 · 2024-11-14T08:44:00 GPS · ECEF (1523690.9417938218, 22787040.811693873, 13446530.63888937) mG04 · 2024-11-14T08:46:00 GPS · ECEF (1429495.0463054962, 22968690.718850795, 13142332.839311603) mG04 · 2024-11-14T08:48:00 GPS · ECEF (1338114.5829477375, 23146640.22528928, 12834081.545843346) mG04 · 2024-11-14T08:50:00 GPS · ECEF (1249505.1254086469, 23320798.333749253, 12521871.3549215) mG04 · 2024-11-14T08:52:00 GPS · ECEF (1163620.0345207872, 23491075.725015976, 12205798.115432171) mG04 · 2024-11-14T08:54:00 GPS · ECEF (1080410.4985101689, 23657384.818070076, 11885958.899117189) mG04 · 2024-11-14T08:56:00 GPS · ECEF (999825.574805268, 23819639.829117633, 11562451.970555134) mG04 · 2024-11-14T08:58:00 GPS · ECEF (921812.2333758548, 23977756.829457596, 11235376.756726494) mG04 · 2024-11-14T09:00:00 GPS · ECEF (846315.4015729874, 24131653.80214494, 10904833.81617258) mG04 · 2024-11-14T09:02:00 GPS · ECEF (773278.0104372511, 24281250.69740871, 10570924.807757946) mG04 · 2024-11-14T09:04:00 GPS · ECEF (702641.0424434813, 24426469.48678494, 10233752.459046729) mG04 · 2024-11-14T09:06:00 GPS · ECEF (634343.5806483487, 24567234.21592528, 9893420.534302697) mG04 · 2024-11-14T09:08:00 GPS · ECEF (568322.8592053056, 24703471.056043167, 9550033.802123925) mG04 · 2024-11-14T09:10:00 GPS · ECEF (504514.3152124705, 24835108.353960138, 9203698.002722315) mG04 · 2024-11-14T09:12:00 GPS · ECEF (442851.6418558136, 24962076.68071619, 8854519.814859005) mG04 · 2024-11-14T09:14:00 GPS · ECEF (383266.84281025734, 25084308.878708623, 8502606.822446518) mG04 · 2024-11-14T09:16:00 GPS · ECEF (325690.2878600592, 25201740.10732528, 8148067.480828812) mG04 · 2024-11-14T09:18:00 GPS · ECEF (270050.76969878655, 25314307.887038913, 7791011.082750477) mG04 · 2024-11-14T09:20:00 GPS · ECEF (216275.56186905876, 25421952.141930472, 7431547.724026642) mG04 · 2024-11-14T09:22:00 GPS · ECEF (164290.47779923677, 25524615.24061038, 7069788.268925006) mG04 · 2024-11-14T09:24:00 GPS · ECEF (114019.93089683354, 25622242.035507828, 6705844.31527187) mG04 · 2024-11-14T09:26:00 GPS · ECEF (65386.99565428961, 25714779.900499407, 6339828.159294062) mG04 · 2024-11-14T09:28:00 GPS · ECEF (18313.46972384723, 25802178.76684952, 5971852.760208731) mG04 · 2024-11-14T09:30:00 GPS · ECEF (-27280.06308262702, 25884391.15743617, 5602031.704573035) mG04G07 · 2024-11-14T08:30:00 GPS · ECEF (20205218.222597037, 8499038.25837398, 15840530.37068938) mG07 · 2024-11-14T08:32:00 GPS · ECEF (19980838.032402545, 8553619.525835872, 16097161.077596024) mG07 · 2024-11-14T08:34:00 GPS · ECEF (19753165.454398315, 8610330.260502765, 16349121.366869118) mG07 · 2024-11-14T08:36:00 GPS · ECEF (19522287.99608592, 8669215.743953448, 16596339.153097408) mG07 · 2024-11-14T08:38:00 GPS · ECEF (19288294.50398093, 8730319.217014898, 16838743.68012389) mG07 · 2024-11-14T08:40:00 GPS · ECEF (19051275.111082405, 8793681.846998295, 17076265.537058216) mG07 · 2024-11-14T08:42:00 GPS · ECEF (18811321.183644105, 8859342.69625691, 17308836.674022987) mG07 · 2024-11-14T08:44:00 GPS · ECEF (18568525.267278448, 8927338.692079786, 17536390.41763477) mG07 · 2024-11-14T08:46:00 GPS · ECEF (18322981.03242221, 8997704.597938523, 17758861.486220572) mG07 · 2024-11-14T08:48:00 GPS · ECEF (18074783.2191952, 9070472.986101404, 17976186.0047705) mG07 · 2024-11-14T08:50:00 GPS · ECEF (17824027.581682432, 9145674.211628452, 18188301.519627254) mG07 · 2024-11-14T08:52:00 GPS · ECEF (17570810.83167008, 9223336.387762733, 18395147.012912933) mG07 · 2024-11-14T08:54:00 GPS · ECEF (17315230.581867248, 9303485.362728683, 18596662.91669358) mG07 · 2024-11-14T08:56:00 GPS · ECEF (17057385.28864388, 9386144.697952028, 18792791.1268819) mG07 · 2024-11-14T08:58:00 GPS · ECEF (16797374.194317117, 9471335.647710692, 18983475.016878385) mG07 · 2024-11-14T09:00:00 GPS · ECEF (16535297.26901699, 9559077.14022981, 19168659.45095085) mG07 · 2024-11-14T09:02:00 GPS · ECEF (16271255.152164128, 9649385.760229263, 19348290.797352795) mG07 · 2024-11-14T09:04:00 GPS · ECEF (16005349.093590662, 9742275.732934784, 19522316.94118017) mG07 · 2024-11-14T09:06:00 GPS · ECEF (15737680.894336974, 9837758.909561131, 19690687.29696656) mG07 · 2024-11-14T09:08:00 GPS · ECEF (15468352.8471568, 9935844.754274994, 19853352.82101657) mG07 · 2024-11-14T09:10:00 GPS · ECEF (15197467.676762346, 10036540.332646765, 20010266.023476925) mG07 · 2024-11-14T09:12:00 GPS · ECEF (14925128.479842896, 10139850.301596396, 20161380.980144866) mG07 · 2024-11-14T09:14:00 GPS · ECEF (14651438.664889002, 10245776.900841262, 20306653.344013065) mG07 · 2024-11-14T09:16:00 GPS · ECEF (14376501.89185537, 10354319.945850296, 20446040.356550656) mG07 · 2024-11-14T09:18:00 GPS · ECEF (14100422.011695055, 10465476.822310442, 20579500.85871907) mG07 · 2024-11-14T09:20:00 GPS · ECEF (13823303.00579851, 10579242.482108705, 20706995.30172205) mG07 · 2024-11-14T09:22:00 GPS · ECEF (13545248.92536984, 10695609.440834146, 20828485.757488467) mG07 · 2024-11-14T09:24:00 GPS · ECEF (13266363.830773853, 10814567.776802504, 20943935.928886943) mG07 · 2024-11-14T09:26:00 GPS · ECEF (12986751.730887463, 10936105.13160492, 21053311.15967056) mG07 · 2024-11-14T09:28:00 GPS · ECEF (12706516.522487525, 11060206.712183798, 21156578.444150433) mG07 · 2024-11-14T09:30:00 GPS · ECEF (12425761.929710075, 11186855.29443464, 21253706.43659628) mG07G09 · 2024-11-14T08:30:00 GPS · ECEF (10079687.062128857, 13727651.49164524, 20269507.622574616) mG09 · 2024-11-14T08:32:00 GPS · ECEF (9961270.169088528, 14015097.83240479, 20130729.963966727) mG09 · 2024-11-14T08:34:00 GPS · ECEF (9845555.427709932, 14301331.652258383, 19985725.346386187) mG09 · 2024-11-14T08:36:00 GPS · ECEF (9732547.509869426, 14586238.95645262, 19834538.547965083) mG09 · 2024-11-14T08:38:00 GPS · ECEF (9622248.474150138, 14869706.010697791, 19677216.27774317) mG09 · 2024-11-14T08:40:00 GPS · ECEF (9514657.770256074, 15151619.414125305, 19513807.160910446) mG09 · 2024-11-14T08:42:00 GPS · ECEF (9409772.245319633, 15431866.17206522, 19344361.723417964) mG09 · 2024-11-14T08:44:00 GPS · ECEF (9307586.152097868, 15710333.768592896, 19168932.375962097) mG09 · 2024-11-14T08:46:00 GPS · ECEF (9208091.15905092, 15986910.238793124, 18987573.397347663) mG09 · 2024-11-14T08:48:00 GPS · ECEF (9111276.362295344, 16261484.240690788, 18800340.917235803) mG09 · 2024-11-14T08:50:00 GPS · ECEF (9017128.299423026, 16533945.126797205, 18607292.89828236) mG09 · 2024-11-14T08:52:00 GPS · ECEF (8925630.965175495, 16804183.015221488, 18408489.117673177) mG09 · 2024-11-14T08:54:00 GPS · ECEF (8836765.82896186, 17072088.860296633, 18203991.148062684) mG09 · 2024-11-14T08:56:00 GPS · ECEF (8750511.85420721, 17337554.522670574, 17993862.337922346) mG09 · 2024-11-14T08:58:00 GPS · ECEF (8666845.519517284, 17600472.838812295, 17778167.79130615) mG09 · 2024-11-14T09:00:00 GPS · ECEF (8585740.841643337, 17860737.689884324, 17556974.34703998) mG09 · 2024-11-14T09:02:00 GPS · ECEF (8507169.40023047, 18118244.069932528, 17330350.55734248) mG09 · 2024-11-14T09:04:00 GPS · ECEF (8431100.364330817, 18372888.153345365, 17098366.665884856) mG09 · 2024-11-14T09:06:00 GPS · ECEF (8357500.5206621485, 18624567.36153471, 16861094.585297503) mG09 · 2024-11-14T09:08:00 GPS · ECEF (8286334.303590711, 18873180.428791337, 16618607.87413146) mG09 · 2024-11-14T09:10:00 GPS · ECEF (8217563.826816367, 19118627.4672686, 16370981.71328292) mG09 · 2024-11-14T09:12:00 GPS · ECEF (8151148.916736474, 19360810.031048365, 16118292.881889269) mG09 · 2024-11-14T09:14:00 GPS · ECEF (8087047.147463921, 19599631.17924417, 15860619.732705284) mG09 · 2024-11-14T09:16:00 GPS · ECEF (8025213.877473379, 19834995.538097087, 15598042.166968375) mG09 · 2024-11-14T09:18:00 GPS · ECEF (7965602.28784882, 20066809.36202077, 15330641.608761806) mG09 · 2024-11-14T09:20:00 GPS · ECEF (7908163.422104167, 20294980.59355237, 15058500.978885349) mG09 · 2024-11-14T09:22:00 GPS · ECEF (7852846.227547551, 20519418.92216768, 14781704.66824256) mG09 · 2024-11-14T09:24:00 GPS · ECEF (7799597.598158858, 20740035.841919012, 14500338.51075442) mG09 · 2024-11-14T09:26:00 GPS · ECEF (7748362.418949068, 20956744.707855143, 14214489.75580914) mG09 · 2024-11-14T09:28:00 GPS · ECEF (7699083.611768516, 21169460.791184407, 13924247.04025797) mG09 · 2024-11-14T09:30:00 GPS · ECEF (7651702.182531108, 21378101.33314164, 13629700.359967278) mG09G16 · 2024-11-14T08:30:00 GPS · ECEF (-7179282.960575892, 14907756.515340311, 20326682.592003632) mG16 · 2024-11-14T08:32:00 GPS · ECEF (-7368961.598844269, 14647813.10576491, 20450681.232365567) mG16 · 2024-11-14T08:34:00 GPS · ECEF (-7561407.6515452415, 14387667.820637424, 20568162.462470066) mG16 · 2024-11-14T08:36:00 GPS · ECEF (-7756577.823880336, 14127433.089282628, 20679090.850113392) mG16 · 2024-11-14T08:38:00 GPS · ECEF (-7954426.26853016, 13867220.586302528, 20783433.152708694) mG16 · 2024-11-14T08:40:00 GPS · ECEF (-8154904.613373565, 13607141.156571368, 20881158.326343942) mG16 · 2024-11-14T08:42:00 GPS · ECEF (-8357961.991123609, 13347304.741002556, 20972237.53393133) mG16 · 2024-11-14T08:44:00 GPS · ECEF (-8563545.070853854, 13087820.303144252, 21056644.152447853) mG16 · 2024-11-14T08:46:00 GPS · ECEF (-8771598.09138723, 12828795.756659914, 21134353.77926773) mG16 · 2024-11-14T08:48:00 GPS · ECEF (-8982062.896516845, 12570337.89374922, 21205344.237587415) mG16 · 2024-11-14T08:50:00 GPS · ECEF (-9194878.972029649, 12312552.314562649, 21269595.580945212) mG16 · 2024-11-14T08:52:00 GPS · ECEF (-9409983.484498208, 12055543.357664095, 21327090.09683744) mG16 · 2024-11-14T08:54:00 GPS · ECEF (-9627311.321808498, 11799414.031592453, 21377812.30943403) mG16 · 2024-11-14T08:56:00 GPS · ECEF (-9846795.135387568, 11544265.947573692, 21421748.981396984) mG16 · 2024-11-14T08:58:00 GPS · ECEF (-10068365.384094795, 11290199.253432903, 21458889.11480548) mG16 · 2024-11-14T09:00:00 GPS · ECEF (-10291950.379738888, 11037312.568754846, 21489223.951192155) mG16 · 2024-11-14T09:02:00 GPS · ECEF (-10517476.33418155, 10785702.921340289, 21512746.970695622) mG16 · 2024-11-14T09:04:00 GPS · ECEF (-10744867.407987632, 10535465.685004031, 21529453.89033455) mG16 · 2024-11-14T09:06:00 GPS · ECEF (-10974045.7605803, 10286694.518759225, 21539342.66140954) mG16 · 2024-11-14T09:08:00 GPS · ECEF (-11204931.60185881, 10039481.307431256, 21542413.46603917) mG16 · 2024-11-14T09:10:00 GPS · ECEF (-11437443.245235289, 9793916.103743112, 21538668.71283741) mG16 · 2024-11-14T09:12:00 GPS · ECEF (-11671497.162046265, 9550087.071912317, 21528113.03173967) mG16 · 2024-11-14T09:14:00 GPS · ECEF (-11907008.03729273, 9308080.432799326, 21510753.267985713) mG16 · 2024-11-14T09:16:00 GPS · ECEF (-12143888.82666362, 9067980.41064326, 21486598.47526759) mG16 · 2024-11-14T09:18:00 GPS · ECEF (-12382050.81479403, 8829869.181422869, 21455659.908051737) mG16 · 2024-11-14T09:20:00 GPS · ECEF (-12621403.674711268, 8593826.822875664, 21417951.01308419) mG16 · 2024-11-14T09:22:00 GPS · ECEF (-12861855.52841937, 8359931.266208954, 21373487.42008898) mG16 · 2024-11-14T09:24:00 GPS · ECEF (-13103313.008572672, 8128258.24953381, 21322286.93166946) mG16 · 2024-11-14T09:26:00 GPS · ECEF (-13345681.321188472, 7898881.27305188, 21264369.512423284) mG16 · 2024-11-14T09:28:00 GPS · ECEF (-13588864.30934783, 7671871.556023057, 21199757.277281757) mG16 · 2024-11-14T09:30:00 GPS · ECEF (-13832764.517833252, 7447297.995540766, 21128474.479084805) mG16G30 · 2024-11-14T08:30:00 GPS · ECEF (26037853.590932924, 655453.475142058, 6037681.959883759) mG30 · 2024-11-14T08:32:00 GPS · ECEF (25952622.933124937, 707499.7398455427, 6393791.686637148) mG30 · 2024-11-14T08:34:00 GPS · ECEF (25862509.10242529, 760922.1811759435, 6747981.066871252) mG30 · 2024-11-14T08:36:00 GPS · ECEF (25767558.048765022, 815793.9385019196, 7100144.000381675) mG30 · 2024-11-14T08:38:00 GPS · ECEF (25667818.020605665, 872187.0056786779, 7450175.011937328) mG30 · 2024-11-14T08:40:00 GPS · ECEF (25563339.533254992, 930172.1748684105, 7797969.280742547) mG30 · 2024-11-14T08:42:00 GPS · ECEF (25454175.335775316, 989818.9811889176, 8143422.669697145) mG30 · 2024-11-14T08:44:00 GPS · ECEF (25340380.376506064, 1051195.6482256765, 8486431.754448598) mG30 · 2024-11-14T08:46:00 GPS · ECEF (25222011.76722361, 1114369.0344416965, 8826893.852230834) mG30 · 2024-11-14T08:48:00 GPS · ECEF (25099128.745962057, 1179404.580520515, 9164707.050483955) mG30 · 2024-11-14T08:50:00 GPS · ECEF (24971792.638519417, 1246366.257674031, 9499770.235249275) mG30 · 2024-11-14T08:52:00 GPS · ECEF (24840066.818674453, 1315316.516949581, 9831983.119334482) mG30 · 2024-11-14T08:54:00 GPS · ECEF (24704016.667139947, 1386316.2395679122, 10161246.270243213) mG30 · 2024-11-14T08:56:00 GPS · ECEF (24563709.52927941, 1459424.6883237015, 10487461.137863768) mG30 · 2024-11-14T08:58:00 GPS · ECEF (24419214.671614364, 1534699.4600793896, 10810530.081911853) mG30 · 2024-11-14T09:00:00 GPS · ECEF (24270603.237150457, 1612196.439383438, 11130356.399121627) mG30 · 2024-11-14T09:02:00 GPS · ECEF (24117948.1995512, 1691969.753241283, 11446844.35018042) mG30 · 2024-11-14T09:04:00 GPS · ECEF (23961324.316188727, 1774071.7270688582, 11759899.186401518) mG30 · 2024-11-14T09:06:00 GPS · ECEF (23800808.080101784, 1858552.8418562936, 12069427.176129997) mG30 · 2024-11-14T09:08:00 GPS · ECEF (23636477.670891676, 1945461.6925694104, 12375335.630876724) mG30 · 2024-11-14T09:10:00 GPS · ECEF (23468412.90458738, 2034844.947815475, 12677532.931175238) mG30 · 2024-11-14T09:12:00 GPS · ECEF (23296695.182512168, 2126747.310799064, 12975928.552156566) mG30 · 2024-11-14T09:14:00 GPS · ECEF (23121407.4391838, 2221211.481593325, 13270433.088837288) mG30 · 2024-11-14T09:16:00 GPS · ECEF (22942634.089281883, 2318278.120750173, 13560958.28111547) mG30 · 2024-11-14T09:18:00 GPS · ECEF (22760460.97371559, 2417985.814274283, 13847417.038469931) mG30 · 2024-11-14T09:20:00 GPS · ECEF (22574975.304826327, 2520371.0399818234, 14129723.464358) mG30 · 2024-11-14T09:22:00 GPS · ECEF (22386265.610759765, 2625468.1352668405, 14407792.880306631) mG30 · 2024-11-14T09:24:00 GPS · ECEF (22194421.67904252, 2733309.2662959723, 14681541.849692509) mG30 · 2024-11-14T09:26:00 GPS · ECEF (21999534.499399178, 2843924.398651371, 14950888.201205935) mG30 · 2024-11-14T09:28:00 GPS · ECEF (21801696.20584545, 2957341.2694413112, 15215751.051994529) mG30 · 2024-11-14T09:30:00 GPS · ECEF (21601000.018094625, 3073585.360896799, 15476050.830480728) mG30

Oblique ECEF projection, not a skyplot. NAV propagated every 120 s over ±30 min; large dots show epoch GPS time. DD states use signal transmit time instead.

A numeric line of sight

The design model uses base-frame satellite states and the fixed rover coordinates, exactly as geometry_row does. Normalize the ECEF difference to obtain u.

uj=sj−rrover∥sj−rrover∥\mathbf u_j={\mathbf s_j-\mathbf r_{rover}\over\|\mathbf s_j-\mathbf r_{rover}\|}

G04: three subtractions, a norm, three divisions

X: 846359.717513945 − 3246374.5864 = -2400014.868886055 m
Y: 24131563.233674087 − 4052665.3939 = 20078897.839774087 m
Z: 10905032.09222802 − 3693176.0609 = 7211856.03132802 m
ρ = √((-2400014.868886055)² + (20078897.839774087)² + (7211856.03132802)²) = 21469352.045359004 m
uX = -2400014.868886055 / 21469352.045359004 = -0.11178795074091966
uY = 20078897.839774087 / 21469352.045359004 = 0.9352353903067376
uZ = 7211856.03132802 / 21469352.045359004 = 0.3359140050473482

A unit direction is dimensionless. Rotate a receiver-specific LOS to ENU; azimuth = atan2(E,N), elevation = asin(U). The receiver-frame Az/El determines weights and reference choice.

All satellite states at transmit time
Receiver satellite states; ECEF metres, GPS week seconds, degrees
ReceiverPRNt transmitXYZAzEl
BaseG04377999.928386846359.71751424131563.23367410905032.09222899.18711747.102246
BaseG07377999.92952316535451.7761039559024.85685619168552.314801307.45385665.599553
BaseG08377999.921132-5883706.49033225640105.566921582780.305009113.55339917.923853
BaseG09377999.9323458585785.85151317860591.72137117557100.59112455.05662874.419671
BaseG16377999.921858-10291804.14512711037476.83940421489206.41347842.58156519.597189
BaseG20377999.92080214572581.830868-7889378.98034320804966.630072313.07269819.924584
BaseG30377999.92516824270697.1787891612147.40855411130157.986078268.55792836.899820
RoverG04377999.928386846359.71762224131563.23345310905032.09271299.19839747.101383
RoverG07377999.92952316535451.7747179559024.85732519168552.315762307.43644165.604710
RoverG09377999.9323458585785.85120617860591.72236717557100.59026355.08402174.425578
RoverG16377999.921860-10291804.14883011037476.83524421489206.41392242.58484219.603357
RoverG30377999.92516824270697.1790191612147.40843411130157.985592268.55024036.899059

3. Satellite selection

A double difference needs both receivers to observe the target and the reference at the same epoch.

Common-satellite filtering

Base · 7 satellites

G04G07G08G09G16G20G30

∩ Rover · 5 satellites

G04G07G09G16G30

= Common · 5 satellites

G04G07G09G16G30

G08 and G20 disappear because no usable matching rover observation exists in this epoch. They cannot form DD pairs.

Choose the highest common base elevation

Real elevations at both receivers
SatelliteBase elevation (°)Rover elevation (°)Selection
G0447.10224647.101383Selected target
G0765.59955365.604710Selected target
G0974.41967174.425578★ Reference
G1619.59718919.603357Selected target
G3036.89982036.899059Selected target

Maximum over the intersection

max(base elevations) = 74.4196711687952°
= G09 reference

A high-elevation reference has smaller assumed measurement noise. G09 is reused in every DD, so its noise will also create correlations.

Skyplot / reference selection

30°60°90°NESWG04 · base · az 99.18711697808732° · el 47.10224609536898°G04G07 · base · az 307.4538562811204° · el 65.59955263173498°G07G09 · base · az 55.05662833180754° · el 74.4196711687952°G09 ★G16 · base · az 42.58156475783746° · el 19.597189182615576°G16G30 · base · az 268.5579276526728° · el 36.89981950525823°G30

Zenith is at the center. Radius = 90° − elevation. Dashed ring: 15° mask. G09 ★ is the selected reference.

Data summary
5 common satellites − 1 reference = 4 DD pairs. Each pair supplies code and phase: 4 × 2 = 8 observations. Next, subtract reference G09 from each target within each receiver.

4. Single differences from scratch

At one receiver, subtract reference G09 from target G04. This is satellite-to-satellite differencing, not a between-receiver single difference.

Same receiver, two satellites

SDr(j,m)=yr,j−yr,mSD_r(j,m)=y_{r,j}-y_{r,m}

Both measurements contain the same receiver-clock term cδtᵣ, so it cancels. The satellite-clock difference remains until the second subtraction.

Applied to code and carrier phase
Code is already in metres. Convert phase cycles to metres using λ before combining the observables with the geometric model.
Double-difference geometryG04 − G09
Both receivers observe G04 and reference G09; baseline points from fixed Rover to estimated BaseEach line joins one satellite antenna to one receiver antenna phase center. Solid lines reach Base; dashed lines reach Rover. Teal identifies the reference satellite, blue the selected target. The conceptual geometry is not to scale.G09 → Base antenna phase centerG09 → Rover antenna phase centerG04 → Base antenna phase centerG04 → Rover antenna phase centerG04TARGETG07G09REFERENCEG16G30b = base − roverBaseEstimated positionRoverFixed header position
Solid: BaseDashed: RoverG09 referenceG04 target
Rover → Base baseline. Five common satellites; selected target and reference highlighted. Conceptual, not to scale.

Code worked example: G04 − G09

Base code SD

21325621.891 − 20149741.844
= 1175880.0469999984 m

Rover code SD

21325674.301 − 20149603.512
= 1176070.7890000008 m

The similar million-metre SDs mostly describe the satellite geometry. Their difference will be only hundreds of metres.

Phase worked example: cycles first

Base phase SD

(112066897.717 − 105887607.793) cycles
= 6179289.923999995 cycles
× 0.19029367279836487 m/cycle
= 1175879.774923887 m

Rover phase SD

(112067164.39 − 105886884.69) cycles
= 6180279.700000003 cycles
× 0.19029367279836487 m/cycle
= 1176068.1230341755 m

The trace converts each phase observation before differencing. Subtracting cycles first is algebraically equivalent but can differ by a few nanometres in floating-point arithmetic.

All single differences in the trace

All target/reference SDs; G09 is the reference, values in metres
TargetBase code SDRover code SDBase phase SDRover phase SD
G041175880.0470001176070.7890001175879.7749241176068.123034
G07984870.074000984818.992000984870.257671984817.818253
G083370389.133000No matching rover3370393.154134No matching rover
G163315272.5580003314817.6680003315272.8285463314813.173228
G203482779.679000No matching rover3482778.495685No matching rover
G302368905.3710002369098.6870002368905.1393572369098.361649

Single-difference observation view

The numerical values are available in the accompanying tables. The interactive chart loads as you approach it.

What one subtraction achieves

Receiver clock cancels
The shared receiver clock is removed from both code and phase SDs.
Warning · What remains
Geometric differences, the satellite-clock difference, atmospheric differences, ambiguities and measurement noise still remain. The next step combines matching SDs from both receivers.

5. Double differences and differencing matrix

Subtract rover SD from base SD. The same reference G09 appears in each pair; retain the exact sign convention throughout the observations and covariance.

Double-difference definition

DD(j,m)=SDB(j,m)−SDR(j,m)DD(j,m)=SD_B(j,m)-SD_R(j,m)
DD=+yB,j−yR,j−yB,m+yR,mDD=+y_{B,j}-y_{R,j}-y_{B,m}+y_{R,m}

Under simultaneous observations, the satellite-clock terms remaining in the SD cancel between receivers. Atmospheric and orbit effects are only reduced according to how correlated they are.

Worked G04 double differences

Code DD

1175880.0469999984 − 1176070.7890000008
= -190.742000002414 m

Phase DD

1175879.774923887 − 1176068.1230341755
= -188.3481102883816 m

Phase − code = 2.393889714 m. This contains ambiguity plus code/phase noise and remaining model differences; it is not ambiguity alone.

All real DD observations

Four target/reference pairs, G09 reference; metres
TargetCode DDPhase DDPhase − code
G04-190.742000-188.3481102.393890
G0751.08200052.4394181.357418
G16454.890000459.6553184.765318
G30-193.316000-193.2222920.093708

DD observation plots

The numerical values are available in the accompanying tables. The interactive chart loads as you approach it.

Differencing matrix D · exact 8 × 20 structure

Stack the 20 independent undifferenced observations in the exported order. A row of D selects four measurements; every other coefficient is zero. Phase and code rows alternate for G04, G07, G16, G30.

yDD⏟8×1=D⏟8×20yUD⏟20×1\underbrace{\mathbf y_{DD}}_{8\times1}=\underbrace{\mathbf D}_{8\times20}\underbrace{\mathbf y_{UD}}_{20\times1}
D: blue −1, teal +1; negative is a valid coefficient8 × 20
Row / columnB G04 ΦR G04 ΦB G09 ΦR G09 ΦB G04 PR G04 PB G09 PR G09 PB G07 ΦR G07 ΦB G07 PR G07 PB G16 ΦR G16 ΦB G16 PR G16 PB G30 ΦR G30 ΦB G30 PR G30 P
G04 phase
G04 code
G07 phase
G07 code
G16 phase
G16 code
G30 phase
G30 code

G04 phase × B G04 Φ = 1

Show full mathematical matrix

G04 phase: row-by-column product

+1 × B G04 Φ (21325621.56568662 m)
−1 × R G04 Φ (21325672.311871227 m)
−1 × B G09 Φ (20149741.790762734 m)
+1 × R G09 Φ (20149604.18883705 m)
= (1) × (21325621.56568662) + (-1) × (21325672.311871227) + (-1) × (20149741.790762734) + (1) × (20149604.18883705)
Sum of signed contributions = 21325621.56568662 + -21325672.311871227 + -20149741.790762734 + 20149604.18883705
= -188.3481102883816 m

This is the same DD as the SD subtraction. Round-off may affect the last few nanometres if four large phase values are combined in a different arithmetic order.

Next: one geometric row per observation
D constructs observed differences. H constructs the baseline and ambiguity model for those differences. D also propagates undifferenced variances into the correlated DD covariance.

6. Linear design matrix

Linear baseline-domain DD model with LOS vectors fixed at the lesson epoch. The exact range norm is nonlinear in receiver coordinates; double differencing does not make it exactly linear.

Freeze the LOS, then construct H

Evaluate satellite states and LOS at the approximate/fixed coordinates. Under this frozen, first-order baseline representation, y = Hx + ε is linear in the baseline components and ambiguity states.

x=[dX,dY,dZ,N04,N07,N16,N30]T,hxyz=−uj+um\mathbf x=[dX,dY,dZ,N_{04},N_{07},N_{16},N_{30}]^T,\qquad\mathbf h_{xyz}=-\mathbf u_j+\mathbf u_m
Observations8
Unknowns7
Float DOF = 8 − 71

Row-by-row geometry walkthrough

Target unit LOS = [-0.111787951, 0.935235390, 0.335914005]. Reference G09 = [0.263253170, 0.680782993, 0.683543916]. Both use the same fixed rover origin.

−uG04 + uG09

X: −(-0.11178795074091966) + (0.26325317028501133) = 0.375041121025931
Y: −(0.9352353903067376) + (0.6807829927840786) = -0.25445239752265914
Z: −(0.3359140050473482) + (0.6835439159782231) = 0.34762991093087486

Each coefficient tells how a metre of baseline along that ECEF axis changes the modelled DD.

Phase row versus code row

HΦ,j=[hX,hY,hZ,…,λj,…]H_{\Phi,j}=[h_X,h_Y,h_Z,\ldots,\lambda_j,\ldots]
[0.3750411−0.25445240.34762990.19029370.00000000.00000000.00000000.3750411−0.25445240.34762990.00000000.00000000.00000000.0000000]\begin{bmatrix}0.3750411 & -0.2544524 & 0.3476299 & 0.1902937 & 0.0000000 & 0.0000000 & 0.0000000\\0.3750411 & -0.2544524 & 0.3476299 & 0.0000000 & 0.0000000 & 0.0000000 & 0.0000000\end{bmatrix}

Rows above: G04 phase, then code. Place λ = 0.19029367279836487 m/cycle only in this target’s ambiguity column. Code has no carrier integer ambiguity, so all four ambiguity coefficients are zero.

Full design matrix and observation vector

H: geometry columns followed by four cycle ambiguities8 × 7
Row / columndXdYdZN04N07N16N30
G04 phase
G04 code
G07 phase
G07 code
G16 phase
G16 code
G30 phase
G30 code

G04 phase × dX = 0.375041121025931

Show full mathematical matrix
Show y and explicit ordering
Observation vector y; same row order as H, in metres
RowValue
G04 phase-188.3481102884
G04 code-190.7420000024
G07 phase52.4394177087
G07 code51.0819999985
G16 phase459.6553181112
G16 code454.8899999969
G30 phase-193.2222924232
G30 code-193.3160000034
[−188.348110288−190.74200000252.43941770951.081999999459.655318111454.889999997−193.222292423−193.316000003]\begin{bmatrix}-188.348110288\\-190.742000002\\52.439417709\\51.081999999\\459.655318111\\454.889999997\\-193.222292423\\-193.316000003\end{bmatrix}

One complete H row × x example

G04 phase prediction using the float state

dX: (0.375041121025931) × (329.96449120681626) = 123.75025268095533
dY: (-0.25445239752265914) × (331.82978936717865) = -84.43488547391759
dZ: (0.34762991093087486) × (-661.7168607071129) = -230.03257334907178
N04: (0.19029367279836487) × (12.449682739387208) = 2.3690958536524005
N07: (0) × (6.983324467405504) = 0
N16: (0) × (25.00173284312381) = 0
N30: (0) × (0.48040378538633366) = 0
= -188.34811028838166 m

Sum all seven products. Predicted DD plus the post-fit residual equals the observed −188.34811028838158 m. H is now ready, but observations are correlated: solve using R_DD, not equal independent weights.

7. Stochastic model and DD covariance

Measurements have different precision. Low elevation increases the assumed noise, and a shared reference makes double differences correlated.

Elevation-dependent observation variance

Nominal phase σ₀ = 0.006 m; code σ₀ = 0.7 m. Use the receiver-specific satellite elevation E in degrees.

σi=σ0max⁡(sin⁡Ei,0.25),Var⁡(yi)=σi2\sigma_i={\sigma_0\over\max(\sin E_i,0.25)},\qquad \operatorname{Var}(y_i)=\sigma_i^2

Base G04 phase weighting

E = 47.10224609536898°
sin(E) = 0.7325695836802872
max(0.7325695836802872, 0.25) = 0.7325695836802872
σ = 0.006 / 0.7325695836802872 = 0.008190348239490323 m
Variance = (0.008190348239490323)² = 0.00006708180428412224 m²
Independent UD weight = 1 / 0.00006708180428412224 = 14907.172081486371 m⁻²

Lower elevation increases σ and decreases weight. The floor 0.25 avoids unbounded noise near the horizon.

From independent UD to correlated DD

Assume the 20 undifferenced code/phase measurements are independent in this lesson. R_UD is diagonal in m². Differencing propagates their noise using the same D as the observations.

RDD⏟8×8=D⏟8×20RUD⏟20×20DT⏟20×8\underbrace{R_{DD}}_{8\times8}=\underbrace D_{8\times20}\underbrace{R_{UD}}_{20\times20}\underbrace{D^T}_{20\times8}

For one entry, take row i of D R_UD and column j of Dᵀ: sum Dᵢₖ · σₖ² · Dⱼₖ across the 20 columns. Most products are zero.

Keep the off-diagonal entries
Using a diagonal approximation to R_DD would discard the shared-reference correlation and change the weighted problem.

Worked diagonal: G04 phase variance

R00=∑k=019D0kσk2D0kR_{00}=\sum_{k=0}^{19}D_{0k}\sigma_k^2D_{0k}

Four nonzero products

(1) × 0.00006708180428412224 × (1) = 0.00006708180428412224
(-1) × 0.00006708368307282375 × (-1) = 0.00006708368307282375
(-1) × 0.000038798961684839866 × (-1) = 0.000038798961684839866
(1) × 0.00003879673170860536 × (1) = 0.00003879673170860536
0.00006708180428412224 + 0.00006708368307282375 + 0.000038798961684839866 + 0.00003879673170860536
= 0.0002117611807503912 m²

Convert variance to standard deviation

σ_DD = √(0.0002117611807503912)
= 0.014552016380914062 m

Squaring the signs makes all four independent variance contributions positive.

Off-diagonal covariance: shared G09

R02=Cov⁡(DD04,Φ,DD07,Φ)=∑kD0kσk2D2kR_{02}=\operatorname{Cov}(DD_{04,\Phi},DD_{07,\Phi})=\sum_kD_{0k}\sigma_k^2D_{2k}

Only the two shared reference columns overlap

Base G09: (−1) × 0.000038798961684839866 × (−1) = 0.000038798961684839866
Rover G09: (+1) × 0.00003879673170860536 × (+1) = 0.00003879673170860536
0.000038798961684839866 + 0.00003879673170860536
= 0.00007759569339344522 m²

Correlation coefficient

0.00007759569339344522 / √(0.0002117611807503912 × 0.00016440829112487126)
= 0.41586520580049174

Reusing the reference observations couples DD errors even when their target measurements are independent.

DD covariance heatmap

R_DD (m²); color intensity encodes correlation8 × 8
Row / columnG04 phaseG04 codeG07 phaseG07 codeG16 phaseG16 codeG30 phaseG30 code
G04 phase
G04 code
G07 phase
G07 code
G16 phase
G16 code
G30 phase
G30 code

G04 phase × G04 phase = 0.0002117611807503912 m² · correlation = 1.000000

Show full mathematical matrix

Phase and code alternate. Nonzero off-diagonals form same-observable blocks; phase/code cross-covariances are zero under this model. Select a cell for exact covariance and correlation.

Undifferenced covariance diagonal

R_UD diagonal: all 20 exported variances in m²
UD observationVariance
phase:base:G040.0000670818
phase:rover:G040.0000670837
phase:base:G090.0000387990
phase:rover:G090.0000387967
code:base:G040.9130578916
code:rover:G040.9130834640
code:base:G090.5280969785
code:rover:G090.5280666260
phase:base:G070.0000434081
phase:rover:G070.0000434045
code:base:G070.5908320790
code:rover:G070.5907838345
phase:base:G160.0003200092
phase:rover:G160.0003198158
code:base:G164.3556813318
code:rover:G164.3530484264
phase:base:G300.0000998609
phase:rover:G300.0000998644
code:base:G301.3592179401
code:rover:G301.3592659944
Show full 20 × 20 R_UD
Ready for weighted least squares
R_DD has positive eigenvalues (minimum 0.00010396339754041666 m²). Cholesky can now turn this correlated system into independent unit-variance observations.

8. Float solution (weighted least squares)

Solve the 8-observation, 7-unknown system without forming a matrix inverse or squaring its condition number through normal equations.

Cholesky → whitening → QR → solution

y=Hx+ϵ,RDD=LLT,LHw=H,Lyw=yy=Hx+\epsilon,\quad R_{DD}=LL^T,\quad LH_w=H,\quad Ly_w=y
Hw=QR,Rx=QTyw,min⁡x∥yw−Hwx∥2H_w=Q R,\quad R x=Q^Ty_w,\quad \min_x\|y_w-H_wx\|^2

Cholesky handles measurement correlation; triangular solves whiten H and y. Reduced QR supplies an upper-triangular R and the transformed right-hand side. Back substitution yields the baseline and float ambiguities.

1. Verify the Cholesky factors

Lii=Rii−∑k<iLik2,Lji=Rji−∑k<iLjkLikLiiL_{ii}=\sqrt{R_{ii}-\sum_{k<i}L_{ik}^2},\quad L_{ji}={R_{ji}-\sum_{k<i}L_{jk}L_{ik}\over L_{ii}}

First diagonal and a shared-reference entry

L00 = √(0.0002117611807503912) = 0.014552016380914063
L20 = 0.00007759569339344522 / 0.014552016380914063 = 0.005332298381358141
L22 = √(0.00016440829112487126 − (0.005332298381358141)²) = 0.011660826947392565
Verify R02 = L00 × L20 = 0.014552016380914063 × 0.005332298381358141 = 0.00007759569339344522

The positive off-diagonal covariance creates a nonzero lower-triangular coefficient.

Show full L (8 × 8)

2. Whiten by triangular solve

Solve L · y_w = y row by row, and L · H_w = H for each column. The inverse notation is explanatory; no inverse is computed.

First phase observation and first H coefficient

y_w0 = -188.3481102883816 / 0.014552016380914063 = -12943.09361384534
H_w00 = 0.375041121025931 / 0.014552016380914063 = 25.772450443212964
y_w2 = (52.43941770866513 − 0.005332298381358141 × (-12943.09361384534)) / 0.011660826947392565
= 10415.715401959364

A later phase row subtracts the shared-reference contribution already carried by earlier rows. Whitening is more than dividing every DD by its own sigma.

Original and whitened system

Original H and y
Show full whitened H_w (8 × 7) and y_w (8 × 1)

3. QR and back substitution

Reduced Q is 8 × 7, R is 7 × 7, and b = Qᵀy_w is 7 × 1. The unused orthogonal residual direction accounts for one degree of freedom.

One Qᵀ row-by-column product

Q(1,1) × y_w1 = (-0.342730699188212) × (-12943.09361384534) = 4435.995523931694
Q(2,1) × y_w2 = (-0.002937691707327533) × (-112.35085130445847) = 0.3300521641882964
Q(3,1) × y_w3 = (0.5737978481463599) × (10415.715401959364) = 5976.515084549181
Q(4,1) × y_w4 = (0.004918267269825945) × (88.92456611407272) = 0.43735478300231717
Q(5,1) × y_w5 = (-0.454603687891473) × (18710.946577367285) = -8506.065318011502
Q(6,1) × y_w6 = (-0.003896603039069769) × (159.15062306634192) = -0.6201468015101552
Q(7,1) × y_w7 = (0.5886881349760987) × (-12589.85232486183) = -7411.496684747411
Q(8,1) × y_w8 = (0.0050458982997951315) × (-107.27341045280696) = -0.5412907194170439
= -5505.445424851773
Show R_QR, Q, and actual Qᵀy_w
Numerical back substitution: every unknown, last row first

Float solution: baseline + ambiguities

Real float state and unscaled formal 1σ from the trace
UnknownFloat valueFormal σUnit
dX329.9644912072.554462048m
dY331.8297893672.903071546m
dZ-661.7168607073.380692046m
N0412.4496827396.668804648cycles
N076.9833244673.907815928cycles
N1625.00173284316.319926290cycles
N300.48040378510.195412531cycles
Exact solution vector

Conditioning and degrees of freedom

κ(H_w)1636.8
8 − 7 observations/unknowns1 DOF
Warning · Weak conditioning
1636.8 indicates substantially weaker conditioning than the candidate-fixed geometry-only problem. With only one residual degree of freedom, single-epoch fit diagnostics are limited.

Float means the four ambiguity states are real numbers, not yet constrained to integers.

4. Formal state covariance

Qxx=RQR−1RQR−T,σxi=Qxx,iiQ_{xx}=R_{QR}^{-1}R_{QR}^{-T},\qquad \sigma_{x_i}=\sqrt{Q_{xx,ii}}

Compute the factors with triangular solves. This is covariance under the declared measurement model, without rescaling by the tiny post-fit variance factor.

Construct Q_xx from triangular covariance factors

First baseline sigma

Q_xx00 = 6.525276353430393 m²
σX = √(6.525276353430393)
= 2.554462047756904 m
Full Q_xx (7 × 7), including baseline–ambiguity correlations

The lower-right 4 × 4 block Q_NN is the ambiguity covariance passed into LAMBDA.

5. Post-fit residuals

The numerical values are available in the accompanying tables. The interactive chart loads as you approach it.

Why phase residuals are nearly zero

v=y−Hx^,vw=L−1vv=y-H\hat x,\qquad v_w=L^{-1}v

G04 code residual

-190.742000002414 − ((0.375041121025931) × (329.96449120681626) + (-0.25445239752265914) × (331.82978936717865) + (0.34762991093087486) × (-661.7168607071129) + (0) × (12.449682739387208) + (0) × (6.983324467405504) + (0) × (25.00173284312381) + (0) × (0.48040378538633366))
= -0.02479386037992981 m
Warning · Not perfect carrier-phase data
Each of the four phase DD observations has its own ambiguity parameter. Those parameters can absorb phase differences at a single epoch, leaving phase residuals near zero. This does not prove flawless phase measurements.

9. LAMBDA ambiguity fixing

Find the closest integer vector under the full correlated ambiguity covariance, rather than rounding each component independently.

Float ambiguity vector

[12.44968273946.983324467425.00173284310.4804037854]\begin{bmatrix}12.4496827394\\6.9833244674\\25.0017328431\\0.4804037854\end{bmatrix}

Ordering: N04, N07, N16, N30, all relative to G09. These real-valued estimates include substantial covariance and cannot be judged one component at a time.

Q_NN: real ambiguity covariance (cycles²)4 × 4
Row / columnN04N07N16N30
N04
N07
N16
N30

N04 × N04 = 44.472955436810025

Show full mathematical matrix

Integer least squares versus naive rounding

n^=arg⁡min⁡n∈Z4(a−n)TQNN−1(a−n)\hat n=\arg\min_{n\in\mathbb Z^4}(a-n)^TQ_{NN}^{-1}(a-n)
Full four-dimensional candidate comparison
CandidateInteger vectorSquared norm
Best LAMBDA[13, 7, 27, 1]0.067325666147
Second[11, 7, 22, -1]0.097304202353
Naive rounding[12, 7, 25, 0]0.163160530559
Comparison · Rounding is feasible, but inferior
[12, 7, 25, 0] is an integer vector, but it does not minimize this correlated metric. The best vector is [13, 7, 27, 1].

Naive squared norm: derived from exported Q_NN

This value is derived from the package inputs, not an additional raw exported result. Solve Q_NN · w = (a − n_round), then dot the error with w.

Weighted four-dimensional distance

e = a − n_round = [0.4496827393872085, -0.016675532594495834, 0.0017328431238112785, 0.48040378538633366]
Solve Q_NN w = e → w = [2.3866232595980623, 4.946024743825871, -0.292327924687441, -1.7216321448728586]
e1 × w1 = (0.4496827393872085) × (2.3866232595980623) = 1.0732232852612855
e2 × w2 = (-0.016675532594495834) × (4.946024743825871) = -0.08247759682885121
e3 × w3 = (0.0017328431238112785) × (-0.292327924687441) = -0.0005065584341926535
e4 × w4 = (0.48040378538633366) × (-1.7216321448728586) = -0.8270785994397141
Sum = 1.0732232852612855 + -0.08247759682885121 + -0.0005065584341926535 + -0.8270785994397141
= 0.1631605305585275

The full correlated metric makes this larger than both exported LAMBDA candidate norms. No explicit covariance inverse is needed.

LAMBDA integer transformation

Z: integer unimodular matrix4 × 4
Row / column1234
N04
N07
N16
N30

N04 × column 1 = 17

Show full mathematical matrix

det(Z) = +1. An integer unimodular transformation preserves the integer lattice while reducing covariance correlation for search.

z=ZTa,Qz=ZTQNNZz=Z^Ta,\qquad Q_z=Z^TQ_{NN}Z

First transformed ambiguity: column 1 of Z × a

(17) × (12.449682739387208) = 211.64460656958255
(35) × (6.983324467405504) = 244.41635635919263
(-2) × (25.00173284312381) = -50.00346568624762
(-12) × (0.48040378538633366) = -5.764845424636004
= 400.2926518178916 cycles
All four z entries and Q_z

Candidates in ambiguity space

The full covariance sets the scale. The close view separates the actual candidates without distorting either axis.

01 / Covariance overviewMarginal covariance · 1σ
N04 and N16 marginal ambiguity covarianceA one-sigma marginal covariance ellipse surrounds the float point. A square marks the area enlarged in the candidate-detail panel. Both axes use equal cycle scales. Candidate ranking uses all four ambiguities.-505101520253051015202530354045Float estimate · [12.449682739387208, 6.983324467405504, 25.00173284312381, 0.48040378538633366] cyclesBest LAMBDA · [13, 7, 27, 1] cycles · 4D norm 0.06732566614671152Second candidate · [11, 7, 22, -1] cycles · 4D norm 0.09730420235313753Naive rounding · [12, 7, 25, 0] cycles · 4D norm 0.1631605305585275Detail →N04 (cycles)N16 (cycles)
02 / Candidate detailInteger lattice · 1 cycle
Close view of the actual integer candidatesThe integer lattice separates best (13,27), second (11,22), naive (12,25), and the float point (12.449682739387208,25.00173284312381). Both axes use equal cycle scales. Candidate ranking uses all four ambiguities.8101214162123252729Float estimate · [12.449682739387208, 6.983324467405504, 25.00173284312381, 0.48040378538633366] cyclesFloatBest LAMBDA · [13, 7, 27, 1] cycles · 4D norm 0.06732566614671152BestSecond candidate · [11, 7, 22, -1] cycles · 4D norm 0.09730420235313753SecondNaive rounding · [12, 7, 25, 0] cycles · 4D norm 0.1631605305585275RoundedN04 (cycles)N16 (cycles)
Best LAMBDA[N04, N07, N16, N30] = [13, 7, 27, 1] cyclesFull 4D squared norm = 0.06732566614671152

Equal axis scales. The dashed ellipse is a 1σ contour of the N04/N16 marginal covariance, not a validation boundary or the full 4D search region. A shorter distance in this projection does not determine the best candidate; ranking uses the complete Q_NN.

Independent rounding can choose a poorer candidate because the objective depends on all four ambiguities and their correlations.

Search and back-transform

The Qelaro lambda_method path decorrelates the float ambiguities and performs integer search in z-space. The covariance metric guides enumeration and pruning; it is not a nearest-point search in a two-dimensional picture.

Exported candidates transformed by Zᵀ; derived integer vectors
Candidatez candidateOriginal nNorm
Best[400, -157, -164, -190][13, 7, 27, 1]0.067325666147
Second[400, -158, -165, -191][11, 7, 22, -1]0.097304202353
Verify the best and second full 4D squared norms numerically
n=Z−Tzintegern=Z^{-T}z_{integer}
Show integer back-transform and first row product

For the full algorithmic decorrelation and search walkthrough, continue to the LAMBDA Method tutorial →.

Ratio diagnostic

ratio=s2s1\mathrm{ratio}={s_2\over s_1}

Second / best squared norm

0.09730420235313753 / 0.06732566614671152
= 1.445276488480616
Warning · Candidate-fixed; not validated
LAMBDA produced a best candidate. The ratio 1.445276488480616 is a diagnostic, not an accepted operational fix. A single epoch does not validate ambiguity reliability, continuity, or multi-epoch post-fix behavior. Next, constrain the geometry to this candidate for teaching.

10. Candidate-fixed solution and baseline

Hold [N04,N07,N16,N30] = [13,7,27,1] and estimate the three baseline components using the same full R_DD.

Remove integer phase contributions

yfixed=y−HNn,yfixed=Hxyzb+ϵy_{fixed}=y-H_Nn,\qquad y_{fixed}=H_{xyz}b+\epsilon

G04 phase adjusted observation

-188.3481102883816 − (0.19029367279836487 × 13)
0.19029367279836487 × 13 = 2.473817746378743
= -190.82192803476036 m

Code rows do not change. Only the phase ambiguity contributions are subtracted; all eight observations and their covariance remain.

Observations8
Free unknowns: dX,dY,dZ3
Degrees of freedom: 8 − 35

Whiten and QR the three-column system

LHxyz,w=Hxyz,Lyfixed,w=yfixed,R3b=Q3Tyfixed,wL H_{xyz,w}=H_{xyz},\quad L y_{fixed,w}=y_{fixed},\quad R_3 b=Q_3^Ty_{fixed,w}

First candidate-fixed whitening and last QR row

y_fixed,w0 = -190.82192803476036 / 0.014552016380914063 = -13113.09189323316
R33 × dZ = b3
(34.51096719520549) × dZ = -22843.033070292375
dZ = -22843.033070292375 / 34.51096719520549
= -661.9064873228442 m
Full H_xyz,w (8 × 3), whitened y, QR R and right-hand side
Numerical back substitution: every unknown, last row first

Baseline vector: rover → base

Candidate-fixed ECEF baseline and formal conditional standard deviations
AxisBaseline (m)Formal σ (m)
X329.639363605620.02189458470
Y331.511369913970.02488255636
Z-661.906487322840.02897629598

Baseline length

‖b‖ = √((329.63936360562184)² + (331.5113699139712)² + (-661.9064873228442)²)
dX² = 108662.11003831937 m²
dY² = 109899.78838223784 m²
dZ² = 438120.19796006655 m²
Sum = 656682.0963806238 m²
= 810.3592390912956 m

Base ECEF: fixed rover + baseline

Coordinate addition in metres; base is estimated, rover held fixed
AxisFixed rover+ baseline= estimated base
X3246374.5864329.6393636063246704.225763605
Y4052665.3939331.5113699144052996.905269914
Z3693176.0609-661.9064873233692514.154412677
Improved conditioning
κ(H_w): 1636.8 → 3.01124. Ratio = 543.567×. Constraining four ambiguity parameters strengthens the geometry problem; it does not validate those integers.

Formal covariance and baseline-length uncertainty

Qb=R3−1R3−T,g=b∥b∥,σ∥b∥2=gTQbgQ_b=R_3^{-1}R_3^{-T},\quad g={b\over\|b\|},\quad \sigma_{\|b\|}^2=g^TQ_bg
Candidate-fixed baseline covariance Q_b (m²)3 × 3
Row / columnXYZ
X
Y
Z

X × X = 0.0004793728393903604

Show full mathematical matrix

Length variance: full covariance propagation

g = [0.4067817675223475, 0.409091861883027, -0.8168062451723012]
Q_b g = [0.0003660057369139119, 0.00038247516328917267, -0.0006597058197951598]
g1 × (Q_b g)1 = 0.4067817675223475 × 0.0003660057369139119 = 0.0001488844605851604
g2 × (Q_b g)2 = 0.409091861883027 × 0.00038247516328917267 = 0.0001564674766739824
g3 × (Q_b g)3 = -0.8168062451723012 × -0.0006597058197951598 = 0.0005388518335851993
Variance = 0.0008442037708443421 m²
σlength = √(0.0008442037708443421)
= 0.029055184921874824 m
Warning · Formal precision ≠ external accuracy
These centimetre-level formal conditional sigmas assume fixed rover approximate coordinates, the selected R_DD, and the chosen exact integer candidate. They exclude rover coordinate uncertainty, absolute base truth error, atmosphere/model error, orbit model error, multipath and wrong-candidate risk. This is not a claim of centimetre external accuracy.

11. Results and statistical diagnostics

A fit must be interpreted against its stochastic assumptions. Neither small residuals nor small formal covariance prove that the position or integer candidate is correct.

Post-fit double-difference residuals

The numerical values are available in the accompanying tables. The interactive chart loads as you approach it.

All exact float and candidate-fixed residuals

Formal conditional precision

The numerical values are available in the accompanying tables. The interactive chart loads as you approach it.

1σ coordinate precision in metres, conditional on the model
AxisFloatCandidate-fixed
X2.5544620.021895
Y2.9030720.024883
Z3.3806920.028976

Chi-square: whitened residual energy

χ2=vTRDD−1v=vwTvw,ν=n−p\chi^2=v^T R_{DD}^{-1}v=v_w^Tv_w,\qquad \nu=n-p

A two-sided 95% consistency interval uses χ² quantiles at 0.025 and 0.975 for ν degrees of freedom. Too little residual energy is also inconsistent with the declared model.

Numerical sum of squared whitened residuals

Float chi-square · DOF 1

95% two-sided interval0.0009825.0238860.00048325Log scale · statistic lies below the lower bound

χ² = 0.0004832536841015236 · DOF = 1. Interval [0.0009820691171752555, 5.02388618731489]. Two-sided consistency: below lower bound.

Warning · Below lower bound
0.0004832536841015236 < 0.0009820691171752555. This does not pass the two-sided test.

Candidate-fixed chi-square · DOF 5

95% two-sided interval0.83121212.8325020.067809Log scale · statistic lies below the lower bound

χ² = 0.06780891982717298 · DOF = 5. Interval [0.8312116134866626, 12.832501994030023]. Two-sided consistency: below lower bound.

Warning · Below lower bound
0.06780891982717298 < 0.8312116134866626. This also does not pass the two-sided test.
Warning · Why unusually small residual energy matters
Possible explanations include an over-conservative noise model, single-epoch parameter flexibility, or mismatched stochastic assumptions. The float phase ambiguity parameters absorb the four phase observations. An unusually small χ² does not prove superior accuracy, and the candidate remains unvalidated.

12. What this lesson proves — and what it does not

The full numerical path is reproducible. Its conclusions are conditional on a deliberately small, one-epoch teaching model.

This lesson demonstrates

  • ✓Real one-epoch RINEX processing
  • ✓Broadcast NAV satellite propagation
  • ✓Common satellite and reference selection
  • ✓Satellite-to-satellite single differences
  • ✓Between-receiver double differences
  • ✓H construction with fixed LOS vectors
  • ✓D construction and covariance propagation
  • ✓Correlated R_DD and Cholesky whitening
  • ✓QR weighted least squares and float ambiguities
  • ✓LAMBDA candidate search
  • ✓Constrained candidate-fixed baseline
  • ✓Residual and chi-square diagnostics

These claims are not proven

  • ×Validated multi-epoch PPK performance
  • ×Production ambiguity fixing reliability
  • ×Cycle-slip management over time
  • ×Reference-change continuity
  • ×External absolute coordinate accuracy
  • ×Full atmospheric / antenna correction validation
  • ×Equivalence to a complete production RTKLIB solution
  • ×Centimetre external accuracy
Carry the evidence forward
Keep the observation signs, covariance correlations, baseline direction and validation status together. The strongest result of this lesson is that you can inspect every stage from raw code/phase through to the conditional coordinate covariance.

Resources and numerical provenance

Use the immutable exports to check the numbers independently, then continue through the related tutorials.

Questions this example answers

Which clocks cancel in this single- and double-difference convention?

Subtracting target minus reference at the same receiver removes that receiver's clock term. Subtracting the rover SD from the base SD then removes common satellite-clock terms for simultaneous observations. Atmosphere, orbit error and multipath do not automatically vanish.

Why is the double-difference covariance not diagonal?

Every target pair reuses measurements from G09. Its observation noise appears in several differences, creating off-diagonal covariance. The weighted solution therefore retains the complete D R_UD Dᵀ matrix.

Is the integer candidate accepted as an operational fix?

No. The best candidate [13, 7, 27, 1] has ratio 1.445276488480616 and is used for a constrained teaching solution. Candidate selection, operational validation and external position accuracy are separate claims; this one-epoch run does not establish the latter two.