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


Public Member Functions | |
| OFDMDecoder ()=default | |
| OFDMDecoder (Print &out) | |
| OFDMConfig | defaultConfig () |
| Provides a default configuration: ofdm32. | |
| void | setAudioInfo (audio_tools::AudioInfo info) override |
| Defines the format of the input audio data. | |
| audio_tools::AudioInfo | audioInfo () override |
| bool | begin (OFDMConfig config) |
| Starts the processing with the indicated configuration. | |
| bool | begin () override |
| void | end () override |
| Processes the remaining samples. | |
| 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 frame is received | |
| bool | isFinished () override |
| true if the decoding was stopped (rx_one) | |
| size_t | frameCount () |
| Number of received frames. | |
| OFDMConfig & | 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 Types | |
| enum class | State { SEARCH , FRAME } |
Protected Member Functions | |
| void | resetState () |
| float | noise () |
| uniform random value in the range -0.5 to 0.5 | |
| float | sample (uint32_t idx) |
| void | addSample (float x, bool add_noise) |
| void | recalculate (uint32_t t) |
| void | compact () |
| Drops the samples which are not needed any more. | |
| void | search (uint32_t d) |
| void | dft () |
| DFT of the window at the carrier frequencies. | |
| void | processSymbol () |
| void | referenceSymbol () |
| void | dataSymbol () |
| void | checkHeader () |
| void | dataBits (int dibit) |
| void | endFrame (bool complete) |
| Protected Member Functions inherited from tinymodem::ModemDecoder | |
| void | status (const char *fmt,...) |
Static Protected Member Functions | |
| static bool | isReached (uint32_t a, uint32_t b) |
| true if the global index a is at or after b (with wrap around) | |
| static float | wrap (float angle) |
| static void | fit (const float *angle, const float *weight, int n, float &common, float &slope) |
| Weighted linear fit: angle = common + slope * carrier. | |
| static int | phaseToGray (int phase) |
| 0 -> 00, 90 -> 01, 180 -> 11, 270 -> 10 degrees | |
Protected Attributes | |
| OFDMConfig | cfg |
| bool | is_active = false |
| bool | is_finished = false |
| PcmInput | input |
| OFDMTable | table |
| uint32_t | noise_seed = 1 |
| size_t | frames = 0 |
| int | fft_size = 0 |
| int | prefix_size = 0 |
| int | symbol_size = 0 |
| int | half = 0 |
| int | first_bin = 0 |
| int | ncarriers = 0 |
| audio_tools::Vector< float > | buffer |
| size_t | nvalid = 0 |
| uint32_t | base = 0 |
| uint32_t | now = 0 |
| uint32_t | filled = 0 |
| float | corr = 0 |
| float | power = 0 |
| bool | in_plateau = false |
| uint32_t | plateau_start = 0 |
| audio_tools::Vector< float > | plateau |
| audio_tools::Vector< float > | smoothed |
| int | plateau_len = 0 |
| State | state = State::SEARCH |
| uint32_t | window = 0 |
| int | symbol = 0 |
| audio_tools::Vector< float > | z_re |
| audio_tools::Vector< float > | z_im |
| audio_tools::Vector< float > | prev_re |
| audio_tools::Vector< float > | prev_im |
| float | pred_common = 0 |
| float | pred_slope = 0 |
| float | slope_adjust = 0 |
| float | drift = 0 |
| float | reference_power = 0 |
| float | header_soft [32] |
| int | header_symbol = 0 |
| int | frame_len = -1 |
| int | ndata = 0 |
| uint8_t | current = 0 |
| int | current_dibits = 0 |
| float | error_total = 0 |
| int | error_count = 0 |
| Protected Attributes inherited from tinymodem::ModemDecoder | |
| Print * | p_status = nullptr |
| bool | is_quiet = false |
Static Protected Attributes | |
| static constexpr float | TRACKING_GAIN = 0.5f |
| static constexpr float | MIN_POWER = 1e-6f |
OFDM demodulator: the PCM audio data is written to the decoder and the decoded frames are written to the output. The input can be 8, 16 or 32 bit signed samples with any number of channels (only OFDMConfig::channel is evaluated).
The start of a frame is found with the Schmidl & Cox method: the sync symbol consists of two identical halves, which are detected with a sliding autocorrelation. The reference symbol provides the initial phase of all carriers and an estimate of the frequency offset and timing drift, which are tracked during the frame. The carriers are analyzed with a DFT.
|
strongprotected |
|
default |
|
inline |
|
inlineprotected |
|
inlineoverride |
|
inlineoverride |
|
inline |
Starts the processing with the indicated configuration.
|
inlineprotected |
|
inlineprotected |
Drops the samples which are not needed any more.
|
inline |
The configuration which was provided in begin().
|
inlineprotected |
|
inlineprotected |
|
inline |
Provides a default configuration: ofdm32.
|
inlineprotected |
DFT of the window at the carrier frequencies.
|
inlineoverride |
Processes the remaining samples.
|
inlineprotected |
|
inlinestaticprotected |
Weighted linear fit: angle = common + slope * carrier.
|
inlineoverridevirtual |
Processes the remaining samples (e.g. at the end of the input).
Implements tinymodem::ModemDecoder.
|
inline |
Number of received frames.
|
inlineoverridevirtual |
true while a frame is received
Implements tinymodem::ModemDecoder.
|
inlineoverridevirtual |
true if the decoding was stopped (rx_one)
Implements tinymodem::ModemDecoder.
|
inlinestaticprotected |
true if the global index a is at or after b (with wrap around)
|
inlineprotected |
uniform random value in the range -0.5 to 0.5
|
inlineoverride |
|
inlinestaticprotected |
0 -> 00, 90 -> 01, 180 -> 11, 270 -> 10 degrees
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
Initial estimate of the frequency offset and the timing drift from the known phases of the even carriers in the sync and reference symbols
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
The sync symbol results in a plateau of the normalized correlation (length = cyclic prefix): we use the middle of the plateau
|
inlineoverride |
Defines the format of the input audio data.
|
inlinestaticprotected |
|
inlineoverride |
Provide PCM data to the decoder.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticconstexprprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticconstexprprotected |
|
protected |
|
protected |
|
protected |