|
TinyModem
Header-only software audio modem library
|
PSK demodulator (BPSK, QPSK and 8PSK compatible with fldigi): the PCM audio data is written to the decoder and the decoded bytes are written to the output. The input can be 8, 16 or 32 bit signed samples with any number of channels (only PSKConfig::channel is evaluated). More...
#include <PSKDecoder.h>


Public Member Functions | |
| PSKDecoder ()=default | |
| PSKDecoder (Print &out) | |
| PSKConfig | defaultConfig () |
| Provides a default configuration: psk31. | |
| void | setAudioInfo (audio_tools::AudioInfo info) override |
| Defines the format of the input audio data. | |
| audio_tools::AudioInfo | audioInfo () override |
| bool | begin (PSKConfig config) |
| Starts the processing with the indicated configuration. | |
| bool | begin () override |
| void | end () override |
| Processes the remaining samples and reports the end of the carrier. | |
| void | flush () override |
| Processes the remaining samples (e.g. at the end of the input). | |
| size_t | write (const uint8_t *data, size_t len) override |
| Provide PCM data to the decoder. | |
| bool | isCarrier () override |
| true while a transmission is received | |
| bool | isFinished () override |
| true if the decoding was stopped (rx_one) | |
| float | frequencyOffset () |
| Current frequency offset of the received signal in Hz. | |
| PSKConfig & | config () |
| The configuration which was provided in begin(). | |
| operator bool () override | |
| Public Member Functions inherited from tinymodem::ModemDecoder | |
| void | setStatusOutput (Print &out) |
| Defines the output for the ### CARRIER / ### NOCARRIER messages. | |
| void | setQuiet (bool quiet) |
| Suppresses the status messages. | |
| const char * | mime () override |
Protected Member Functions | |
| void | resetState () |
| void | setFrequencyOffset (float offset) |
| float | noise () |
| uniform random value in the range -0.5 to 0.5 | |
| void | addSample (float x, bool add_noise) |
| void | recalculate () |
| Avoids the accumulation of rounding errors. | |
| void | updateTiming () |
| The decision time is the circular center of the energy distribution. | |
| int | positions () |
| number of phase positions | |
| void | decide () |
| Bit decision from the phase difference to the previous symbol. | |
| void | mfskVaricode (int bit) |
| MFSK Varicode (8PSK): a character ends with "001". | |
| void | releaseHeld () |
| void | output (uint8_t ch) |
| void | varicode (int bit) |
| Collects the bits of a character: characters are separated by "00". | |
| void | startOfCarrier (float amplitude) |
| void | endOfCarrier () |
| Protected Member Functions inherited from tinymodem::ModemDecoder | |
| void | status (const char *fmt,...) |
Protected Attributes | |
| PSKConfig | cfg |
| bool | is_active = false |
| bool | is_finished = false |
| PcmInput | input |
| uint32_t | noise_seed = 1 |
| float | samples_per_symbol = 0 |
| int | window = 0 |
| float | nco_re = 1 |
| float | nco_im = 0 |
| float | step_re = 1 |
| float | step_im = 0 |
| float | freq_offset = 0 |
| audio_tools::Vector< float > | history |
| int | pos = 0 |
| float | sum_i = 0 |
| float | sum_q = 0 |
| float | sum_power = 0 |
| uint32_t | sample_count = 0 |
| float | phase = 0 |
| float | target = 0.5f |
| float | countdown = 0 |
| float | bin_sum [BINS] |
| int | bin_count [BINS] |
| float | hist [BINS] |
| float | prev_i = 0 |
| float | prev_q = 0 |
| float | quality = 0 |
| float | quality_m = 0 |
| bool | carrier = false |
| int | zeros = 0 |
| int | ones = 0 |
| int | weak = 0 |
| int | last_bit = 1 |
| uint16_t | code = 0 |
| QPSKCode | qpsk |
| uint32_t | mfsk_code = 0 |
| uint8_t | held [MAX_ONES] |
| int | nheld = 0 |
| float | track_amplitude = 0 |
| unsigned | ndata = 0 |
| unsigned | nsymbols = 0 |
| float | quality_total = 0 |
| float | amplitude_total = 0 |
| Protected Attributes inherited from tinymodem::ModemDecoder | |
| Print * | p_status = nullptr |
| bool | is_quiet = false |
Static Protected Attributes | |
| static constexpr int | BINS = 16 |
| static constexpr int | MIN_PREAMBLE = 8 |
| static constexpr int | MAX_ONES = 20 |
| static constexpr int | MAX_WEAK = 3 |
| the signal is lost after MAX_WEAK symbols below LOST_LEVEL | |
| static constexpr float | LOST_LEVEL = 0.3f |
| static constexpr float | AFC_GAIN = 0.1f |
| static constexpr float | TIMING_SMOOTHING = 0.15f |
| static constexpr float | TIMING_GAIN = 0.5f |
| static constexpr float | MAX_CORRECTION = 0.125f |
PSK demodulator (BPSK, QPSK and 8PSK compatible with fldigi): the PCM audio data is written to the decoder and the decoded bytes are written to the output. The input can be 8, 16 or 32 bit signed samples with any number of channels (only PSKConfig::channel is evaluated).
The signal is mixed to the baseband and integrated over one symbol. The symbol timing is determined from the energy distribution over the symbol period, the bits from the phase difference of consecutive symbols: QPSK uses a soft decision Viterbi decoder. An automatic frequency control tracks frequency offsets of up to a quarter of the symbol rate (QPSK: 1/8, 8PSK: 1/16). The receiver starts with a run of phase reversals (preamble) and stops when the signal is lost or with a long steady carrier (postamble of BPSK and 8PSK).
|
default |
|
inline |
|
inlineprotected |
|
inlineoverride |
|
inlineoverride |
|
inline |
Starts the processing with the indicated configuration.
|
inline |
The configuration which was provided in begin().
|
inlineprotected |
Bit decision from the phase difference to the previous symbol.
|
inline |
Provides a default configuration: psk31.
|
inlineoverride |
Processes the remaining samples and reports the end of the carrier.
|
inlineprotected |
|
inlineoverridevirtual |
Processes the remaining samples (e.g. at the end of the input).
Implements tinymodem::ModemDecoder.
|
inline |
Current frequency offset of the received signal in Hz.
|
inlineoverridevirtual |
true while a transmission is received
Implements tinymodem::ModemDecoder.
|
inlineoverridevirtual |
true if the decoding was stopped (rx_one)
Implements tinymodem::ModemDecoder.
|
inlineprotected |
MFSK Varicode (8PSK): a character ends with "001".
|
inlineprotected |
uniform random value in the range -0.5 to 0.5
|
inlineoverride |
|
inlineprotected |
|
inlineprotected |
number of phase positions
|
inlineprotected |
Avoids the accumulation of rounding errors.
|
inlineprotected |
|
inlineprotected |
|
inlineoverride |
Defines the format of the input audio data.
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
The decision time is the circular center of the energy distribution.
|
inlineprotected |
Collects the bits of a character: characters are separated by "00".
|
inlineoverride |
Provide PCM data to the decoder.
|
staticconstexprprotected |
|
protected |
|
protected |
|
protected |
|
staticconstexprprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticconstexprprotected |
|
staticconstexprprotected |
|
staticconstexprprotected |
|
staticconstexprprotected |
the signal is lost after MAX_WEAK symbols below LOST_LEVEL
|
protected |
|
staticconstexprprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticconstexprprotected |
|
staticconstexprprotected |
|
protected |
|
protected |
|
protected |
|
protected |