|
TinyModem
Header-only software audio modem library
|
PSK modulator (compatible with fldigi): the written bytes are Varicode encoded and each symbol is a phase step with a cosine shaped transition from the previous phase. More...
#include <PSKEncoder.h>


Public Member Functions | |
| PSKEncoder ()=default | |
| PSKEncoder (Print &out) | |
| PSKConfig | defaultConfig () |
| Provides a default configuration: psk31. | |
| void | setOutput (Print &out) override |
| void | setAudioInfo (audio_tools::AudioInfo info) override |
| Defines the sample rate and number of channels of the generated audio. | |
| audio_tools::AudioInfo | audioInfo () override |
| bool | begin (PSKConfig config) |
| Starts the processing with the indicated configuration. | |
| bool | begin () override |
| void | end () override |
| size_t | write (const uint8_t *data, size_t len) override |
| Modulates the bytes. | |
| bool | endTransmission (size_t silence_samples=0) override |
| bool | writeIdle (size_t nsamples) override |
| bool | isTransmitting () override |
| true between the first byte and endTransmission() | |
| float | symbolRate () override |
| Symbols per second. | |
| PSKConfig & | config () |
| The configuration which was provided in begin(). | |
| operator bool () override | |
| Public Member Functions inherited from tinymodem::ModemEncoder | |
| void | setOutput (Print &out) override |
| void | setGenerator (audio_tools::SoundGenerator< int16_t > &generator) |
| audio_tools::SoundGenerator< int16_t > & | getGenerator () |
| Provides the active tone generator. | |
| void | writeSilence (size_t nsamples) |
| Writes the indicated number of samples of silence. | |
| void | writeTone (float freq, size_t nsamples) |
| Writes a tone for the indicated number of samples. | |
| void | flush () |
| Ends the transmission. | |
| const char * | mime () override |
Protected Types | |
| enum class | Shape { TRANSITION , FADE_IN , FADE_OUT } |
Protected Member Functions | |
| void | startTransmission () |
| void | sendChar (uint8_t ch) |
| void | sendBit (int bit) |
| void | sendStep (int step) |
| void | sendSymbol (int step, Shape shape) |
| void | nextCarrier () |
Protected Attributes | |
| PSKConfig | cfg |
| SampleOutput | samples |
| QPSKCode | code |
| bool | is_active = false |
| bool | transmitting = false |
| double | samples_per_symbol = 0 |
| uint64_t | symbol_index = 0 |
| float | point_re = 1.0f |
| float | point_im = 0.0f |
| int | bits = 0 |
| int | bit_count = 0 |
| float | re = 1.0f |
| float | im = 0.0f |
| float | step_re = 1.0f |
| float | step_im = 0.0f |
| uint32_t | sample_count = 0 |
| Protected Attributes inherited from tinymodem::ModemEncoder | |
| ToneOutput | tones |
Static Protected Attributes | |
| static constexpr int | REVERSAL = 0 |
| phase steps as index of fldigi's 16 PSK positions (180 + n * 22.5 deg) | |
| static constexpr int | STEADY = 8 |
PSK modulator (compatible with fldigi): the written bytes are Varicode encoded and each symbol is a phase step with a cosine shaped transition from the previous phase.
BPSK (PSK31): the characters are separated by "00", a 0 bit is a phase reversal, a 1 bit keeps the phase. QPSK: each bit is encoded by a rate 1/2 convolutional code into a phase step of 0, 90, 180 or 270 degrees. 8PSK: the MFSK Varicode bits are sent in groups of 3 as phase steps of 45 degrees.
A transmission starts with phase reversals (preamble). Call endTransmission() (or flush()) when the data is complete: the postamble is sent (BPSK and 8PSK: steady carrier, QPSK: encoded 0 bits) and the signal fades out.
|
strongprotected |
|
default |
|
inline |
|
inlineoverride |
|
inlineoverride |
|
inline |
Starts the processing with the indicated configuration.
|
inline |
The configuration which was provided in begin().
|
inline |
Provides a default configuration: psk31.
|
inlineoverride |
|
inlineoverridevirtual |
Sends the postamble and fades out (and adds optional silence): returns true if a transmission was ended.
Implements tinymodem::ModemEncoder.
|
inlineoverridevirtual |
true between the first byte and endTransmission()
Implements tinymodem::ModemEncoder.
|
inlineprotected |
|
inlineoverride |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
Moves the constellation point by the phase step (index of 180 + n * 22.5 degrees)
|
inlineoverride |
Defines the sample rate and number of channels of the generated audio.
|
inlineoverride |
|
inlineprotected |
|
inlineoverridevirtual |
Symbols per second.
Implements tinymodem::ModemEncoder.
|
inlineoverride |
Modulates the bytes.
|
inlineoverridevirtual |
Sends the idle signal (BPSK and QPSK: 0 bits, 8PSK: the character 0) for the indicated number of samples
Reimplemented from tinymodem::ModemEncoder.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticconstexprprotected |
phase steps as index of fldigi's 16 PSK positions (180 + n * 22.5 deg)
|
protected |
|
protected |
|
protected |
|
staticconstexprprotected |
|
protected |
|
protected |
|
protected |
|
protected |