JS8Call-Improved master
Loading...
Searching...
No Matches
JS8Submode.h
1#ifndef JS8_SUBMODE_HPP_
2#define JS8_SUBMODE_HPP_
3
4#include "JS8_Mode/JS8.h"
5
6#include <QString>
7
8#include <stdexcept>
9
10namespace JS8::Submode {
11// Exception thrown on unexpected errors, principally, handing
12// us a submode that we don't understand, which seems like your
13// problem, not ours.
14
15struct error : public std::runtime_error {
16 explicit error(QString const &what)
17 : std::runtime_error(what.toStdString()) {}
18};
19
20// Functions that, when provided with a valid submode, return
21// constant data specific to the submode. Each of those functions
22// will throw if provided with an invalid JS8 submode.
23
24// Be careful when doing arithmetic with values that are unsigned.
25// Something seemingly harmless such as 3 - samplesForOneSymbol
26// might end up as 4,294,965,379.
27
28// One way to see the actual values of the various modes:
29// Running JS8Call with the environment variable
30// QT_LOGGING_RULES set to the value js8submode.js8=true
31// will output a list of them to STDERR.
32
34QString name(int);
35unsigned int bandwidth(int);
36Costas::Type costas(int);
37
44unsigned int period(int);
45
48unsigned int samplesForOneSymbol(int);
49
57unsigned int samplesForSymbols(int);
58
63unsigned int samplesNeeded(int);
64
69unsigned int samplesPerPeriod(int);
70int rxSNRThreshold(int);
71int rxThreshold(int);
72
75unsigned int startDelayMS(int);
76double toneSpacing(int);
77
83double dataDuration(int);
84
90double txDuration(int);
91
92// Functions that, when provided with a valid submode and additional
93// parametric data, compute and return results specific to the submode.
94// Each of these functions will throw if provided with an invalid JS8
95// submode.
96
97int computeCycleForDecode(int, int);
98int computeAltCycleForDecode(int, int, int);
99double computeRatio(int, double);
100} // namespace JS8::Submode
101
102#endif // JS8_SUBMODE_HPP_
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