JS8Call-Improved master
Loading...
Searching...
No Matches
JS8Submode.h
Go to the documentation of this file.
1
8
9#ifndef JS8_SUBMODE_HPP_
10#define JS8_SUBMODE_HPP_
11
12#include "JS8_Mode/JS8.h"
13
14#include <QString>
15
16#include <stdexcept>
17
18namespace JS8::Submode {
19
24struct error : public std::runtime_error {
25 explicit error(QString const &what)
26 : std::runtime_error(what.toStdString()) {}
27};
28
29// Helper note:
30// Be careful when doing arithmetic with unsigned values; expressions like
31// `3 - samplesForOneSymbol` may underflow. To inspect concrete submode
32// values at runtime, enable logging with `QT_LOGGING_RULES=js8submode.js8=true`.
33
40QString name(int submode);
41
48unsigned int bandwidth(int submode);
49
55Costas::Type costas(int submode);
56
62unsigned int period(int submode);
63
69unsigned int samplesForOneSymbol(int submode);
70
77unsigned int samplesForSymbols(int submode);
78
84unsigned int samplesNeeded(int submode);
85
91unsigned int samplesPerPeriod(int submode);
92
98int rxSNRThreshold(int submode);
99
105int rxThreshold(int submode);
106
112unsigned int startDelayMS(int submode);
113
119double toneSpacing(int submode);
120
126double dataDuration(int submode);
127
133double txDuration(int submode);
134
141int computeCycleForDecode(int submode, int param);
142
150int computeAltCycleForDecode(int submode, int a, int b);
151
158double computeRatio(int submode, double value);
159
160} // namespace JS8::Submode
161
162#endif // JS8_SUBMODE_HPP_
Core JS8 namespace types, Costas arrays and decoder event payloads.
Type
Costas array helpers used to map symbols to tones.
Definition JS8.h:31
JS8 Submode namespace implementation.
Definition JS8Submode.cpp:19
double computeRatio(int const submode, double const period)
Compute the ratio of data duration to period.
Definition JS8Submode.cpp:392
int computeAltCycleForDecode(int const submode, int const k, int const offsetFrames)
Compute the alternate cycle for decode.
Definition JS8Submode.cpp:377
double txDuration(int const submode)
Get the transmit duration of the submode.
Definition JS8Submode.cpp:345
Costas::Type costas(int const submode)
Get the Costas array type of the submode.
Definition JS8Submode.cpp:258
unsigned int samplesForOneSymbol(int const submode)
Get the number of samples for one symbol of the submode.
Definition JS8Submode.cpp:322
unsigned int samplesNeeded(int const submode)
Get the number of samples needed for the submode.
Definition JS8Submode.cpp:283
unsigned int period(int const submode)
Get the period of the submode.
Definition JS8Submode.cpp:292
unsigned int startDelayMS(int const submode)
Get the start delay in milliseconds of the submode.
Definition JS8Submode.cpp:313
double dataDuration(int const submode)
Get the data duration of the submode.
Definition JS8Submode.cpp:338
double toneSpacing(int const submode)
Get the tone spacing of the submode.
Definition JS8Submode.cpp:331
int rxSNRThreshold(int const submode)
Get the receive SNR threshold of the submode.
Definition JS8Submode.cpp:299
unsigned int samplesPerPeriod(int const submode)
Get the number of samples per period of the submode.
Definition JS8Submode.cpp:265
unsigned int bandwidth(int const submode)
Get the bandwidth of the submode.
Definition JS8Submode.cpp:251
QString name(int const submode)
Get the name of the submode.
Definition JS8Submode.cpp:240
int computeCycleForDecode(int const submode, int const k)
Compute the cycle for decode.
Definition JS8Submode.cpp:357
unsigned int samplesForSymbols(int const submode)
Get the number of samples for symbols of the submode.
Definition JS8Submode.cpp:274
int rxThreshold(int const submode)
Get the receive threshold of the submode.
Definition JS8Submode.cpp:306