← Ordo Artificum

olivia-modem

Olivia MFSK modem library

A standalone C++20 Olivia MFSK modem library extracted from fldigi — with all FLTK, libsamplerate, and fldigi-global dependencies removed — and packaged as a self-contained static library with a clean C++ API.

Working & available now GitHub

What it is

olivia-modem is a C++20 static library that provides Olivia MFSK encode and decode as a self-contained module with no external runtime dependencies. It wraps Pawel Jalocha's original MFSK_Transmitter and MFSK_Receiver C++ templates — the same DSP core used in fldigi — and exposes them through a clean modern interface that has no FLTK, no fldigi globals, and no audio framework.

Audio is always 8000 Hz floating-point double, supplied by the caller. The library is suitable for embedding in desktop applications, Raspberry Pi utilities, and any POSIX system with a C++20 compiler and libm.

The Olivia mode

Olivia is an MFSK digital mode designed for reliable weak-signal HF communication. Unlike most HF digital modes, it is built around a forward error correction layer — every character is protected by Walsh–Hadamard FEC before being transmitted — which makes it substantially more robust than modes that transmit characters directly. Olivia can often copy text through conditions where other modes have already failed.

The mode is configurable across a wide range of bandwidths and tone counts, allowing operators to trade throughput against robustness depending on conditions. The 8/500 mode (8 tones, 500 Hz bandwidth) is the most widely used and is active on frequencies including 14.106 MHz USB.

Olivia is interoperable with fldigi and all other standard Olivia implementations.

Forward error correction

Olivia's FEC is a Walsh–Hadamard code applied to each transmitted character before it reaches the MFSK modulator. Each character is encoded into a block of tones × bits-per-symbol coded symbols; the receiver applies the corresponding inverse transform and recovers the original character even if a substantial fraction of the symbols are corrupted by noise or selective fading.

The practical effect is significant: Olivia 8/500 is routinely decoded at SNRs of −10 dB and below in a 500 Hz bandwidth — conditions under which even a received carrier is difficult to hear by ear.

The FEC operates transparently. The caller supplies text to modulate() and receives characters from the decode callback — the FEC encoding and decoding happen internally with no additional API surface.

Submodes

Mode Tones Bandwidth Notes
8/5008500 HzMost common; excellent sensitivity
4/2504250 HzVery narrow; weak-signal specialist
8/2508250 HzNarrow with more FEC depth
16/50016500 HzDeeper FEC at same bandwidth
8/100081000 HzHigher throughput
16/1000161000 HzCommon high-speed mode
32/1000321000 HzMaximum FEC robustness

API surface

  • Modulate — encode a UTF-8 string to 8000 Hz double PCM audio, with optional preamble and postamble synchronisation tones.
  • Demodulate — feed audio samples in any chunk size; decoded characters are delivered via a callback as they are recovered from the FEC decoder.
  • Flush — force output of any buffered partial FEC block at end of stream.
  • Metrics — SNR estimate and carrier frequency offset in Hz, updated continuously during receive.
  • Reset — clear FEC buffers and synchroniser to prepare for a new transmission.

The public API is a single header: include/oliviamodem.h. Configuration is through an OliviaConfig struct with sensible defaults for 8/500.

Building

# clone and build
git clone https://github.com/jfrancis42/olivia-modem
cd olivia-modem
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
# output: build/liboliviamodem.a

Requirements: CMake 3.16+, a C++20 compiler, and libm. All DSP code — the Jalocha MFSK templates, the FHT, and the synchroniser — is header-only and compiled in with no additional system library requirements.

History

Olivia would not exist without the people who designed and built it:

Pawel Jalocha (SP9VRC)

Designer of the Olivia mode and author of the original C++ DSP implementation. Jalocha published the first version of Olivia in 2003–2004 and made his source available to the amateur radio community. His MFSK_Transmitter and MFSK_Receiver C++ templates — header-only, parameterised over tone count and bandwidth — are the DSP core of this library. The Walsh–Hadamard FEC scheme, the MFSK tone spacing, the synchronisation structure, and the encoding are all his design.

Dave Freese (W1HKJ) & the fldigi project

fldigi is the most widely used multimode HF digital application on the Linux desktop. Dave Freese and the fldigi contributors integrated Jalocha's Olivia implementation into fldigi in the mid-2000s and maintained it through many years of development. The olivia-modem library extracts that implementation from fldigi's source tree — stripping the FLTK and global-state dependencies — and preserves the GPL-3.0 license under which fldigi is distributed.

The Olivia community

Olivia gained traction on HF through years of use by weak-signal operators who valued its robustness under challenging propagation conditions. The de facto calling frequencies — 14.106 MHz USB for 8/500, 7.073 MHz USB in Europe and elsewhere — were established by that community and represent the operating conventions this library is designed to interoperate with.

olivia-modem is released under the GPL-3.0-or-later license, consistent with its origins in the fldigi source tree.