osqzss / gps-sdr-sim

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

Moving receiver but Coordinates do not change #329

Open FayeWong98 opened 2 years ago

FayeWong98 commented 2 years ago

Why do I try to move the receiver after successful deception, but the coordinates do not change? Theoretically, the signal arrival time changes, and the pseudo range will also be different. The coordinates should be recalculated. I hope someone can answer for me. Thank you!

Imtiaz08 commented 2 years ago

Actually, the simulator generates a simulated signal with respect to a target spoofing location. You are not getting a real signal from satellites thus, your receiver will only be calculating the pseudorange from the spoofer not from the satellite thus it is not changing

FayeWong98 commented 2 years ago

It is clear that all satellite signals are sent from one transmitter, but how to calculate the positioning of four satellites? All the signals come from the same transmitter, with the same pseudo range and time.And the movement does change the time when the deception signal arrives at the receiver, and the generated pseudo range should change. I am still a little confused.

Imtiaz08 commented 2 years ago

Technically, you will need to receive the signal from at least 4 satellites to calculate the pseudorange from all the satellites and then perform positioning. However, the simulator generates the satellite data with the given PRNs (Satellite ID) from the given RINEX files and then transmits each channel which appears to the receiver as if the signals are coming from 4 different satellites.

Imtiaz08 commented 2 years ago

Here's what happens in detail in the code

  1. GPS Satellite Information is extracted from the RINEX file
  2. Satellite position is calculated for the target coordinates using the ephemeris data and time
  3. Pseudorange and elevation angles are calculated for each satellite
  4. Suitable satellites are selected based on their elevation angles (As 8 to 12 SVs can be visible at a time)
  5. Each satellite and its data is kept in channels
  6. I/Q signal is generated from all the data and packed in a .bin file (because of the binary data)
IvanKor commented 2 years ago

Why do I try to move the receiver after successful deception, but the coordinates do not change?

for the same reason as if you replace #define SPEED_OF_LIGHT 2.99792458e8 for example with #define SPEED_OF_LIGHT 4.0e8 the coordinates do not change

FayeWong98 commented 2 years ago

I have a new puzzle. The ephemeris time is wrong - how do we know the exact time of the satellite signal. The signal transmission time is the time when the satellite (deceiver) transmits the signal minus the time when the receiver receives the signal. Why does the coordinate do not change when changing the speed of light? After all, the pseudo range has changed.

Imtiaz08 commented 2 years ago

The ephemeris time in the rinex file is basically the time at which the signal was received and stored in the Rinex file.

Suppose you have recorded a signal and created a RINEX file yesterday it will have the time of yesterday.

One more thing i.e. the time is in UTC which means I, a person from Pakistan, if reading the file, the time will be 5 hours early because we live in GMT+5

FayeWong98 commented 2 years ago

But I am still confused about why the coordinates of the mobile receiver do not change. Just like two circles with a radius of 1, when the receiver moves (the signal arrival time changes) resulting in a radius of 2, the coordinates of the intersection of the two circles should change.

Imtiaz08 commented 2 years ago

Again, you are creating a scenario as if everything is constant and not moving (in the case of static signal mode). A receiver itself doesn't know what time is it and where is it going or coming from.

When you transmit a spoofing signal it sends a uniform signal whose parameters begin from the time of transmission and is incremented gradually after every 30 seconds.

In simple words, You are telling the receiver as if it is static and getting a signal from a satellite at a specific time and date

In the case of a moving scene, the receiver is told as if it is moving even if it is standing in one place. Here the code phases and doppler frequency of the signal is modeled in such a way that helps in the deception of the receiver

antex00715 commented 1 year ago

Imtiaz08 how to solve rinex file time delay