# tomojitakasu/pocketsdr architecture

> Architecture diagram of the GitHub repository tomojitakasu/pocketsdr, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tomojitakasu/pocketsdr
- Repository: https://github.com/tomojitakasu/pocketsdr

## Overview

##### Project type and purpose
- Pocket SDR is an embedded/host-side software-defined radio system for GNSS reception.
- It comprises:
- RF front-end hardware (FE_2CH, FE_4CH, FE_8CH) with on-device Cypress FX2LP firmware
- Host software: device drivers, shared libraries (RTKLIB, cyusb, FEC/LDPC), C/C++ CLI utilities, Python APs, GUI
- Configuration files, sample data, documentation, test suites

##### File structure
- Top-level directories:
- FE_2CH, FE_4CH, FE_8CH: hardware CAD (KiCad, Fusion360) and firmware source/binaries
- driver: host driver installation instructions
- lib: host libraries for USB (cyusb), GNSS processing (RTKLIB, FEC, LDPC), per-OS subdirs, build scripts
- app: C/C++ source of CLI utilities (pocket_conf, pocket_dump, pocket_acq, pocket_trk, …) and makefiles
- python: Python implementations and scripts for data plotting, acquisition, tracking, GUI
- bin: compiled executables for Windows
- conf: GNSS configuration files per constellation and bandwidth
- sample: recorded IF-data examples
- src: core SDR C-library used by both apps and Python wrappers
- test: automated test scripts for functional, performance, unit tests

##### README
- Confirms multi-OS support, describes utilities and APs, lists technologies: C/C++ (GCC, MinGW), Python (numpy, scipy, matplotlib), libusb, FFTW3, Cypress EZ-USB API

## Diagram (Mermaid)

```mermaid
graph TB
  subgraph "Hardware Front-End (RF → ADC → FX2LP)"
    subgraph "CAD Designs"
      FE2CAD["FE_2CH/HW"]:::hardware
      FE4CAD["FE_4CH/HW/v3.0"]:::hardware
      FE8CAD["FE_8CH/HW/v4.0"]:::hardware
    end
    subgraph "Firmware"
      FE2FW["FE_2CH/FW/v2.1"]:::firmware
      FE4FW["FE_4CH/FW/v3.0"]:::firmware
      FE8FW["FE_8CH/FW/v4.0"]:::firmware
    end
  end

  driver["Host Driver Layer"]:::driver
  usbLib["USB Interface Library (CyAPI/libusb)"]:::library
  rtklib["GNSS Processing Library (RTKLIB)"]:::library
  ecLib["Error-Correction Libraries (FEC, LDPC)"]:::library
  sdrcore["Core SDR C Library"]:::library
  cli["CLI Utilities"]:::app_cli
  python["Python Applications & Scripts"]:::app_py
  conf["Configuration Files"]:::config
  sample["Sample IF-Data Repository"]:::data
  test["Automated Test Suites"]:::test
  doc["Documentation"]:::doc
  bin["Compiled Binaries (Windows)"]:::output

  FE2FW -->|"firmware install"| driver
  FE4FW -->|"firmware install"| driver
  FE8FW -->|"firmware install"| driver

  driver -->|"USB transport"| usbLib
  usbLib -->|"API calls"| sdrcore

  sdrcore -->|"library APIs"| rtklib
  sdrcore -->|"library APIs"| ecLib

  sdrcore -->|"link"| cli
  sdrcore -->|"link"| python

  cli -->|"exec"| bin
  python -->|"exec"| bin

  cli -->|"reads/writes"| conf
  python -->|"reads/writes"| conf

  cli -->|"reads"| sample
  python -->|"reads"| sample

  test -->|"tests"| sdrcore
  test -->|"tests"| cli
  test -->|"tests"| python

  conf --> doc
  sample --> doc
  test --> doc

  classDef hardware fill:#cccccc,stroke:#333,stroke-width:1px
  classDef firmware fill:#888888,stroke:#333,stroke-width:1px
  classDef driver fill:#add8e6,stroke:#333,stroke-width:1px
  classDef library fill:#87CEFA,stroke:#333,stroke-width:1px
  classDef app_cli fill:#98FB98,stroke:#333,stroke-width:1px
  classDef app_py fill:#dda0dd,stroke:#333,stroke-width:1px
  classDef config fill:#FFA500,stroke:#333,stroke-width:1px
  classDef data fill:#FFA500,stroke:#333,stroke-width:1px
  classDef test fill:#f4a460,stroke:#333,stroke-width:1px
  classDef doc fill:#fffacd,stroke:#333,stroke-width:1px
  classDef output fill:#d3d3d3,stroke:#333,stroke-width:1px

  click FE2CAD "https://github.com/tomojitakasu/pocketsdr/tree/master/FE_2CH/HW"
  click FE4CAD "https://github.com/tomojitakasu/pocketsdr/blob/master/FE_4CH/HW/v3.0"
  click FE8CAD "https://github.com/tomojitakasu/pocketsdr/blob/master/FE_8CH/HW/v4.0"
  click FE2FW "https://github.com/tomojitakasu/pocketsdr/blob/master/FE_2CH/FW/v2.1"
  click FE4FW "https://github.com/tomojitakasu/pocketsdr/blob/master/FE_4CH/FW/v3.0"
  click FE8FW "https://github.com/tomojitakasu/pocketsdr/blob/master/FE_8CH/FW/v4.0"
  click driver "https://github.com/tomojitakasu/pocketsdr/blob/master/driver/readme.txt"
  click usbLib "https://github.com/tomojitakasu/pocketsdr/tree/master/lib/cyusb"
  click rtklib "https://github.com/tomojitakasu/pocketsdr/tree/master/lib/RTKLIB/src"
  click ecLib "https://github.com/tomojitakasu/pocketsdr/blob/master/lib/build/libfec.mk"
  click sdrcore "https://github.com/tomojitakasu/pocketsdr/tree/master/src"
  click cli "https://github.com/tomojitakasu/pocketsdr/tree/master/app"
  click bin "https://github.com/tomojitakasu/pocketsdr/tree/master/bin"
  click python "https://github.com/tomojitakasu/pocketsdr/tree/master/python"
  click conf "https://github.com/tomojitakasu/pocketsdr/tree/master/conf"
  click sample "https://github.com/tomojitakasu/pocketsdr/tree/master/sample"
  click test "https://github.com/tomojitakasu/pocketsdr/tree/master/test"
  click doc "https://github.com/tomojitakasu/pocketsdr/tree/master/doc"
```
