TinyModem
Header-only software audio modem library
Loading...
Searching...
No Matches
tinymodem::OliviaConfig Struct Reference

Configuration of the Olivia and Contestia modems (OliviaEncoder, OliviaDecoder): MFSK with 2 to 256 tones and a strong forward error correction (Walsh-Hadamard codes over blocks of 64 or 32 symbols), as designed by Pawel Jalocha and implemented by fldigi. More...

#include <Olivia.h>

Inheritance diagram for tinymodem::OliviaConfig:
Collaboration diagram for tinymodem::OliviaConfig:

Public Member Functions

 OliviaConfig ()
bool setMode (const char *mode)
int bitsPerSymbol () const
 number of bits per symbol (log2 of the tones)
int symbolLen () const
 FFT length (window of a symbol) in samples at 8000 Hz.
int symbolSepar () const
 distance of two symbols in samples at 8000 Hz
int symbolsPerBlock () const
 symbols per FEC block: 64 for Olivia, 32 for Contestia
int bitsPerCharacter () const
 bits per character: 7 for Olivia, 6 for Contestia
int firstCarrier () const
 lowest tone as FFT bin (like fldigi)
float toneFreq (int tone) const
 frequency of a tone in Hz
float symbolRate () const
 symbols per second
float charRate () const
 characters per second
bool isValid () const
 Checks the configuration: returns false (and logs the reason) if invalid.

Static Public Member Functions

static bool isMode (const char *mode)
 true if the mode is an Olivia or Contestia mode

Public Attributes

int tones = 32
 number of tones (power of 2: 2 - 256)
int bandwidth = 1000
 bandwidth in Hz: 125, 250, 500, 1000 or 2000
float center_freq = 1500.0f
 center frequency in Hz
bool contestia = false
 Contestia instead of Olivia.
float volume = 1.0f
 transmit amplitude (0.0 - 1.0)
bool start_tones = true
 transmitter: send the start and stop tones (like fldigi)
int sync_margin = 8
int sync_integration = 4
 receiver: integration period of the synchronizer in FEC blocks
float sync_threshold = 3.0f
 receiver: minimum signal to noise ratio of the synchronizer
bool rx_one = false
 receiver: stop after the first transmission
uint8_t channel = 0
 receiver: input channel which is used for the decoding
float rx_noise = 0.0f
 receiver: (testing only) amplitude of added uniform noise

Static Public Attributes

static constexpr float BASE_RATE = 8000.0f
 internal sample rate which defines the signal
static constexpr int MAX_SYMBOL_LEN = 2048
 largest supported FFT length

Static Protected Member Functions

static bool parseMode (const char *mode, int &tones, int &bandwidth, bool &contestia)
static bool startsWith (const char *str, const char *prefix)

Detailed Description

Configuration of the Olivia and Contestia modems (OliviaEncoder, OliviaDecoder): MFSK with 2 to 256 tones and a strong forward error correction (Walsh-Hadamard codes over blocks of 64 or 32 symbols), as designed by Pawel Jalocha and implemented by fldigi.

setMode() selects "olivia-T-B" or "contestia-T-B" with T tones and a bandwidth B of 125, 250, 500, 1000 or 2000 Hz (also written as 1k or 2k), e.g. "olivia-8-250" or "olivia-32-1000". "olivia" is "olivia-32-1000", "contestia" is "contestia-8-250". Olivia sends 7 bit characters (and 8 bit characters escaped with 127 like fldigi), Contestia sends upper case text with 6 bit characters at twice the speed: a line break is sent as '\r' (which fldigi shows as new line), '\r' is ignored.

The signal is defined at 8000 Hz: other sample rates are converted.

Constructor & Destructor Documentation

◆ OliviaConfig()

tinymodem::OliviaConfig::OliviaConfig ( )
inline

Member Function Documentation

◆ bitsPerCharacter()

int tinymodem::OliviaConfig::bitsPerCharacter ( ) const
inline

bits per character: 7 for Olivia, 6 for Contestia

◆ bitsPerSymbol()

int tinymodem::OliviaConfig::bitsPerSymbol ( ) const
inline

number of bits per symbol (log2 of the tones)

◆ charRate()

float tinymodem::OliviaConfig::charRate ( ) const
inline

characters per second

◆ firstCarrier()

int tinymodem::OliviaConfig::firstCarrier ( ) const
inline

lowest tone as FFT bin (like fldigi)

◆ isMode()

bool tinymodem::OliviaConfig::isMode ( const char * mode)
inlinestatic

true if the mode is an Olivia or Contestia mode

◆ isValid()

bool tinymodem::OliviaConfig::isValid ( ) const
inline

Checks the configuration: returns false (and logs the reason) if invalid.

◆ parseMode()

bool tinymodem::OliviaConfig::parseMode ( const char * mode,
int & tones,
int & bandwidth,
bool & contestia )
inlinestaticprotected

◆ setMode()

bool tinymodem::OliviaConfig::setMode ( const char * mode)
inline

Selects e.g. "olivia-32-1000", "olivia-8-250" or "contestia-8-250": returns false if invalid. The other settings are kept.

◆ startsWith()

bool tinymodem::OliviaConfig::startsWith ( const char * str,
const char * prefix )
inlinestaticprotected

◆ symbolLen()

int tinymodem::OliviaConfig::symbolLen ( ) const
inline

FFT length (window of a symbol) in samples at 8000 Hz.

◆ symbolRate()

float tinymodem::OliviaConfig::symbolRate ( ) const
inline

symbols per second

◆ symbolSepar()

int tinymodem::OliviaConfig::symbolSepar ( ) const
inline

distance of two symbols in samples at 8000 Hz

◆ symbolsPerBlock()

int tinymodem::OliviaConfig::symbolsPerBlock ( ) const
inline

symbols per FEC block: 64 for Olivia, 32 for Contestia

◆ toneFreq()

float tinymodem::OliviaConfig::toneFreq ( int tone) const
inline

frequency of a tone in Hz

Member Data Documentation

◆ bandwidth

int tinymodem::OliviaConfig::bandwidth = 1000

bandwidth in Hz: 125, 250, 500, 1000 or 2000

◆ BASE_RATE

float tinymodem::OliviaConfig::BASE_RATE = 8000.0f
staticconstexpr

internal sample rate which defines the signal

◆ center_freq

float tinymodem::OliviaConfig::center_freq = 1500.0f

center frequency in Hz

◆ channel

uint8_t tinymodem::OliviaConfig::channel = 0

receiver: input channel which is used for the decoding

◆ contestia

bool tinymodem::OliviaConfig::contestia = false

Contestia instead of Olivia.

◆ MAX_SYMBOL_LEN

int tinymodem::OliviaConfig::MAX_SYMBOL_LEN = 2048
staticconstexpr

largest supported FFT length

◆ rx_noise

float tinymodem::OliviaConfig::rx_noise = 0.0f

receiver: (testing only) amplitude of added uniform noise

◆ rx_one

bool tinymodem::OliviaConfig::rx_one = false

receiver: stop after the first transmission

◆ start_tones

bool tinymodem::OliviaConfig::start_tones = true

transmitter: send the start and stop tones (like fldigi)

◆ sync_integration

int tinymodem::OliviaConfig::sync_integration = 4

receiver: integration period of the synchronizer in FEC blocks

◆ sync_margin

int tinymodem::OliviaConfig::sync_margin = 8

receiver: search range for the frequency in tone spacings / 2 (fldigi: tune margin): limited to the available audio band

◆ sync_threshold

float tinymodem::OliviaConfig::sync_threshold = 3.0f

receiver: minimum signal to noise ratio of the synchronizer

◆ tones

int tinymodem::OliviaConfig::tones = 32

number of tones (power of 2: 2 - 256)

◆ volume

float tinymodem::OliviaConfig::volume = 1.0f

transmit amplitude (0.0 - 1.0)


The documentation for this struct was generated from the following file: