| 
									
										
										
										
											2018-02-08 21:28:33 -05:00
										 |  |  | #ifndef COMMONS_H
 | 
					
						
							|  |  |  | #define COMMONS_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define NSMAX 6827
 | 
					
						
							| 
									
										
										
										
											2019-10-26 23:01:05 -04: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-10-30 11:49:10 -04:00
										 |  |  | #define JS8_USE_REFSPEC    1       // compute the signal refspec
 | 
					
						
							| 
									
										
										
										
											2019-10-31 07:53:48 -04:00
										 |  |  | #define JS8_USE_IHSYM      1       // 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
 | 
					
						
							|  |  |  | #define JS8_DECODER_ONE    1       // decode only one mode at a time
 | 
					
						
							|  |  |  | #define JS8_DECODER_E2S    0       // decode every 2 seconds instead of at the half symbol stop
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-14 21:11:06 -04:00
										 |  |  | #define JS8_NUM_SYMBOLS    79
 | 
					
						
							| 
									
										
										
										
											2019-09-05 14:07:24 -04:00
										 |  |  | #define JS8_ENABLE_JS8B    1
 | 
					
						
							|  |  |  | #define JS8_ENABLE_JS8C    1
 | 
					
						
							|  |  |  | #define JS8_ENABLE_JS8D    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 JS8D_IS_ULTRA 1
 | 
					
						
							|  |  |  | #if JS8D_IS_ULTRA
 | 
					
						
							|  |  |  | #define JS8D_SYMBOL_SAMPLES 384
 | 
					
						
							|  |  |  | #define JS8D_TX_SECONDS     4
 | 
					
						
							|  |  |  | #define JS8D_START_DELAY_MS 100
 | 
					
						
							| 
									
										
										
										
											2019-08-14 21:11:06 -04:00
										 |  |  | #else
 | 
					
						
							| 
									
										
										
										
											2019-09-05 14:07:24 -04:00
										 |  |  | #define JS8D_SYMBOL_SAMPLES 4000
 | 
					
						
							|  |  |  | #define JS8D_TX_SECONDS     30
 | 
					
						
							|  |  |  | #define JS8D_START_DELAY_MS 100
 | 
					
						
							| 
									
										
										
										
											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 d1[NTMAX*RX_SAMPLE_RATE]; // sample frame buffer for decoding (copied from d2 for the frame period)
 | 
					
						
							|  |  |  |   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-01 15:07:24 -04:00
										 |  |  |     int kpos;                   // starting position of decode
 | 
					
						
							|  |  |  |     int kout;                   // number of frames for decode
 | 
					
						
							| 
									
										
										
										
											2019-10-30 11:49:10 -04:00
										 |  |  |     int nzhsym;                 // half symbol stop index
 | 
					
						
							| 
									
										
										
										
											2018-02-08 21:28:33 -05:00
										 |  |  |     int nsubmode; | 
					
						
							|  |  |  |     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]; | 
					
						
							|  |  |  |   } 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
 |