|
TinyModem
Header-only software audio modem library
|
Configuration of the ggwave compatible modem (GGWaveEncoder, GGWaveDecoder). Each message (up to 140 bytes) starts and ends with a marker and is protected by Reed-Solomon codes. Each byte is sent as 2 of 16 tones which are transmitted at the same time. More...
#include <GGWave.h>


Public Member Functions | |
| GGWaveConfig () | |
| bool | setMode (const char *mode) |
| Selects the protocol by mode name: returns false if invalid. | |
| const GGWaveProtocol & | protocolInfo () const |
| Provides the selected protocol. | |
| int | frameSize () const |
| Samples per frame: the tones are multiples of sample_rate / frameSize(). | |
| float | binFrequency (int bin) const |
| Frequency of the indicated FFT bin in Hz. | |
| int | dataSymbols (int len) const |
| Number of data symbols of a message with len bytes. | |
| size_t | messageSamples (int len) const |
| Number of samples of a message with len bytes. | |
| float | symbolRate () const |
| Data symbols per second. | |
| float | bitRate () const |
| Payload bits per second (without markers and error correction). | |
| 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 a ggwave mode | |
| static int | protocolCount () |
| Number of supported protocols. | |
| static const GGWaveProtocol * | protocols () |
| Provides the supported protocols. | |
| static const GGWaveProtocol * | findProtocol (int id) |
| Provides the protocol with the indicated id (or nullptr). | |
| static int | eccBytes (int len) |
| Number of Reed-Solomon parity bytes for a payload of len bytes. | |
| static int | encodedBytes (int len) |
| Total number of encoded bytes of a message (length, payload, parity). | |
| static uint8_t | dssMagic (int i) |
| Value of the ggwave DSS sequence for the indicated payload byte. | |
Public Attributes | |
| GGWaveProtocolId | protocol = GGWAVE_AUDIBLE_FAST |
| ggwave protocol (see setMode()) | |
| float | volume = 1.0f |
| transmit amplitude (0.0 - 1.0) | |
| bool | dss = false |
| XOR the payload with the ggwave DSS sequence (ggwave option -d). | |
| bool | rx_any_speed = true |
| receiver: accept the normal, fast and fastest variant of the protocol | |
| float | marker_threshold = 3.0f |
| bool | rx_one = false |
| receiver: stop after the first message | |
| 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 int | BASE_FRAME = 1024 |
| samples per frame (DFT size) at 48000 Hz | |
| static constexpr int | BASE_RATE = 48000 |
| static constexpr int | MAX_PAYLOAD = 140 |
| max payload of a message (variable length format) | |
| static constexpr int | MARKER_FRAMES = 16 |
| number of frames of the start and end marker | |
| static constexpr int | MARKER_TONES = 16 |
| number of tones of a marker | |
| static constexpr int | LENGTH_BYTES = 3 |
| bytes of the Reed-Solomon coded length at the start of a message | |
Static Protected Member Functions | |
| static const GGWaveProtocol * | findMode (const char *mode) |
| static bool | equals (const char *a, const char *b) |
Configuration of the ggwave compatible modem (GGWaveEncoder, GGWaveDecoder). Each message (up to 140 bytes) starts and ends with a marker and is protected by Reed-Solomon codes. Each byte is sent as 2 of 16 tones which are transmitted at the same time.
setMode() selects the protocol: "ggwave-normal", "ggwave-fast", "ggwave-fastest" (audible, 1875 - 6375 Hz), "ggwave-u-normal", "ggwave-u-fast", "ggwave-u-fastest" (ultrasound, 15000 - 19500 Hz), "ggwave-dt-normal", "ggwave-dt-fast" and "ggwave-dt-fastest" (dual tone, 1125 - 2625 Hz). "ggwave" is "ggwave-fast", the default of the ggwave tools. The variable length format is used, which is the default of ggwave. The mono-tone (MT) protocols and the fixed length format are not supported.
The sample rate must be a multiple of 46.875 Hz * 4, e.g. 48000 or 24000 Hz (44100 Hz is not supported), and high enough for the highest tone.
|
inline |
|
inline |
Frequency of the indicated FFT bin in Hz.
|
inline |
Payload bits per second (without markers and error correction).
|
inline |
Number of data symbols of a message with len bytes.
|
inlinestatic |
Value of the ggwave DSS sequence for the indicated payload byte.
|
inlinestatic |
Number of Reed-Solomon parity bytes for a payload of len bytes.
|
inlinestatic |
Total number of encoded bytes of a message (length, payload, parity).
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestatic |
Provides the protocol with the indicated id (or nullptr).
|
inline |
Samples per frame: the tones are multiples of sample_rate / frameSize().
|
inlinestatic |
true if the mode is a ggwave mode
|
inline |
Checks the configuration: returns false (and logs the reason) if invalid.
|
inline |
Number of samples of a message with len bytes.
|
inlinestatic |
Number of supported protocols.
|
inline |
Provides the selected protocol.
|
inlinestatic |
Provides the supported protocols.
|
inline |
Selects the protocol by mode name: returns false if invalid.
|
inline |
Data symbols per second.
|
staticconstexpr |
samples per frame (DFT size) at 48000 Hz
|
staticconstexpr |
| uint8_t tinymodem::GGWaveConfig::channel = 0 |
receiver: input channel which is used for the decoding
| bool tinymodem::GGWaveConfig::dss = false |
XOR the payload with the ggwave DSS sequence (ggwave option -d).
|
staticconstexpr |
bytes of the Reed-Solomon coded length at the start of a message
|
staticconstexpr |
number of frames of the start and end marker
| float tinymodem::GGWaveConfig::marker_threshold = 3.0f |
receiver: a marker tone must be this much stronger than its neighbor (in power)
|
staticconstexpr |
number of tones of a marker
|
staticconstexpr |
max payload of a message (variable length format)
| GGWaveProtocolId tinymodem::GGWaveConfig::protocol = GGWAVE_AUDIBLE_FAST |
ggwave protocol (see setMode())
| bool tinymodem::GGWaveConfig::rx_any_speed = true |
receiver: accept the normal, fast and fastest variant of the protocol
| float tinymodem::GGWaveConfig::rx_noise = 0.0f |
receiver: (testing only) amplitude of added uniform noise
| bool tinymodem::GGWaveConfig::rx_one = false |
receiver: stop after the first message
| float tinymodem::GGWaveConfig::volume = 1.0f |
transmit amplitude (0.0 - 1.0)