| 
									
										
										
										
											2018-02-08 21:28:33 -05:00
										 |  |  | #ifndef COMMONS_H
 | 
					
						
							|  |  |  | #define COMMONS_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define NSMAX 6827
 | 
					
						
							| 
									
										
										
										
											2019-11-04 14:38:00 -05:00
										 |  |  | #define NTMAX 60
 | 
					
						
							| 
									
										
										
										
											2019-08-14 21:11:06 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-08 21:28:33 -05:00
										 |  |  | #define RX_SAMPLE_RATE 12000
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-05 21:27:41 -05:00
										 |  |  | #define JS8_USE_REFSPEC    0       // compute the signal refspec
 | 
					
						
							| 
									
										
										
										
											2019-11-05 15:43:34 -05:00
										 |  |  | #define JS8_USE_IHSYM      0       // compute ihsym manually instead of from symspec
 | 
					
						
							| 
									
										
										
										
											2019-10-30 11:49:10 -04:00
										 |  |  | #define JS8_RING_BUFFER    1       // use a ring buffer instead of clearing the decode frames
 | 
					
						
							| 
									
										
										
										
											2019-11-11 22:39:02 -05:00
										 |  |  | #define JS8_SINGLE_DECODE  0       // single submode decode per instantiation of the decoder
 | 
					
						
							| 
									
										
										
										
											2019-11-19 10:39:27 -05:00
										 |  |  | #define JS8_DECODE_THREAD  1       // use a separate thread for decode process handling
 | 
					
						
							| 
									
										
										
										
											2019-11-22 01:34:57 -05:00
										 |  |  | #define JS8_ALLOW_EXTENDED 1       // allow extended latin-1 capital charset
 | 
					
						
							| 
									
										
										
										
											2019-11-15 21:17:47 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | #ifdef QT_DEBUG
 | 
					
						
							| 
									
										
										
										
											2019-11-13 16:10:26 -05:00
										 |  |  | #define JS8_DEBUG_DECODE   1       // emit debug statements for the decode pipeline
 | 
					
						
							| 
									
										
										
										
											2019-11-15 21:17:47 -05:00
										 |  |  | #else
 | 
					
						
							|  |  |  | #define JS8_DEBUG_DECODE   0
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2019-10-30 11:49:10 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-14 21:11:06 -04:00
										 |  |  | #define JS8_NUM_SYMBOLS    79
 | 
					
						
							| 
									
										
										
										
											2019-11-04 14:38:00 -05:00
										 |  |  | #define JS8_ENABLE_JS8A    1
 | 
					
						
							| 
									
										
										
										
											2019-09-05 14:07:24 -04:00
										 |  |  | #define JS8_ENABLE_JS8B    1
 | 
					
						
							|  |  |  | #define JS8_ENABLE_JS8C    1
 | 
					
						
							| 
									
										
										
										
											2019-11-09 09:25:03 -05:00
										 |  |  | #define JS8_ENABLE_JS8E    0
 | 
					
						
							| 
									
										
										
										
											2019-09-05 14:07:24 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | #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
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-07 22:18:05 -05:00
										 |  |  | #define JS8E_IS_ULTRA 1
 | 
					
						
							| 
									
										
										
										
											2019-11-06 16:00:16 -05:00
										 |  |  | #if JS8E_IS_ULTRA
 | 
					
						
							|  |  |  | #define JS8E_SYMBOL_SAMPLES 384
 | 
					
						
							|  |  |  | #define JS8E_TX_SECONDS     4
 | 
					
						
							|  |  |  | #define JS8E_START_DELAY_MS 100
 | 
					
						
							| 
									
										
										
										
											2019-08-14 21:11:06 -04:00
										 |  |  | #else
 | 
					
						
							| 
									
										
										
										
											2019-11-07 14:26:08 -05:00
										 |  |  | #define JS8E_SYMBOL_SAMPLES 4000
 | 
					
						
							| 
									
										
										
										
											2019-11-06 16:00:16 -05:00
										 |  |  | #define JS8E_TX_SECONDS     30
 | 
					
						
							| 
									
										
										
										
											2019-11-06 16:32:13 -05:00
										 |  |  | #define JS8E_START_DELAY_MS 500
 | 
					
						
							| 
									
										
										
										
											2019-08-14 21:11:06 -04:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2019-05-27 14:19:37 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | #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
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-04 14:55:02 -04:00
										 |  |  | #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
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-08 21:28:33 -05:00
										 |  |  | #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 { | 
					
						
							| 
									
										
										
										
											2019-10-22 01:16:02 -04:00
										 |  |  |   float ss[184*NSMAX]; // symbol spectra
 | 
					
						
							| 
									
										
										
										
											2018-02-08 21:28:33 -05:00
										 |  |  |   float savg[NSMAX]; | 
					
						
							|  |  |  |   float sred[5760]; | 
					
						
							| 
									
										
										
										
											2019-10-28 16:06:06 -04:00
										 |  |  |   short int d2[NTMAX*RX_SAMPLE_RATE]; // sample frame buffer for sample collection
 | 
					
						
							| 
									
										
										
										
											2018-02-08 21:28:33 -05:00
										 |  |  |   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)
 | 
					
						
							|  |  |  |     int nfSplit;                //JT65 | JT9 split frequency
 | 
					
						
							|  |  |  |     int nfb;                    //High decode limit (Hz)
 | 
					
						
							|  |  |  |     int ntol;                   //+/- decoding range around fQSO (Hz)
 | 
					
						
							| 
									
										
										
										
											2019-10-26 23:01:05 -04:00
										 |  |  |     int kin;                    // number of frames written to d2
 | 
					
						
							| 
									
										
										
										
											2019-11-04 14:38:00 -05:00
										 |  |  |     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
 | 
					
						
							| 
									
										
										
										
											2019-11-06 16:00:16 -05:00
										 |  |  |     int kposE;                  // starting position of decode for submode E
 | 
					
						
							| 
									
										
										
										
											2019-11-04 14:38:00 -05:00
										 |  |  |     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
 | 
					
						
							| 
									
										
										
										
											2019-11-06 16:00:16 -05:00
										 |  |  |     int kszE;                   // number of frames for decode for submode E
 | 
					
						
							| 
									
										
										
										
											2019-10-30 11:49:10 -04:00
										 |  |  |     int nzhsym;                 // half symbol stop index
 | 
					
						
							| 
									
										
										
										
											2018-02-08 21:28:33 -05:00
										 |  |  |     int nsubmode; | 
					
						
							| 
									
										
										
										
											2019-11-04 14:38:00 -05:00
										 |  |  |     int nsubmodes; | 
					
						
							| 
									
										
										
										
											2018-02-08 21:28:33 -05:00
										 |  |  |     bool nagain; | 
					
						
							|  |  |  |     int ndepth; | 
					
						
							| 
									
										
										
										
											2018-03-05 14:49:51 -05:00
										 |  |  |     bool lft8apon; | 
					
						
							|  |  |  |     bool lapcqonly; | 
					
						
							|  |  |  |     bool ljt65apon; | 
					
						
							| 
									
										
										
										
											2018-02-08 21:28:33 -05:00
										 |  |  |     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]; | 
					
						
							| 
									
										
										
										
											2019-11-05 21:27:41 -05:00
										 |  |  |     int  ndebug; | 
					
						
							| 
									
										
										
										
											2018-02-08 21:28:33 -05:00
										 |  |  |   } params; | 
					
						
							|  |  |  | } dec_data; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | extern struct { | 
					
						
							|  |  |  |   float syellow[NSMAX]; | 
					
						
							|  |  |  |   float ref[3457]; | 
					
						
							|  |  |  |   float filter[3457]; | 
					
						
							|  |  |  | } spectra_; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-05 14:49:51 -05:00
										 |  |  | extern struct { | 
					
						
							|  |  |  |   float wave[606720]; | 
					
						
							|  |  |  |   int   nslots; | 
					
						
							|  |  |  |   int   nfreq; | 
					
						
							|  |  |  |   int   i3bit[5]; | 
					
						
							|  |  |  |   char  cmsg[5][40]; | 
					
						
							|  |  |  |   char  mycall[12]; | 
					
						
							|  |  |  | } foxcom_; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-08 21:28:33 -05:00
										 |  |  | #ifdef __cplusplus
 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif // COMMONS_H
 |