gps-sdr-sim icon indicating copy to clipboard operation
gps-sdr-sim copied to clipboard

Why do you calculate the initial carrier phase this way?

Open Zissi-Lei opened this issue 5 years ago • 1 comments
trafficstars

In the function of allocateChannel, there is a initial carrier phase needs to be calculated.

// Initialize pseudorange computeRange(&rho, eph[sv], &ionoutc, grx, xyz); chan[i].rho0 = rho;

// Initialize carrier phase r_xyz = rho.range;

computeRange(&rho, eph[sv], &ionoutc, grx, ref); r_ref = rho.range;

phase_ini = (2.0*r_ref - r_xyz)/LAMBDA_L1; #ifdef FLOAT_CARR_PHASE chan[i].carr_phase = phase_ini - floor(phase_ini); #else phase_ini -= floor(phase_ini); chan[i].carr_phase = (unsigned int)(512.0 * 65536.0 * phase_ini); #endif

I don't quite understand the principle of this formula. Can this r_xyz be set at will? Or it must be set to the origin?

Thanks for your time!

Zissi-Lei avatar May 26 '20 13:05 Zissi-Lei

As long as I understood r_xyz keeps the pseudo range for which you give receiver location as command line argument and the satellite position which is calculated from the ephemeris data. But didn't understand the logic behind calculating the initial phase tho. In "phase_ini = (2.0*r_ref - r_xyz)/LAMBDA_L1;", What is the logic in it? Why do we multiply r_ref with 2.0 etc.

AntI-HI avatar Sep 01 '21 11:09 AntI-HI