discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] Improvement to OFDM receiver synchronization code (of


From: Kyle Jamieson
Subject: [Discuss-gnuradio] Improvement to OFDM receiver synchronization code (ofdm_sync_pn)
Date: Mon, 21 Jul 2008 12:27:41 -0400
User-agent: Thunderbird 2.0.0.12 (X11/20080226)

Tom, Matt, others hacking on the GNURadio OFDM code:

I believe I've found a performance bug in the ofdm_sync_pn (the default) OFDM synchronization code in the trunk Subversion revision as of today. This bug is present in the unaltered trunk code, but most visible when I increase (at the transmitter) the time between packets to 250 ms (see benchmark_ofdm_tx.py.diff).

The Schmidl & Cox algorithm calculates the correlation between a window of size fft_length/2 received samples and a delayed (by fft_length/2 samples) window of received samples of the same size. Then it normalizes (divides) this by the power of the received samples. The current normalization at ofdm_sync_pn.py:61 averages power over a window of size fft_length/2 samples. This results in a huge spike of length fft_length/2 and amplitude about 100 in the timing metric at the end of the packet when the normalization factor falls but the correlation hasn't yet (see lower plot of trunk_ofdm_sync_before.png at t=2.36e5). As shown in the same plot, the timing metric correctly peaks at the beginning of the packet, with amplitude almost 1.0.

My proposed change is to compute the normalization factor over a window of size fft_length instead of fft_length/2 (see ofdm_sync_pn.py.diff). This results in the signals shown in trunk_ofdm_sync_after.png (attached). Note the only spike in the timing metric now is at the beginning of the packet.

The code wasn't broken before, but I believe it would result in spurious peak detections, which might hurt performance in the face of multiple transmitters and receivers. The issue is harder to see when the transmitter sends continuously, since the normalization factor never has a chance to fall.

Comments/feedback?  Thanks,
Kyle Jamieson
Index: benchmark_ofdm_tx.py
===================================================================
--- benchmark_ofdm_tx.py        (revision 8960)
+++ benchmark_ofdm_tx.py        (working copy)
@@ -205,8 +205,8 @@
         send_pkt(struct.pack('!H', pktno) + (pkt_size - 2) * chr(pktno & 0xff))
         n += pkt_size
         sys.stderr.write('.')
-        if options.discontinuous and pktno % 5 == 1:
-            time.sleep(1)
+        if options.discontinuous:
+            time.sleep(0.25)
         pktno += 1
         
     send_pkt(eof=True)

PNG image

Index: gnuradio-core/src/python/gnuradio/blks2impl/ofdm_sync_pn.py
===================================================================
--- gnuradio-core/src/python/gnuradio/blks2impl/ofdm_sync_pn.py (revision 8960)
+++ gnuradio-core/src/python/gnuradio/blks2impl/ofdm_sync_pn.py (working copy)
@@ -58,7 +58,7 @@
 
         # Create a moving sum filter for the input
         self.inputmag2 = gr.complex_to_mag_squared()
-        movingsum2_taps = [1.0 for i in range(fft_length//2)]
+        movingsum2_taps = [0.5 for i in range(fft_length)]
 
         if 1:
             self.inputmovingsum = gr.fir_filter_fff(1,movingsum2_taps)
@@ -120,4 +120,7 @@
             self.connect(self.pk_detect, gr.file_sink(gr.sizeof_char, 
"ofdm_sync_pn-peaks_b.dat"))
             self.connect(self.sample_and_hold, gr.file_sink(gr.sizeof_float, 
"ofdm_sync_pn-sample_and_hold_f.dat"))
             self.connect(self.input, gr.file_sink(gr.sizeof_gr_complex, 
"ofdm_sync_pn-input_c.dat"))
+            self.connect(self.square, gr.file_sink(gr.sizeof_float, 
"ofdm_sync_pn-normfactor_f.dat"))
+            self.connect(self.c2mag, gr.file_sink(gr.sizeof_float, 
"ofdm_sync_pn-c2mag_f.dat"))
 
+

PNG image


reply via email to

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