js8call/commons.h
Jordan Sherer 15bf364e5e Squashed commit of the following:
commit dbca224ee15f598ba86b860c19e902b594f6b888
Author: Jordan Sherer <jordan@widefido.com>
Date:   Wed Aug 14 21:10:17 2019 -0400

    Cleanup decoder with easy parameters

commit 427a6ac6bf02a7de80e76b921bbd48ec23dab0c4
Author: Jordan Sherer <jordan@widefido.com>
Date:   Tue Aug 13 22:56:32 2019 -0400

    Working on downsampling

commit ef5e1fb9cdafb6069b6f67377c3bc9e073d2785e
Author: Jordan Sherer <jordan@widefido.com>
Date:   Tue Aug 13 22:01:34 2019 -0400

    Fixed NN parameters

commit 216dbc83a931127540fb028d3365a205b4ef1d28
Author: Jordan Sherer <jordan@widefido.com>
Date:   Tue Aug 13 21:40:20 2019 -0400

    Fixed dupe during sync

commit 9505d50ba6c42b05e5fff1a059864a643d9e7558
Author: Jordan Sherer <jordan@widefido.com>
Date:   Tue Aug 13 16:54:37 2019 -0400

    Tweaking downsampling

commit 86cd07e1ac8ce8d64cdd2d4321cf295cd867f80e
Author: Jordan Sherer <jordan@widefido.com>
Date:   Tue Aug 13 10:11:07 2019 -0400

    Working with logging

commit 0de3849a442d20081f545c6fef5fadf2def6e0d2
Author: Jordan Sherer <jordan@widefido.com>
Date:   Tue Aug 13 03:46:51 2019 -0400

    250 millisecond startup delay

commit a35cc5302b6f8532a424d504a4e2feaacf74ef99
Author: Jordan Sherer <jordan@widefido.com>
Date:   Tue Aug 13 03:39:20 2019 -0400

    1200 sps, 10 seconds, 80Hz

commit 6f36db20f90c510336b497605d9d7667d6f0f44f
Author: Jordan Sherer <jordan@widefido.com>
Date:   Tue Aug 13 03:27:12 2019 -0400

    Working word count

commit 741c55ac0840512d68e1fbdb2f1fff6adfcd4612
Author: Jordan Sherer <jordan@widefido.com>
Date:   Tue Aug 13 02:40:40 2019 -0400

    Updated LDPC simulator

commit ce0992644315402503f44bdae4131bacf2cc3e21
Author: Jordan Sherer <jordan@widefido.com>
Date:   Tue Aug 13 02:34:01 2019 -0400

    Weird. Apparently symbol stop is the only way to get decodes to work in app...need to figure out why

commit 8b330fbff6574f2ee6d7a471dd93a2cb57b492dd
Author: Jordan Sherer <jordan@widefido.com>
Date:   Tue Aug 13 01:50:37 2019 -0400

    More parameter fixups (downsampling) and first decode

commit 37c780b45e6579294b5a4692b8e8d0602d9bd8b1
Author: Jordan Sherer <jordan@widefido.com>
Date:   Mon Aug 12 23:20:58 2019 -0400

    More params fixing

commit bc8547e1e8f55bfb4bce5f95890f3cf6798e36d7
Author: Jordan Sherer <jordan@widefido.com>
Date:   Mon Aug 12 22:48:00 2019 -0400

    Fixed params in fortran code

commit 10fbf9f4a78c6244e0082a31819ee26aeae39325
Author: Jordan Sherer <jordan@widefido.com>
Date:   Mon Aug 12 16:08:32 2019 -0400

    Using constants in place of literals in a few places to make it easier to change
2019-08-14 21:11:06 -04:00

134 lines
2.9 KiB
C

#ifndef COMMONS_H
#define COMMONS_H
#define NSMAX 6827
#define NTMAX 300
#define RX_SAMPLE_RATE 12000
#define JS8_NUM_SYMBOLS 79
#ifndef JS8_80HZ
#define JS8_80HZ 0
#endif
#if JS8_80HZ
#define JS8_SYMBOL_SAMPLES 1200 // 480 // 600 // 1200 // 1920
#define JS8_TX_SECONDS 10 // 5 // 6 // 10 // 15
#define JS8_SYMBOL_STOP 32 // 12 // 16 // 32 // 50 // ??? no idea why this works...
#else
#define JS8_SYMBOL_SAMPLES 1920
#define JS8_TX_SECONDS 15
#define JS8_SYMBOL_STOP 50
#endif
#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];
float savg[NSMAX];
float sred[5760];
short int d2[NTMAX*RX_SAMPLE_RATE];
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)
int kin;
int nzhsym;
int nsubmode;
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];
} params;
} dec_data;
extern struct {
float syellow[NSMAX];
float ref[3457];
float filter[3457];
} spectra_;
extern struct {
int nclearave;
int nsum;
float blue[4096];
float red[4096];
} echocom_;
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