void CODEC2_WIN32SUPPORT fdmdv_destroy(struct FDMDV *fdmdv_state);
void CODEC2_WIN32SUPPORT fdmdv_use_old_qpsk_mapping(struct FDMDV *fdmdv_state);
int CODEC2_WIN32SUPPORT fdmdv_bits_per_frame(struct FDMDV *fdmdv_state);
-
+float CODEC2_WIN32SUPPORT fdmdv_get_fsep(struct FDMDV *fdmdv_state);
+void CODEC2_WIN32SUPPORT fdmdv_set_fsep(struct FDMDV *fdmdv_state, float fsep);
+
void CODEC2_WIN32SUPPORT fdmdv_mod(struct FDMDV *fdmdv_state, COMP tx_fdm[], int tx_bits[], int *sync_bit);
void CODEC2_WIN32SUPPORT fdmdv_demod(struct FDMDV *fdmdv_state, int rx_bits[], int *reliable_sync_bit, COMP rx_fdm[], int *nin);
{
struct FDMDV *f;
int c, i, k;
- float carrier_freq;
assert(NC == FDMDV_NC_MAX); /* check public and private #defines match */
assert(Nc <= NC);
f->rx_baseband_mem_timing[c][k].real = 0.0;
f->rx_baseband_mem_timing[c][k].imag = 0.0;
}
- }
-
- /* Set up frequency of each carrier */
-
- for(c=0; c<Nc/2; c++) {
- carrier_freq = (-Nc/2 + c)*FSEP + FDMDV_FCENTRE;
- f->freq[c].real = cos(2.0*PI*carrier_freq/FS);
- f->freq[c].imag = sin(2.0*PI*carrier_freq/FS);
- }
-
- for(c=Nc/2; c<Nc; c++) {
- carrier_freq = (-Nc/2 + c + 1)*FSEP + FDMDV_FCENTRE;
- f->freq[c].real = cos(2.0*PI*carrier_freq/FS);
- f->freq[c].imag = sin(2.0*PI*carrier_freq/FS);
}
-
+
+ fdmdv_set_fsep(f, FSEP);
f->freq[Nc].real = cos(2.0*PI*FDMDV_FCENTRE/FS);
f->freq[Nc].imag = sin(2.0*PI*FDMDV_FCENTRE/FS);
}
}
+float CODEC2_WIN32SUPPORT fdmdv_get_fsep(struct FDMDV *f)
+{
+ return f->fsep;
+}
+
+void CODEC2_WIN32SUPPORT fdmdv_set_fsep(struct FDMDV *f, float fsep) {
+ int c;
+ float carrier_freq;
+
+ f->fsep = fsep;
+ /* Set up frequency of each carrier */
+
+ for(c=0; c<f->Nc/2; c++) {
+ carrier_freq = (-f->Nc/2 + c)*f->fsep + FDMDV_FCENTRE;
+ f->freq[c].real = cos(2.0*PI*carrier_freq/FS);
+ f->freq[c].imag = sin(2.0*PI*carrier_freq/FS);
+ }
+
+ for(c=f->Nc/2; c<f->Nc; c++) {
+ carrier_freq = (-f->Nc/2 + c + 1)*f->fsep + FDMDV_FCENTRE;
+ f->freq[c].real = cos(2.0*PI*carrier_freq/FS);
+ f->freq[c].imag = sin(2.0*PI*carrier_freq/FS);
+ }
+}
+
+
/*---------------------------------------------------------------------------*\
FUNCTION....: bits_to_dqpsk_symbols()
#define NSYM 6 /* number of symbols to filter over */
#define NFILTER (NSYM*M) /* size of tx/rx filters at sample rate M */
-#define FSEP 75 /* Separation between carriers (Hz) */
+#define FSEP 75 /* Default separation between carriers (Hz) */
#define NT 5 /* number of symbols we estimate timing over */
#define P 4 /* oversample factor used for initial rx symbol filtering */
struct FDMDV {
- int Nc;
+ int Nc;
+ float fsep;
/* test data (test frame) states */