You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for open sourcing this project and blogging about it! Your posts along with Bartosz Ciechanowski's inspired me to build my own GPS receiver.
I recently started implementing the tracking logic and ran into the same issue you described in your second post, namely that I couldn't track a signal for more than a few seconds. Decreasing the loop bandwidth helped a bit but I still lost the signal after a minute or so. Today I found a fix for my code and wanted to share it with you because I think it may also work for Gypsum.
Previously I performed carrier wipeoff and updated the carrier wave's frequency/phase shifts like this:
where t is the time at which the sample was taken. This could also be written as
$$
\theta = 2 \pi \Delta f(t)\ t + \phi.
$$
In other words, it assumes that the current carrier frequency shift has applied since the receiver started (which probably isn't true), uses that to perform the majority of the wipeoff, and adds the current carrier phase shift as a final adjustment.
i.e. it no longer assumes the current carrier frequency shift has applied since the receiver started. Instead it accumulates the frequency-shift-induced phase changes, allowing the frequency to change over time.
The code achieves this by adding the carrier_frequency_shift_hz term to carrier_phase_shift_rad which accounts for the phase shift that will occur between iterations of the tracking loop due to the frequency shift. This means that the phase of the first sample in each chunk will be equal to carrier_phase_shift_rad (plus some noise). From there we just need to undo the effects of the frequency shift on each subsequent sample which is what the 2 * np.pi * carrier_frequency_shift_hz * ts term does in carrier wipeoff — there's no need to add samples_start_time.
Hopefully that makes sense and is useful.
Thanks again for your great work!
The text was updated successfully, but these errors were encountered:
Hi,
Thanks for open sourcing this project and blogging about it! Your posts along with Bartosz Ciechanowski's inspired me to build my own GPS receiver.
I recently started implementing the tracking logic and ran into the same issue you described in your second post, namely that I couldn't track a signal for more than a few seconds. Decreasing the loop bandwidth helped a bit but I still lost the signal after a minute or so. Today I found a fix for my code and wanted to share it with you because I think it may also work for Gypsum.
Previously I performed carrier wipeoff and updated the carrier wave's frequency/phase shifts like this:
If we consider a single sample, this calculates its phase for carrier wipeoff as
where
t
is the time at which the sample was taken. This could also be written asIn other words, it assumes that the current carrier frequency shift has applied since the receiver started (which probably isn't true), uses that to perform the majority of the wipeoff, and adds the current carrier phase shift as a final adjustment.
The fix required two changes:
where
tracking_interval
is the time in seconds between iterations of the tracking loop.Again, if we consider a single sample, this calculates its phase for carrier wipeoff as
i.e. it no longer assumes the current carrier frequency shift has applied since the receiver started. Instead it accumulates the frequency-shift-induced phase changes, allowing the frequency to change over time.
The code achieves this by adding the
carrier_frequency_shift_hz
term tocarrier_phase_shift_rad
which accounts for the phase shift that will occur between iterations of the tracking loop due to the frequency shift. This means that the phase of the first sample in each chunk will be equal tocarrier_phase_shift_rad
(plus some noise). From there we just need to undo the effects of the frequency shift on each subsequent sample which is what the2 * np.pi * carrier_frequency_shift_hz * ts
term does in carrier wipeoff — there's no need to addsamples_start_time
.Hopefully that makes sense and is useful.
Thanks again for your great work!
The text was updated successfully, but these errors were encountered: