From: drowe67 Date: Thu, 5 Jun 2014 04:42:47 +0000 (+0000) Subject: changed fdmdv_freq_shift arguments, thanks Bruce X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=43113cc419e78c09a074b36784ce63213e0fbb93;p=freetel-svn-tracking.git changed fdmdv_freq_shift arguments, thanks Bruce git-svn-id: https://svn.code.sf.net/p/freetel/code@1637 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/src/codec2_fdmdv.h b/codec2-dev/src/codec2_fdmdv.h index 543b4d04..5938c642 100644 --- a/codec2-dev/src/codec2_fdmdv.h +++ b/codec2-dev/src/codec2_fdmdv.h @@ -110,7 +110,7 @@ void CODEC2_WIN32SUPPORT fdmdv_get_rx_spectrum(struct FDMDV *fdmdv_sta 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) */ diff --git a/codec2-dev/src/fdmdv.c b/codec2-dev/src/fdmdv.c index 880cabb2..90814c0f 100644 --- a/codec2-dev/src/fdmdv.c +++ b/codec2-dev/src/fdmdv.c @@ -211,8 +211,6 @@ struct FDMDV * CODEC2_WIN32SUPPORT fdmdv_create(int Nc) } 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; @@ -760,14 +758,15 @@ float rx_est_freq_offset(struct FDMDV *f, COMP rx_fdm[], int nin) \*---------------------------------------------------------------------------*/ 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; isync == 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 */ @@ -1561,7 +1560,7 @@ void CODEC2_WIN32SUPPORT fdmdv_dump_osc_mags(struct FDMDV *f) 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])); diff --git a/codec2-dev/src/fdmdv_internal.h b/codec2-dev/src/fdmdv_internal.h index e9b355d4..5957e3d4 100644 --- a/codec2-dev/src/fdmdv_internal.h +++ b/codec2-dev/src/fdmdv_internal.h @@ -114,7 +114,6 @@ struct FDMDV { /* freq offset correction states */ float foff; - COMP foff_rect; COMP foff_phase_rect; /* Demodulator */ @@ -158,7 +157,6 @@ void generate_pilot_fdm(COMP *pilot_fdm, int *bit, float *symbol, float *filter_ 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,