f->prev_rx_symbols[c].real = 1.0;
f->prev_rx_symbols[c].imag = 0.0;
- for(k=0; k<NFILTER; k++) {
+ for(k=0; k<NSYM; k++) {
f->tx_filter_memory[c][k].real = 0.0;
f->tx_filter_memory[c][k].imag = 0.0;
+ }
+
+ for(k=0; k<NFILTER; k++) {
f->rx_filter_memory[c][k].real = 0.0;
f->rx_filter_memory[c][k].imag = 0.0;
}
\*---------------------------------------------------------------------------*/
-void tx_filter(COMP tx_baseband[NC+1][M], COMP tx_symbols[], COMP tx_filter_memory[NC+1][NFILTER])
+void tx_filter(COMP tx_baseband[NC+1][M], COMP tx_symbols[], COMP tx_filter_memory[NC+1][NSYM])
{
int c;
int i,j,k;
gain.real = sqrt(2.0)/2.0;
gain.imag = 0.0;
-
+
+ /*
for(c=0; c<NC+1; c++)
tx_filter_memory[c][NFILTER-1] = cmult(tx_symbols[c], gain);
+ */
+ for(c=0; c<NC+1; c++)
+ tx_filter_memory[c][NSYM-1] = cmult(tx_symbols[c], gain);
+
/*
tx filter each symbol, generate M filtered output samples for each symbol.
/* filter real sample of symbol for carrier c */
acc = 0.0;
- for(j=M-1,k=M-i-1; j<NFILTER; j+=M,k+=M)
+ for(j=0,k=M-i-1; j<NSYM; j++,k+=M)
acc += M * tx_filter_memory[c][j].real * gt_alpha5_root[k];
tx_baseband[c][i].real = acc;
/* filter imag sample of symbol for carrier c */
acc = 0.0;
- for(j=M-1,k=M-i-1; j<NFILTER; j+=M,k+=M)
+ for(j=0,k=M-i-1; j<NSYM; j++,k+=M)
acc += M * tx_filter_memory[c][j].imag * gt_alpha5_root[k];
tx_baseband[c][i].imag = acc;
/* shift memory, inserting zeros at end */
- for(i=0; i<NFILTER-M; i++)
+ for(i=0; i<NSYM-1; i++)
for(c=0; c<NC+1; c++)
- tx_filter_memory[c][i] = tx_filter_memory[c][i+M];
+ tx_filter_memory[c][i] = tx_filter_memory[c][i+1];
- for(i=NFILTER-M; i<NFILTER; i++)
- for(c=0; c<NC+1; c++) {
- tx_filter_memory[c][i].real = 0.0;
- tx_filter_memory[c][i].imag = 0.0;
- }
+ for(c=0; c<NC+1; c++) {
+ tx_filter_memory[c][NSYM-1].real = 0.0;
+ tx_filter_memory[c][NSYM-1].imag = 0.0;
+ }
}
/*---------------------------------------------------------------------------*\
int tx_pilot_bit;
COMP prev_tx_symbols[NC+1];
- COMP tx_filter_memory[NC+1][NFILTER];
+ COMP tx_filter_memory[NC+1][NSYM];
COMP phase_tx[NC+1];
COMP freq[NC+1];
\*---------------------------------------------------------------------------*/
void bits_to_dqpsk_symbols(COMP tx_symbols[], COMP prev_tx_symbols[], int tx_bits[], int *pilot_bit);
-void tx_filter(COMP tx_baseband[NC+1][M], COMP tx_symbols[], COMP tx_filter_memory[NC+1][NFILTER]);
+void tx_filter(COMP tx_baseband[NC+1][M], COMP tx_symbols[], COMP tx_filter_memory[NC+1][NSYM]);
void fdm_upconvert(COMP tx_fdm[], COMP tx_baseband[NC+1][M], COMP phase_tx[], COMP freq_tx[]);
void generate_pilot_fdm(COMP *pilot_fdm, int *bit, float *symbol, float *filter_mem, COMP *phase, COMP *freq);
void generate_pilot_lut(COMP pilot_lut[], COMP *pilot_freq);