commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r7319 - gnuradio/branches/developers/trondeau/ofdm2/gn


From: trondeau
Subject: [Commit-gnuradio] r7319 - gnuradio/branches/developers/trondeau/ofdm2/gnuradio-core/src/lib/general
Date: Tue, 1 Jan 2008 12:27:55 -0700 (MST)

Author: trondeau
Date: 2008-01-01 12:27:54 -0700 (Tue, 01 Jan 2008)
New Revision: 7319

Modified:
   
gnuradio/branches/developers/trondeau/ofdm2/gnuradio-core/src/lib/general/gr_ofdm_frame_acquisition.cc
Log:
Fixes integer frequency problem. Simple matter of resetting the phase count. 
Also adjusts debugging output.

Modified: 
gnuradio/branches/developers/trondeau/ofdm2/gnuradio-core/src/lib/general/gr_ofdm_frame_acquisition.cc
===================================================================
--- 
gnuradio/branches/developers/trondeau/ofdm2/gnuradio-core/src/lib/general/gr_ofdm_frame_acquisition.cc
      2008-01-01 14:04:26 UTC (rev 7318)
+++ 
gnuradio/branches/developers/trondeau/ofdm2/gnuradio-core/src/lib/general/gr_ofdm_frame_acquisition.cc
      2008-01-01 19:27:54 UTC (rev 7319)
@@ -118,7 +118,6 @@
   for(i = 0; i < d_fft_length - d_occupied_carriers; i++) {
     sum = 0;
     for(j = 0; j < d_occupied_carriers; j++) {
-      //sum += fabs(d_known_phase_diff[j] * d_symbol_phase_diff[i+j]);
       sum += (d_known_phase_diff[j] * d_symbol_phase_diff[i+j]);
     }
     if(fabs(sum) > max) {
@@ -127,18 +126,14 @@
     }
   }
 
-  printf("Corr: %.4f\n", max);
   d_coarse_freq = index - zeros_on_left;
 
-  if(0) {
+  if(VERBOSE) {
     fprintf(stderr, "Coarse Freq Offset: %d\n", d_coarse_freq);
-    fprintf(stderr, "Known:  ");
-    for(i = 0; i < 18; i++) 
-      fprintf(stderr, "%+.4f ", d_known_phase_diff[i]);
-    fprintf(stderr, "\nSymbol: ");
-    for(i = 0; i < 18; i++)
-      fprintf(stderr, "%+.4f ", 
d_symbol_phase_diff[zeros_on_left+d_coarse_freq+i]);
-    fprintf(stderr, "\n");
+    for(i = 0; i < 40; i++) {
+      fprintf(stderr, "%+.4f   %+.4f\n", d_known_phase_diff[i], 
+             d_symbol_phase_diff[zeros_on_left+d_coarse_freq+i]);
+    }
   }
 
   return true;  //FIXME: don't need ot return anything now
@@ -158,7 +153,7 @@
   // FIXME: is this the best way to set this?
   for(i = 2; i < d_occupied_carriers; i+=2) {
     d_hestimate[i] = d_known_symbol[i] / 
-      
(coarse_freq_comp(d_coarse_freq,1)*symbol[i+zeros_on_left+d_coarse_freq]);
+      
(coarse_freq_comp(d_coarse_freq,1)*(symbol[i+zeros_on_left+d_coarse_freq]));
     d_hestimate[i-1] = (d_hestimate[i] + d_hestimate[i-2]) / gr_complex(2.0, 
0.0);    
   }
 
@@ -167,9 +162,16 @@
     d_hestimate[d_occupied_carriers-1] = d_hestimate[d_occupied_carriers-2];
   }
 
-  if(0) {
+  if(VERBOSE) {
+    fprintf(stderr, "Equalizer setting:\n");
     for(i = 0; i < d_occupied_carriers; i++) {
-      fprintf(stderr, "%+.4f + j%+.4f    ", d_hestimate[i].real(), 
d_hestimate[i].imag());
+      gr_complex sym = 
coarse_freq_comp(d_coarse_freq,1)*symbol[i+zeros_on_left+d_coarse_freq];
+      gr_complex output = sym * d_hestimate[i];
+      fprintf(stderr, "sym: %+.4f + j%+.4f  ks: %+.4f + j%+.4f  eq: %+.4f + 
j%+.4f  ==>  %+.4f + j%+.4f\n", 
+             sym .real(), sym.imag(),
+             d_known_symbol[i].real(), d_known_symbol[i].imag(),
+             d_hestimate[i].real(), d_hestimate[i].imag(),
+             output.real(), output.imag());
     }
     fprintf(stderr, "\n");
   }
@@ -196,6 +198,7 @@
   }
 
   if(found) {
+    d_phase_count = 1;
     correlate(symbol, zeros_on_left);
     calculate_equalizer(symbol, zeros_on_left);
     sig[0] = 1;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]