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

Configuration of the DTMF (touch tone) modem (DTMFEncoder, DTMFDecoder): each of the characters 0-9, *, #, A, B, C and D is sent as the sum of a row tone (697 - 941 Hz) and a column tone (1209 - 1633 Hz). More...

#include <DTMF.h>

Inheritance diagram for tinymodem::DTMFConfig:
Collaboration diagram for tinymodem::DTMFConfig:

Public Member Functions

 DTMFConfig ()
bool setMode (const char *mode)
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 name is "dtmf"

Public Attributes

int tone_ms = 70
 transmitter: duration of a tone in ms
int pause_ms = 70
 transmitter: duration of the pause after a tone in ms
int comma_ms = 500
 transmitter: duration of the pause for a ',' in ms
float volume = 1.0f
 transmit amplitude (0.0 - 1.0) of the sum of both tones
float min_amplitude = 0.01f
 receiver: minimum amplitude of each tone (1.0 = full scale)
float max_twist_db = 16.0f
float group_ratio_db = 6.0f
int rx_timeout_ms = 250
 receiver: the end of a transmission is reported after this silence
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

Detailed Description

Configuration of the DTMF (touch tone) modem (DTMFEncoder, DTMFDecoder): each of the characters 0-9, *, #, A, B, C and D is sent as the sum of a row tone (697 - 941 Hz) and a column tone (1209 - 1633 Hz).

The receiver needs tones and pauses of at least about 45 ms. The mode name is "dtmf".

Constructor & Destructor Documentation

◆ DTMFConfig()

tinymodem::DTMFConfig::DTMFConfig ( )
inline

Member Function Documentation

◆ isMode()

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

true if the mode name is "dtmf"

◆ isValid()

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

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

◆ setMode()

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

Selects the mode "dtmf": returns false if invalid. The other settings are kept.

Member Data Documentation

◆ channel

uint8_t tinymodem::DTMFConfig::channel = 0

receiver: input channel which is used for the decoding

◆ comma_ms

int tinymodem::DTMFConfig::comma_ms = 500

transmitter: duration of the pause for a ',' in ms

◆ group_ratio_db

float tinymodem::DTMFConfig::group_ratio_db = 6.0f

receiver: the row and column tone must be this much stronger than the other tones of their group in dB

◆ max_twist_db

float tinymodem::DTMFConfig::max_twist_db = 16.0f

receiver: max level difference of the row and column tone in dB (a small speaker attenuates the row tones: use e.g. 24)

◆ min_amplitude

float tinymodem::DTMFConfig::min_amplitude = 0.01f

receiver: minimum amplitude of each tone (1.0 = full scale)

◆ pause_ms

int tinymodem::DTMFConfig::pause_ms = 70

transmitter: duration of the pause after a tone in ms

◆ rx_noise

float tinymodem::DTMFConfig::rx_noise = 0.0f

receiver: (testing only) amplitude of added uniform noise

◆ rx_one

bool tinymodem::DTMFConfig::rx_one = false

receiver: stop after the first transmission

◆ rx_timeout_ms

int tinymodem::DTMFConfig::rx_timeout_ms = 250

receiver: the end of a transmission is reported after this silence

◆ tone_ms

int tinymodem::DTMFConfig::tone_ms = 70

transmitter: duration of a tone in ms

◆ volume

float tinymodem::DTMFConfig::volume = 1.0f

transmit amplitude (0.0 - 1.0) of the sum of both tones


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