[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r7316 - gnuradio/branches/developers/trondeau/ofdm2/gn
From: |
trondeau |
Subject: |
[Commit-gnuradio] r7316 - gnuradio/branches/developers/trondeau/ofdm2/gnuradio-core/src/lib/general |
Date: |
Tue, 1 Jan 2008 06:58:19 -0700 (MST) |
Author: trondeau
Date: 2008-01-01 06:58:14 -0700 (Tue, 01 Jan 2008)
New Revision: 7316
Modified:
gnuradio/branches/developers/trondeau/ofdm2/gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc
Log:
Adds reset of equalizer taps along with PLL settings. Moves the demapper
function inside the state machine after sync; otherwsie, the equalizer settings
in the frame acquisition off the preamble get screwed up by the PLL.
Modified:
gnuradio/branches/developers/trondeau/ofdm2/gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc
===================================================================
---
gnuradio/branches/developers/trondeau/ofdm2/gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc
2008-01-01 13:46:57 UTC (rev 7315)
+++
gnuradio/branches/developers/trondeau/ofdm2/gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc
2008-01-01 13:58:14 UTC (rev 7316)
@@ -59,6 +59,11 @@
d_header = 0;
d_headerbytelen_cnt = 0;
+
+ // Resetting PLL
+ d_freq = 0.0;
+ d_phase = 0.0;
+ fill(d_dfe.begin(), d_dfe.end(), gr_complex(1.0,0.0));
}
inline void
@@ -117,18 +122,9 @@
gr_complex sigrot = in[i]*carrier*d_dfe[i];
if(d_derotated_output != NULL){
- //*d_derotated_output = sigrot;
d_derotated_output[i] = sigrot;
-
- if (VERBOSE)
- fprintf(stderr, "Sigrot: %.4f + j%.4f => output: %.4f + j%.4f\n",
- sigrot.real(), sigrot.imag(), (*d_derotated_output).real(),
(*d_derotated_output).imag());
-
- //d_derotated_output++;
}
- //fprintf(stderr, "%f+j%f = %d\n", sigrot.real(), sigrot.imag(),
slicer(in[i]));
- //unsigned char bits = slicer(in[i++]);
unsigned char bits = slicer(sigrot);
gr_complex closest_sym = d_sym_position[bits];
@@ -136,9 +132,8 @@
accum_error += sigrot * conj(closest_sym);
// FIX THE FOLLOWING STATEMENT
-
if (norm(sigrot)> 0.001) d_dfe[i] +=
d_eq_gain*(closest_sym/sigrot-d_dfe[i]);
-
+
i++;
if((8 - d_byte_offset) >= d_nbits) {
@@ -172,8 +167,8 @@
if (d_phase >= 2*M_PI) d_phase -= 2*M_PI;
if (d_phase <0) d_phase += 2*M_PI;
- if(VERBOSE)
- std::cerr << angle << "\t" << d_freq << "\t" << d_phase << "\t" <<
std::endl;
+ //if(VERBOSE)
+ // std::cerr << angle << "\t" << d_freq << "\t" << d_phase << "\t" <<
std::endl;
return bytes_produced;
}
@@ -205,7 +200,7 @@
{
d_bytes_out = new unsigned char[d_occupied_carriers];
d_dfe.resize(occupied_carriers);
- for(unsigned int i=0;i<occupied_carriers;i++) d_dfe[i]=1.0;
+ fill(d_dfe.begin(), d_dfe.end(), gr_complex(1.0,0.0));
set_sym_value_out(sym_position, sym_value_out);
@@ -254,15 +249,6 @@
if (VERBOSE)
fprintf(stderr,">>> Entering state machine\n");
- if(sig[0]) {
- if (VERBOSE)
- fprintf(stderr,"Flag Signal Triggered, reseting PLL\n");
- d_freq = 0.0;
- d_phase = 0.0;
- }
-
- bytes = demapper(&in[0], d_bytes_out);
-
switch(d_state) {
case STATE_SYNC_SEARCH: // Look for flag indicating beginning of pkt
@@ -275,6 +261,10 @@
break;
case STATE_HAVE_SYNC:
+ // only demod after getting the preamble signal; otherwise, the
+ // equalizer taps will screw with the PLL performance
+ bytes = demapper(&in[0], d_bytes_out);
+
if (VERBOSE) {
if(sig[0])
printf("ERROR -- Found SYNC in HAVE_SYNC\n");
@@ -321,6 +311,8 @@
break;
case STATE_HAVE_HEADER:
+ bytes = demapper(&in[0], d_bytes_out);
+
if (VERBOSE) {
if(sig[0])
printf("ERROR -- Found SYNC in HAVE_HEADER at %d, length of %d\n",
d_packetlen_cnt, d_packetlen);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r7316 - gnuradio/branches/developers/trondeau/ofdm2/gnuradio-core/src/lib/general,
trondeau <=