4GFSK

No description available.

4GFSK

4GFSK is a small C++ project for packetized file transfer experiments using a 4-level GFSK-style modem. It currently supports:

  • packetization, CRC protection, and reassembly
  • baseband simulation with AWGN, frequency offset, and timing offset
  • SoapySDR-based over-the-air testing
  • full-duplex self-loopback testing on SDR hardware
  • a first-pass half-duplex runtime mode for future radio workflows

The current focus is proving out the transfer chain in simulation first, then validating it over the air with hardware such as a USRP B210.

Build

Requirements:

  • CMake 3.20+
  • a C++20 compiler
  • pkg-config
  • SoapySDR development files for OTA mode

Build:

cmake -S . -B build
cmake --build build

Run tests:

ctest --test-dir build --output-on-failure

If SoapySDR is available, OTA support is compiled in automatically. Otherwise, the project still builds and the simulation mode remains available.

Command line usage

Show help:

./build/gfsk_sim --help

Key options:

  • --mode <simulate|ota> selects software channel or SoapySDR OTA transfer
  • --input <path> uses a real file as the transfer payload
  • --generate-bytes <n> generates a synthetic payload for multi-packet testing
  • --payload-bytes <n> controls packet payload size
  • --duplex <full|half> selects OTA duplex mode
  • --packet-repetitions <n> retransmits each OTA packet burst n times
  • --freq <Hz> sets OTA RF center frequency
  • --tx-gain <dB> / --rx-gain <dB> set radio gain

Simulation examples

Small default simulation:

./build/gfsk_sim --mode simulate

Larger multi-packet simulation:

./build/gfsk_sim --mode simulate --generate-bytes 4096

Simulation with impairments:

./build/gfsk_sim --mode simulate \
  --generate-bytes 4096 \
  --snr-db 30 \
  --freq-offset 1200 \
  --timing-offset 3

OTA examples

Full-duplex self-test at 1250 MHz:

./build/gfsk_sim --mode ota \
  --duplex full \
  --device driver=uhd \
  --freq 1250000000 \
  --tx-gain 35 \
  --rx-gain 35 \
  --packet-repetitions 2 \
  --generate-bytes 4096

Half-duplex runtime example:

./build/gfsk_sim --mode ota \
  --duplex half \
  --device driver=uhd \
  --freq 1250000000 \
  --tx-gain 35 \
  --rx-gain 35 \
  --generate-bytes 4096 \
  --turnaround-delay-ms 10

Use --input yourfile.bin instead of --generate-bytes when you want to transfer a real file.

Current OTA behavior

  • OTA defaults are intentionally more conservative than simulation defaults.
  • If you do not explicitly set them, OTA currently falls back to:
    • --symrate 125000
    • --sps 4
  • This gives a 500000 sample/second path, which is safer for B210 full-duplex work than the earlier simulation-oriented defaults.
  • The OTA path currently transmits and receives packet bursts one packet at a time.
  • If you are losing an occasional packet, increase --packet-repetitions to 2 or 3 before pushing the symbol rate higher.

Full duplex vs half duplex

Full duplex is the current validation path for same-radio self-test. That is the mode to use when one SDR is transmitting and receiving its own signal at the same time.

Half duplex is exposed now so the transport path is not locked to full duplex. It is better suited to future workflows involving a second radio, delayed response, or turn-taking rather than immediate same-radio loopback.

Limitations

  • Burst acquisition is still fairly simple and can lose packets under real RF conditions.
  • The OTA path is a bounded burst capture, not a continuous packet detector.
  • Gain, antenna selection, and physical isolation matter a lot for reliable decode.
  • B210 over USB 2 can still be throughput-limited, especially at higher requested sample rates.
  • This is an experimental transfer tool, not a hardened production modem.

Repository layout

  • include/fourgfsk/ public headers
  • src/ modem, framing, simulation, OTA, and CLI implementation
  • tests/ regression tests