File: commons.h

package info (click to toggle)
js8call 2.2.0%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 22,416 kB
  • sloc: cpp: 563,285; f90: 9,265; ansic: 937; python: 132; sh: 93; makefile: 6
file content (163 lines) | stat: -rw-r--r-- 4,935 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#ifndef COMMONS_H
#define COMMONS_H

#define NSMAX 6827
#define NTMAX 60

#define RX_SAMPLE_RATE 12000

#define JS8_USE_REFSPEC    0       // compute the signal refspec
#define JS8_USE_IHSYM      0       // compute ihsym manually instead of from symspec
#define JS8_RING_BUFFER    1       // use a ring buffer instead of clearing the decode frames
#define JS8_SINGLE_DECODE  0       // single submode decode per instantiation of the decoder
#define JS8_DECODE_THREAD  1       // use a separate thread for decode process handling
#define JS8_ALLOW_EXTENDED 1       // allow extended latin-1 capital charset
#define JS8_SAVE_AUDIO     0       // enable the save menu
#define JS8_AUTO_SYNC      1       // enable the experimental auto sync feature

#ifdef QT_DEBUG
#define JS8_DEBUG_DECODE   0       // emit debug statements for the decode pipeline
#else
#define JS8_DEBUG_DECODE   0
#endif

#define JS8_NUM_SYMBOLS    79
#define JS8_ENABLE_JS8A    1
#define JS8_ENABLE_JS8B    1
#define JS8_ENABLE_JS8C    1
#define JS8_ENABLE_JS8E    1
#define JS8_ENABLE_JS8I    0

#define JS8A_SYMBOL_SAMPLES 1920
#define JS8A_TX_SECONDS     15
#define JS8A_START_DELAY_MS 500

#define JS8B_SYMBOL_SAMPLES 1200
#define JS8B_TX_SECONDS     10
#define JS8B_START_DELAY_MS 200

#define JS8C_SYMBOL_SAMPLES 600
#define JS8C_TX_SECONDS     6
#define JS8C_START_DELAY_MS 100

#define JS8E_SYMBOL_SAMPLES 3840
#define JS8E_TX_SECONDS     30
#define JS8E_START_DELAY_MS 500

#define JS8I_SYMBOL_SAMPLES 384
#define JS8I_TX_SECONDS     4
#define JS8I_START_DELAY_MS 100

#ifndef TEST_FOX_WAVE_GEN
#define TEST_FOX_WAVE_GEN 0
#endif

#ifndef TEST_FOX_WAVE_GEN_SLOTS
#if TEST_FOX_WAVE_GEN
    #define TEST_FOX_WAVE_GEN_SLOTS 2
#else
    #define TEST_FOX_WAVE_GEN_SLOTS 1
#endif
#endif

#ifndef TEST_FOX_WAVE_GEN_OFFSET
#if TEST_FOX_WAVE_GEN
    #define TEST_FOX_WAVE_GEN_OFFSET 25
#else
    #define TEST_FOX_WAVE_GEN_OFFSET 0
#endif
#endif

#ifdef __cplusplus
#include <cstdbool>
extern "C" {
#else
#include <stdbool.h>
#endif

  /*
   * This structure is shared with Fortran code, it MUST be kept in
   * sync with lib/jt9com.f90
   */
extern struct dec_data {
  float ss[184*NSMAX]; // symbol spectra
  float savg[NSMAX];
  float sred[5760];
  short int d2[NTMAX*RX_SAMPLE_RATE]; // sample frame buffer for sample collection
  struct
  {
    int nutc;                   // UTC as integer, HHMM
    bool ndiskdat;              // true ==> data read from *.wav file
    int ntrperiod;              // TR period (seconds)
    int nQSOProgress;           // QSO state machine state
    int nfqso;                  // User-selected QSO freq (kHz)
    int nftx;                   // Transmit audio offset where replies might be expected
    bool newdat;                // true ==> new data, must do long FFT
    int npts8;                  // npts for c0() array
    int nfa;                    // Low decode limit (Hz) (filter min)
    int nfb;                    // High decode limit (Hz) (filter max)
    int ntol;                   // +/- decoding range around fQSO (Hz)
    bool syncStats;              // only compute sync candidates
    int kin;                    // number of frames written to d2
    int kposA;                  // starting position of decode for submode A
    int kposB;                  // starting position of decode for submode B
    int kposC;                  // starting position of decode for submode C
    int kposE;                  // starting position of decode for submode E
    int kposI;                  // starting position of decode for submode I
    int kszA;                   // number of frames for decode for submode A
    int kszB;                   // number of frames for decode for submode B
    int kszC;                   // number of frames for decode for submode C
    int kszE;                   // number of frames for decode for submode E
    int kszI;                   // number of frames for decode for submode I
    int nzhsym;                 // half symbol stop index
    int nsubmode;               // which submode to decode (-1 if using nsubmodes)
    int nsubmodes;              // which submodes to decode
    bool nagain;
    int ndepth;
    bool lft8apon;
    bool lapcqonly;
    bool ljt65apon;
    int napwid;
    int ntxmode;
    int nmode;
    int minw;
    bool nclearave;
    int minSync;
    float emedelay;
    float dttol;
    int nlist;
    int listutc[10];
    int n2pass;
    int nranera;
    int naggressive;
    bool nrobust;
    int nexp_decode;
    char datetime[20];
    char mycall[12];
    char mygrid[6];
    char hiscall[12];
    char hisgrid[6];
    int  ndebug;
  } params;
} dec_data;

extern struct {
  float syellow[NSMAX];
  float ref[3457];
  float filter[3457];
} spectra_;

extern struct {
  float wave[606720];
  int   nslots;
  int   nfreq;
  int   i3bit[5];
  char  cmsg[5][40];
  char  mycall[12];
} foxcom_;

#ifdef __cplusplus
}
#endif

#endif // COMMONS_H