# PocketSDR
**Repository Path**: guangxingli/PocketSDR
## Basic Information
- **Project Name**: PocketSDR
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: BSD-2-Clause
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2024-06-13
- **Last Updated**: 2024-06-13
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# **Pocket SDR - An Open-Source GNSS SDR, ver. 0.12**
## **Overview**
Pocket SDR is an open-source GNSS (Global Navigation Satellite System) receiver
based on the SDR (software defined radio) technology. It consists of RF frontend
devices named "Pocket SDR FE", some utilities for the devices, and GNSS-SDR
APs (application programs) written in Python, C, and C++. It supports almost all
signals for GPS, GLONASS, Galileo, QZSS, BeiDou, NavIC, and SBAS.
The Pocket SDR FE device consists of 2 or 4 RF frontend channels, which support
GNSS L1 band (1525 - 1610 MHz), or L2/L5/L6 band (1160 - 1290 MHz). The bandwidth
of each RF channel covers up to 36 MHz. The sampling rate of the ADC can be
configured up to 32 Msps (FE 2CH) or 48 Msps (FE 4CH).
The Pocket SDR also contains some utility programs for the Pocket SDR FE devices,
to setup the devices, capture and dump the digitized IF (inter-frequency) data.
These utilities support Windows, Linux, Raspberry Pi OS, and other environments.
The Pocket SDR also provides GNSS-SDR APs to show the PSD (power spectrum
density) of captured IF data, search GNSS signals, track these signals, decode
navigation data and generate PVT (position, velocity and time) solutions. The
supported GNSS signals are as follows. For details on these signals and signal
IDs used in the APs, refer [Pocket SDR Signal IDs](/doc/signal_IDs.pdf).
* **GPS**: L1C/A, L1C-D, L1C-P, L2C-M, L5-I, L5-Q
* **GLONASS**: L1C/A (L1OF), L2C/A (L2OF), L1OCd, L1OCp, L2OCp, L3OCd, L3OCp
* **Galileo**: E1-B, E1-C, E5a-I, E5a-Q, E5b-I, E5b-Q, E6-B, E6-C
* **QZSS**: L1C/A, L1C/B, L1C-D, L1C-P, L1S, L2C-M, L5-I, L5-Q, L5S-I, L5S-Q, L6D, L6E
* **BeiDou**: B1I, B1C-D, B1C-P, B2a-D, B2a-P, B2I, B2b-I, B3I
* **NavIC**: L1-SPS-D, L1-SPS-P, L5-SPS
* **SBAS**: L1C/A, L5-I, L5-Q
These utilities and APs are written in Python, C, and C++ by very compact way. They
are easily modified by users to add user's unique algorithms.
**
Pocket SDR FEs (FE 2CH v.2.1, FE 2CH v.2.3, and FE 4CH v.3.0)
** The introduction of Pocket SDR is shown in the following slides. T.Takasu, An Open Source GNSS SDR: Development and Application, IPNTJ Next GNSS Technology WG, Feb 21, 2022 (https://gpspp.sakura.ne.jp/paper2005/IPNTJ_NEXTWG_202202.pdf) For an application of Pocket SDR, refer the following slides. T.Takasu, Development of QZSS L6 Receiver without Pilot Signal by using SDR, IPNTJ Annual Conference, June 10, 2022 (https://gpspp.sakura.ne.jp/paper2005/IPNTJ_20220610.pdf) -------------------------------------------------------------------------------- ## **Directory Structure and Contents** ``` PocketSDR --+-- bin Pocket SDR APs binary programs +-- app Pocket SDR APs source programs | +-- pocket_conf Pocket SDR FE device configurator | +-- pocket_dump Dump digital IF data of Pocket SDR FE device | +-- pocket_scan Scan and list USB devices | +-- pocket_acq GNSS signal acquisition | +-- pocket_trk GNSS signal tracking and PVT generation | +-- pocket_snap Snapshot Positioning +-- src Pocket SDR library source programs +-- python Pocket SDR Python scripts +-- lib Libraries for APs and Python scripts | +-- win32 Libraries for Windows | +-- linux Libraries for Linux or Raspberry Pi OS | +-- build Makefiles to build libraries | +-- cyusb Cypress EZ-USB API (CyAPI.a) and includes | +-- RTKLIB RTKLIB source programs based on 2.4.3 b34 | +-- (libfec) Library for FEC (forward error corrections) ([1]) | +-- (LDPC-codes) Library for LDPC-decoder ([2]) +-- conf Configuration files for Pocket SDR FE +-- FE_2CH Pocket SDR FE 2CH H/W and F/W +-- FE_4CH Pocket SDR FE 4CH H/W and F/W +-- driver Windows driver for Pocket SDR FE +-- doc Documents +-- image Image files for documents +-- sample Sample digital IF data captured by Pocket SDR FE +-- test Test codes and data () : not included in the package ``` -------------------------------------------------------------------------------- ## **Installation for Windows** * Extract PocketSDR.zip or clone the git repository (https://github.com/tomojitakasu/PocketSDR) to an appropriate directory
--------------------------------------------------------------------------------
## **Real-time GNSS Signal Tracking with Pocket SDR FE and pocket_trk AP**
With the Pocket SDR FE device and the AP pocket_trk, you can track GNSS signals
and generate PVT solutions in real-time. In this case, the sampling frequency,
IF frequencies, sampling type (I or I/Q), RF channel selections are automatically
configured according to the device info obtained from the device. Multiple GNSS
signals and PRN numbers can be specified as pocket_trk options -sig and -prn.
On Linux or Raspberry Pi OS, you might have to add "sudo" to access the Pocket SDR FE
device.
```
$ pocket_trk -sig L1CA -prn 1-32 -sig L5I -prn 1-32
```
As default, the signal tracking status are shown as the following example.
```
2024-05-30 08:39:50.996 35.1234065 138.1234560 1234.45 8/ 9 FIX BUFF: 1% SRCH: 17 LOCK: 11/ 32
CH RF SAT SIG PRN LOCK(s) C/N0 (dB-Hz) COFF(ms) DOP(Hz) ADR(cyc) SYNC #NAV #ERR #LOL FEC
5 1 G05 L1CA 5 52.14 47.5 ||||||||||| 0.6361186 779.8 41233.8 -BFR 7 0 0 0
6 1 G06 L1CA 6 52.05 40.7 ||||||| 0.0092524 -3740.1 -194068.1 -BF- 7 0 0 0
...
```
The first line of the status indicates:
```
2024-05-30 08:39:50.996: Signal reception time expressed in GPS time
35.1234065 : PVT solution latitude (deg, +: north, -: south)
138.1234560 : PVT solution longitude (deg, +: east, -: west)
1234.45 : PVT solution ellipsoidal height (m)
8/ 9 : Numbers of satellites for PVT and all tracking satellites
FIX : FIX PVT fixed, --- PVT not available
BUFF: 1% : Internal IF data buffer usage rate (overloaded if exceeding 100%)
SRCH: 17 : Signal search channel number
LOCK: 11/ 32: Numbers of signal lock channels and all channels
```
The third and following lines of the status indicates:
```
CH : Receiver channel number (1-999)
RF : RF frontend RF channel number (1-4)
SAT : GNSS satellite (Gnn: GPS, Rnn: GLONASS, Enn: Galileo, Jnn: QZSS,
Cnn: BeiDou, Inn: NavIC, Snn: SBAS)
SIG : GNSS signal ID
PRN : PRN number or FCN for GLONASS FDMA
LOCK: Continuos lock time (s)
C/N0: C/N0 (dB-Hz) and C/N0 bar
COFF: Tracking PRN code offset (ms)
DOP : Doppler frequency (Hz)
ADR : Accumulated Doppler range (cycle)
SYNC: Synchronization status (secondary code, bit, frame, and polarity)
#NAV: Number of properly decoded navigation subframes or messages
#ERR: Number of error navigation subframes or messages
#LOL: Number of loss-of-lock trackings
FEC : Number of corrected error bits by FEC (-1: unrecoverable errors)
```
The GNSS PVT solutions can be output as NMEA 0183 format ([3]) by -nmea option.
```
$ pocket_trk -sig L1CA -prn 1-32 -nmea
--------------------------------------------------------------------------------
## **References**
[1] https://github.com/quiet/libfec
[2] https://github.com/radfordneal/LDPC-codes
[3] NMEA 0183, Standard for Interfacing Marine Electronic Devices, National Marine
Electronics Association and International Marine Electronics Assosiation, 2013
[4] RTCM 10403.3 with Amendment 1, Differential GNSS (Global Navgation Satellite
Systems) service - version 3, Radio Technical Commission for Maritime Services,
April 28, 2020
--------------------------------------------------------------------------------
## **History**
* 2021-10-20 0.1 1st draft version
* 2021-10-25 0.2 Add Rebuild F/W and Write F/W Image to PocketSDR
* 2021-12-01 0.3 Add and modify Python scripts
* 2021-12-25 0.4 Add and modify Python scripts
* 2022-01-05 0.5 Fix several problems.
* 2022-01-13 0.6 Add and modify Python scripts
* 2022-02-15 0.7 Improve performance, Add some Python scripts.
* 2022-07-08 0.8 Add C-version of pocket_acq.py and pocket_trk.py.
* 2024-01-03 0.9 Add C-version of pocket_snap.py.
pocket_trk supports multi-signal and multi-threading
* 2024-01-12 0.10 Support NavIC L1-SPS-D, L1-SPS-P, GLONASS L1OCd, L1OCp and L2OCp.
* 2024-01-25 0.11 Support decoding of GLONASS L1OCd NAV data
Support NB-LDCP error correction for BDS B1C, B2a and B2b
* 2024-05-28 0.12 Performance optimized.
Support PVT generation, RTCM3 and NMEA outputs