changed fdmdv_freq_shift arguments, thanks Bruce
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 5 Jun 2014 04:42:47 +0000 (04:42 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 5 Jun 2014 04:42:47 +0000 (04:42 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@1637 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/src/codec2_fdmdv.h
codec2-dev/src/fdmdv.c
codec2-dev/src/fdmdv_internal.h

index 543b4d04ce78023352f6e5947c6b9f1186320ab5..5938c64219181d653aeed0ebf8686a0470c045ea 100644 (file)
@@ -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) */
 
index 880cabb2671a1f1f779baf0e61e7f7a9a77bda1f..90814c0fa3f7dd03b13a4fb47a411fd75de0c932 100644 (file)
@@ -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; 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);
     }
 
@@ -1295,7 +1294,7 @@ void CODEC2_WIN32SUPPORT fdmdv_demod(struct FDMDV *fdmdv, int rx_bits[],
     
     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 */
 
@@ -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]));
index e9b355d47c2f2dfc1f422a6e79fa7eb85b39f6da..5957e3d4492984fc158b7a88f5fd13787b2f0f29 100644 (file)
@@ -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,