void CODEC2_WIN32SUPPORT fdmdv_8_to_48(float out48k[], float in8k[], int n);
void CODEC2_WIN32SUPPORT fdmdv_48_to_8(float out8k[], float in48k[], int n);
-void CODEC2_WIN32SUPPORT fdmdv_freq_shift(COMP rx_fdm_fcorr[], COMP rx_fdm[], float foff, COMP *foff_rect, COMP *foff_phase_rect, int nin);
+void CODEC2_WIN32SUPPORT fdmdv_freq_shift(COMP rx_fdm_fcorr[], COMP rx_fdm[], float foff, COMP *foff_phase_rect, int nin);
/* debug/development function(s) */
}
f->foff = 0.0;
- f->foff_rect.real = 1.0;
- f->foff_rect.imag = 0.0;
f->foff_phase_rect.real = 1.0;
f->foff_phase_rect.imag = 0.0;
\*---------------------------------------------------------------------------*/
void CODEC2_WIN32SUPPORT fdmdv_freq_shift(COMP rx_fdm_fcorr[], COMP rx_fdm[], float foff,
- COMP *foff_rect, COMP *foff_phase_rect, int nin)
+ COMP *foff_phase_rect, int nin)
{
+ COMP foff_rect;
int i;
- foff_rect->real = cos(2.0*PI*foff/FS);
- foff_rect->imag = sin(2.0*PI*foff/FS);
+ foff_rect.real = cos(2.0*PI*foff/FS);
+ foff_rect.imag = sin(2.0*PI*foff/FS);
for(i=0; i<nin; i++) {
- *foff_phase_rect = cmult(*foff_phase_rect, *foff_rect);
+ *foff_phase_rect = cmult(*foff_phase_rect, foff_rect);
rx_fdm_fcorr[i] = cmult(rx_fdm[i], *foff_phase_rect);
}
if (fdmdv->sync == 0)
fdmdv->foff = foff_coarse;
- fdmdv_freq_shift(rx_fdm_fcorr, rx_fdm, -fdmdv->foff, &fdmdv->foff_rect, &fdmdv->foff_phase_rect, *nin);
+ fdmdv_freq_shift(rx_fdm_fcorr, rx_fdm, -fdmdv->foff, &fdmdv->foff_phase_rect, *nin);
/* baseband processing */
fprintf(stderr,"\nfreq[]:\n");
for(i=0; i<=f->Nc; i++)
fprintf(stderr," %1.3f", cabsolute(f->freq[i]));
- fprintf(stderr,"\nfoff_rect %1.3f foff_phase_rect: %1.3f", cabsolute(f->foff_rect), cabsolute(f->foff_phase_rect));
+ fprintf(stderr,"\nfoff_phase_rect: %1.3f", cabsolute(f->foff_phase_rect));
fprintf(stderr,"\nphase_rx[]:\n");
for(i=0; i<=f->Nc; i++)
fprintf(stderr," %1.3f", cabsolute(f->phase_rx[i]));
/* freq offset correction states */
float foff;
- COMP foff_rect;
COMP foff_phase_rect;
/* Demodulator */
void generate_pilot_lut(COMP pilot_lut[], COMP *pilot_freq);
float rx_est_freq_offset(struct FDMDV *f, COMP rx_fdm[], int nin);
void lpf_peak_pick(float *foff, float *max, COMP pilot_baseband[], COMP pilot_lpf[], kiss_fft_cfg fft_pilot_cfg, COMP S[], int nin);
-void freq_shift(COMP rx_fdm_fcorr[], COMP rx_fdm[], float foff, COMP *foff_rect, COMP *foff_phase_rect, int nin);
void fdm_downconvert(COMP rx_baseband[NC+1][M+M/P], int Nc, COMP rx_fdm[], COMP phase_rx[], COMP freq[], int nin);
void rx_filter(COMP rx_filt[NC+1][P+1], int Nc, COMP rx_baseband[NC+1][M+M/P], COMP rx_filter_memory[NC+1][NFILTER], int nin);
float rx_est_timing(COMP rx_symbols[], int Nc,