osqzss / gps-sdr-sim

Software-Defined GPS Signal Simulator
MIT License
2.62k stars 762 forks source link

What does "f_carr" represents in the ComputeCodePhase() function? #296

Open AntI-HI opened 2 years ago

AntI-HI commented 2 years ago

// Pseudorange rate. rhorate = (rho1.range - chan->rho0.range)/dt;

// Carrier and code frequency. chan->f_carr = -rhorate/LAMBDA_L1; printf("f_carr -> %f\n", chan->f_carr); chan->f_code = CODE_FREQ + chan->f_carrCARR_TO_CODE; printf("f_code -> %f\n", chan->f_code); printf("chan->f_carrCARR_TO_CODE -> %f\n", chan->f_carr*CARR_TO_CODE);

In the above code, based on the rhorate and wavelength of the L1 band, we determine the carrier frequency. But frequencies we found diverges tremendously from the 1575.42 khz. I get some values like 2870.789292, -2981.129475 etc. What is that negative frequency doing here? Can You explain the idea for this and the whole concept for that function?

terrymarkovich commented 2 years ago

I believe that is just the doppler shift in Hz

Imtiaz08 commented 2 years ago

2870.789292 this much doppler shift?

terrymarkovich commented 2 years ago

Yes, GPS doppler shift can be up to 5,000 Hz

Imtiaz08 commented 2 years ago

Oh!

Can you also explain how is the spoofing signal generated using thr ephemeris and desired coordinates? I mean what parameters are changing and how is the İQ file generated?