osqzss / gps-sdr-sim

Software-Defined GPS Signal Simulator
MIT License
2.73k stars 771 forks source link

sampling rate #146

Closed gpsnube closed 6 years ago

gpsnube commented 6 years ago

Hi Takuji,

Why does gpssim.c read data at 10Hz while the real GPS satellites only transmit at 1Hz? Also, is there a way to change the: 1. rate that the code reads from the .txt file, and 2. the rate that the data is written to the .bin file? I am confused why the code needs 10 seconds of data to create one second of base-band signal. Your help is greatly appreciated.

osqzss commented 6 years ago

Each GPS satellite is sending continuous radio signal for ranging. In order to emulate it, you need smooth motion information of the GPS satellite and the receiver. The software uses a simple linear approximation to generate the user (receiver) motion, and 10Hz update rate is chosen to minimize the approximation error even for a high speed platform like a satellite. The bin file data rate can be specified by the sample rate.

gpsnube commented 6 years ago

Thank you for your reply. Is it possible to change the update rate from 10Hz to say 100Hz? If so, how might one go about this?

osqzss commented 6 years ago

It is possible but requires some code modification. The user motion update rate is strongly depending on the receiver dynamics that you want to simulate. If it is stationary, you don't need any motion data. You might need 100Hz update rate to simulate a rocket trajectory, but in most cases 10Hz or lower should be enough. The following thread could give you some insight: https://github.com/osqzss/gps-sdr-sim/issues/94

gpsnube commented 6 years ago

I see. Thank you, that is very helpful. According to the logic in issue #94, if the update rate is decreased to say 1Hz, the dynamic error would increase drastically. However, gpssim.c would still produce a transmittable signal with decent position accuracy would it not? Am I understanding this correctly? (My goal is to transmit a signal from data that is being read in only once per second or 1Hz)

osqzss commented 6 years ago

Yes, the simulator can generate a signal stream for any user motion, but it may not be acceptable for your receiver because of its high dynamic error. The easiest way to test your 1Hz data set is to take a double difference of the series of positions and check the possible acceleration error. If it exceeds 2G, the receiver would have some trouble to track the signal.

gpsnube commented 6 years ago

You are right, the 1Hz is not acceptable. I'm having trouble with the original 10Hz rate also. For some reason, the resulting latitude of the generated signal is about 60 degrees W of where is should be. I'm using dynamic scenario but using stationary data. Any clue what could be causing this? What are your thoughts?

osqzss commented 6 years ago

Would you post the geodetic location (latitude, longitude, and height) of the simulated receiver and the corresponding position in the ECEF coordinates in your user motion file?