Skip to content

Rhizomatica/skywave

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

skywave

An HF/VHF radio channel simulator and comparative modem test harness.

skywave comes out of the OpenARQ project (openarq.org), and is packaged so that any modem project can use the same channel and the same measurements.

What it does

skywave is two things that share one channel model.

The channel simulator reproduces HF and VHF propagation and radio-chain effects. You can run it as a one-way filter over a file, as a two-station half-duplex link, or as an in-process Python object. It models:

  • Watterson/CCIR ionospheric fading, as named presets or a custom delay/Doppler pair, with optional scheduled fade over the course of a run
  • ITU-R P.372 background noise environments and impulsive noise
  • a transmit chain: ALC overshoot, Rapp soft-PA compression, drive level
  • a receive chain: SSB rig passband, AGC, level pad
  • co-channel interference (QRM), carrier frequency offset, sample-clock skew, and transmit/receive turnaround timing
  • per-direction asymmetry, so the forward and reverse paths can differ (for example a weak ACK path)
  • an FM port profile with mic/speaker and 9600-baud paths, CTCSS, squelch, and FM fade

The test harness drives modems through that channel and scores them against each other. A modem is added by writing one adapter against a documented contract; it then gets the whole channel, transport, and scoring stack. The harness provides:

  • a ModemAdapter contract, with an in-process reference adapter to copy from
  • an ALSA-loopback transport for hardware-faithful runs, and a portable unix-socket transport that needs no loopback hardware
  • channel and transport profiles as small TOML files, with environment variables that override them
  • a versioned results schema for the output corpus

Adapters

One goal of skywave is a growing collection of adapters covering the modems people actually run. A modem is added by writing one adapter against the ModemAdapter contract (documented in docs/MODEM-ADAPTER-CONTRACT.md); it then gets the whole harness for free. The adapters that ship today:

Adapter Modem Notes
loopback in-process reference no external modem — copy this to start a new adapter
mercury Mercury HF TCP TNC
armstrong Armstrong (OpenARQ reference) ALSA loopback; native unix-socket transport optional
ardop ARDOP (ardopcf) includes chunked, buffer-throttled bulk TX
vara VARA HF proprietary, typically under Wine; two instances brought up by an external up/down lifecycle
freedata FreeDATA REST + websocket; runs under FreeDATA's own venv (set ADAPTER_PY)

More are welcome.

Install

skywave is a src/-layout Python package (skywave), needs Python 3.11+, and depends on numpy and scipy. From a checkout:

pip install -e .          # editable; add [test] for pytest: pip install -e ".[test]"

This puts the skywave package on the path and installs three console scripts: hfchan, skywave-sweep, and skywave-channel. You can also run any entry point without installing, straight from src/, with PYTHONPATH=src python3 -m skywave.<module>.

Platforms

The channel sim, the DSP, and the full test suite run on Linux and macOS. The device-free sock transport runs on both, so a modem with a native socket audio backend can be benchmarked with no audio hardware. The real snd-aloop ALSA rig is Linux-only; off Linux the harness says so and points at the sock transport. Windows is not supported yet (the small, catalogued gaps are in docs/PORTABILITY.md). On macOS you need Python 3.11+ (the system 3.9 is too old); see docs/PORTABILITY.md for a one-command setup and a device-free end-to-end example.

Quick start

A one-way channel filter, compatible with the codec2 ch tool:

hfchan --No -20 --fade poor < tx.s16 > rx.s16

In-process, from a typed config:

from skywave.channel_config import ChannelConfig
from skywave.channel import Channel

ch = Channel(ChannelConfig(sigma=200, watterson="poor"))
rx_block = ch.process(tx_block)

Compare a modem across a set of cells:

skywave-sweep mymodem cells.json out.csv

Documentation

Channel model and physics:

Literature basis (the measurement and standards sources behind the models):

Validation and comparison:

Harness and transports:

License

Apache-2.0.

Status

Newly extracted from the OpenARQ bench. Interfaces may still change before 1.0.

About

An HF/VHF radio channel simulator and comparative modem test harness (from the OpenARQ project)

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages