VARAHF.com / How the modem works

VARA HF modem

How one modem moves bytes from a host program to the radio and back. Data goes out along the top row, comes back along the bottom row, and the ARQ session in the middle decides what to send, at which level, and when to turn the link around.

TRANSMIT SESSION RECEIVE SHARED TABLES HOST AUDIO RADIO Host app Pat (Winlink) VarAC (chat) any VARA host program Host interface TCP 8300 commands TCP 8301 data OK / WRONG replies status lines: CONNECTED, BUFFER, PTT, IAMALIVE … 8300 8301 Compression optional text phrase-Huffman, 8 states Framing payload, marker, control byte, CRC-16 Whitening XOR with the whitening sequence Turbo code two 8-state RSC encoders, turbo interleaver Puncture period 1–10 from the rate, then tail bits Interleave channel interleaver Modulator FSK · PSK · OFDM lead-in + frames back-off gain bytes to send level chosen per turn sets K, N, code rate, tables and waveform ARQ session listen · calling · sending · receiving · idle · closing speed decisions pick the next level timing learned from the peer's replies, turn changes, retries, watchdog Control detector spectrogram, 4096-point FFT codebook match, F0 / F1 / F2 timing and frequency search ACK · NACK · BREAK · REQ … Control frames 58 codes per session codebook MFSK on 2048-sample symbols (23.4375 Hz tone grid) formats F0 · F1 · F2 control code to send Baseband −1500 Hz shift, low-pass, ÷16: 3 kHz complex Demodulator FSK · PSK · OFDM sync, derotate, soft bits (LLR) De-interleave undo the channel interleaver Turbo decoder iterative, stops when the CRC passes De-whiten XOR sequence, check CRC-16 Parse payload, control byte, next level, header frame Decompress text frames back to bytes 3 kHz baseband frame ok / lost received bytes Audio I/O 48 kHz mono Soundcard radio's USB codec or an audio interface PTT CAT, RTS / DTR or VOX HF radio USB / DIGU centred on 1500 Hz 500 · 2300 · 2750 Hz PTT from the modem TX RX built once at start-up; the transmit and receive chains read the same tables VB Rnd generator linear congruential, seeds every table Whitening seed 292 XOR sequence for every frame Record tables seed 43, one set per level: interleavers, FSK hop and pilots, OFDM cell maps Phase tables PSK and OFDM
transmit chainreceive chain ARQ sessioncontrol frames audio I/Oshared tables

One turn on the link

  1. The host writes bytes to the data port (8301). The ARQ session fills frames for the level it is at, compressing text when that saves space.
  2. Each frame is protected: framed with its control byte and CRC-16, whitened, turbo-coded, punctured to the level's code rate and interleaved.
  3. The modulator turns the coded bits into FSK, PSK or OFDM audio, puts a lead-in in front, and sends one or two frames per transmission.
  4. The other station answers with a short control frame (ACK, NACK, BREAK, a speed request…). The control detector matches it against the session's codebook.
  5. The ARQ session counts frames that arrived or were lost, and steps the level up or down for the next turn. It hands the link over when one side runs out of data.
  6. On receive, audio is brought down to a 3 kHz baseband, demodulated to soft bits, de-interleaved and turbo-decoded until the CRC passes. Good frames are parsed, decompressed and written to the host.