osqzss / gps-sdr-sim

Software-Defined GPS Signal Simulator
MIT License
2.75k stars 773 forks source link

The code generates only 1000 PRN code chips however, the actual code is 1023 chips long why is that so ? #320

Open Imtiaz08 opened 2 years ago

Imtiaz08 commented 2 years ago

@scateu @edy555 @sgk @laf0rge @Mictronics @osqzss

osqzss commented 2 years ago

The C/A code length is defined as CA_SEQ_LEN in gpssim.h:

/! \brief C/A code sequence length /

define CA_SEQ_LEN (1023)

Imtiaz08 commented 2 years ago

Yes, but when I am debugging the code there are only 1000 elements only

Also can you please tell me why are you taking only subframe 5 and subframe 1 to generate the Dwrd in the GenerateNavMessage function?

Imtiaz08 commented 2 years ago

image

osqzss commented 2 years ago

https://stackoverflow.com/questions/57921875/debugging-in-vscode-watching-vectors-with-length-1000

Imtiaz08 commented 2 years ago

Thank you so much sensi can you please answer the second question? i.e. why are you taking only subframe 5 and subframe 1 whole generating the navigation message? Also, are you calculating all the values in decimal? because again in the debugger we can see the decimal values only

osqzss commented 2 years ago

Please ask Google first. https://stackoverflow.com/questions/39973214/how-to-display-hex-value-in-watch-in-vscode

osqzss commented 2 years ago

All the subframes are updated when generateNavMsg() is called:

int generateNavMsg(gpstime_t g, channel_t *chan, int init) { ... for (isbf=0; isbf<N_SBF; isbf++) { // update subframes here. .... } }

Imtiaz08 commented 2 years ago

so basically the eph2sub function converts ephemeris into the subframe and the generatenavMsg function updates the message right?

And I am sorry for not making myself clear enough... Actually, I am implementing the code in Matlab for my MS thesis so I would like to know whether the navigation message is being generated in binary format or it is converted into decimal before writing it to bin file

Imtiaz08 commented 2 years ago

@osqzss sensi, I am using Matlab to write the generated binary data into a file. Can you please provide me any insights on this?

osqzss commented 2 years ago

https://www.mathworks.com/help/satcom/ug/gps-waveform-generation.html

shuwang1 commented 2 years ago

so basically the eph2sub function converts ephemeris into the subframe and the generatenavMsg function updates the message right?

And I am sorry for not making myself clear enough... Actually, I am implementing the code in Matlab for my MS thesis so I would like to know whether the navigation message is being generated in binary format or it is converted into decimal before writing it to bin file

I think they are always in binary, not in decimal, because binary operations, e.g, checksum, are involved.

Imtiaz08 commented 2 years ago

@shuwang1 But the values are always shown in decimal when using VS code