JS8Call-Improved master
Loading...
Searching...
No Matches
commons.h
Go to the documentation of this file.
1
6
7#ifndef COMMONS_H
8#define COMMONS_H
9
10#include <cstdint>
11#include <mutex>
12
13// NSPS, the number of samples per second (at a sample rate of 12000
14// samples per second) is a constant, chosen so as to be a number
15// with no prime factor greater than 7.
16
17#define JS8_NSPS 6192
18#define JS8_NSMAX 6827
19#define JS8_NTMAX 60
20#define JS8_RX_SAMPLE_RATE 12000
21#define JS8_RX_SAMPLE_SIZE (JS8_NTMAX * JS8_RX_SAMPLE_RATE)
22
23#define JS8_RING_BUFFER 1
24#define JS8_DECODE_THREAD 1
25#define JS8_ALLOW_EXTENDED 1
26#define JS8_AUTO_SYNC 1
27
28#define JS8_NUM_SYMBOLS 79
29#define JS8_ENABLE_JS8A 1
30#define JS8_ENABLE_JS8B 1
31#define JS8_ENABLE_JS8C 1
32#define JS8_ENABLE_JS8E 1
33#define JS8_ENABLE_JS8I 1
34
35#define JS8A_SYMBOL_SAMPLES 1920
36#define JS8A_TX_SECONDS 15
37#define JS8A_START_DELAY_MS 500
38
39#define JS8B_SYMBOL_SAMPLES 1200
40#define JS8B_TX_SECONDS 10
41#define JS8B_START_DELAY_MS 200
42
43#define JS8C_SYMBOL_SAMPLES 600
44#define JS8C_TX_SECONDS 6
45#define JS8C_START_DELAY_MS 100
46
47#define JS8E_SYMBOL_SAMPLES 3840
48#define JS8E_TX_SECONDS 30
49#define JS8E_START_DELAY_MS 500
50
51#define JS8I_SYMBOL_SAMPLES 384
52#define JS8I_TX_SECONDS 4
53#define JS8I_START_DELAY_MS 100
54
62extern struct dec_data
63{
64 std::int16_t d2[JS8_RX_SAMPLE_SIZE];
65 struct
66 {
67 int nutc;
68 int nfqso;
69 bool newdat;
70 int nfa;
71 int nfb;
72 bool syncStats;
73 int kin;
74 int kposA;
75 int kposB;
76 int kposC;
77 int kposE;
78 int kposI;
79 int kszA;
80 int kszB;
81 int kszC;
82 int kszE;
83 int kszI;
85 } params;
86} dec_data;
87
95extern struct
97{
98 float savg[JS8_NSMAX];
99 float slin[JS8_NSMAX];
100}
102
103extern std::mutex fftw_mutex;
104
116inline int code_time(int hour, int minute, int second){
117 return hour * 10000 + minute * 100 + second;
118}
119
121 int hour;
122 int minute;
123 int second;
124};
125
135 struct hour_minute_second result;
136 result.hour = nutc / 10000;
137 result.minute = nutc % 10000 / 100;
138 result.second = nutc % 100;
139 return result;
140}
141
142#endif // COMMONS_H
#define JS8_NSMAX
Definition commons.h:18
int code_time(int hour, int minute, int second)
Encode hour, minute, and second into a single integer.
Definition commons.h:116
hour_minute_second decode_time(int nutc)
Decode an integer into hour, minute, and second components.
Definition commons.h:134
Global data structure used by the decoder.
Definition commons.h:63
int kszA
Definition commons.h:79
int kposC
Definition commons.h:76
int kszE
Definition commons.h:82
int kposB
Definition commons.h:75
int nfa
Definition commons.h:70
int kszI
Definition commons.h:83
int nfb
Definition commons.h:71
int kposE
Definition commons.h:77
int kszC
Definition commons.h:81
int nsubmodes
Definition commons.h:84
int nfqso
Definition commons.h:68
bool syncStats
Definition commons.h:72
std::int16_t d2[JS8_RX_SAMPLE_SIZE]
Definition commons.h:64
int kszB
Definition commons.h:80
int kposI
Definition commons.h:78
bool newdat
Definition commons.h:69
int kin
Definition commons.h:73
int kposA
Definition commons.h:74
int nutc
Definition commons.h:67
Definition commons.h:120
Global data structure used by the spectrum analyzer.
Definition commons.h:97