-
Notifications
You must be signed in to change notification settings - Fork 128
Description
The pocket_acq.py script is unable to acquire known-good GPS L1 C/A signals, even when the signal is very strong (e.g., >50 dB-Hz C/N0). When run, the script's 3D correlation plot shows no discernible correlation peak, and acquisition fails.
The same signal files are successfully acquired by other tools like gnss-sdr. The issue was observed with files at different sampling rates, including 3 Msps and 12 Msps.
Steps to Reproduce
- Obtain a signal capture file containing a GPS L1 C/A signal. I used signals generated by SignalSim simulator
- Run the acquisition script with the appropriate parameters. For example:
python3 pocket_acq.py -sig L1CA -prn 7 -IQ -f 12 -3d /path/to/your/signal_file.bin
- Observe the 3D correlation plot generated by the script.
The 3D correlation plot is flat, with no significant peak was observed. The script reports a very low C/N0 and fails to acquire the signal.
The issue was traced to the external C library libsdr.so which is used by sdr_func.py for performance-critical operations.
- The sdr_func.py script dynamically loads libsdr.so to execute the FFT-based correlation (corr_fft).
- When this C-based function is used, the correlation fails.
- By forcing the script to bypass the C library and use its internal, pure-Python/NumPy fallback implementation for the correlation, the acquisition succeeds perfectly.
This indicates that the bug is not in the Python logic but within the compiled C code of libsdr.so.
Workaround
The immediate workaround is to disable the use of the libsdr.so library and rely on the pure Python implementation. This can be done with a one-line change:
- Edit the file: PocketSDR/python/sdr_func.py
- Find the line (near the top):
49 LIBSDR_ENA = True
- Change it to:
49 LIBSDR_ENA = False
After this change, pocket_acq.py correctly acquires the signal. The long-term solution would be to debug the C source code of the sdr_corr_fft_cpx function within libsdr.so.