commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r5705 - gnuradio/branches/features/ofdm/sync/gnuradio-


From: trondeau
Subject: [Commit-gnuradio] r5705 - gnuradio/branches/features/ofdm/sync/gnuradio-core/src/python/gnuradio/blksimpl
Date: Tue, 5 Jun 2007 22:40:14 -0600 (MDT)

Author: trondeau
Date: 2007-06-05 22:40:14 -0600 (Tue, 05 Jun 2007)
New Revision: 5705

Modified:
   
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/python/gnuradio/blksimpl/ofdm_pkt.py
Log:
moving towards new preamble definition; working, but not finished

Modified: 
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/python/gnuradio/blksimpl/ofdm_pkt.py
===================================================================
--- 
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/python/gnuradio/blksimpl/ofdm_pkt.py
 2007-06-06 04:39:25 UTC (rev 5704)
+++ 
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/python/gnuradio/blksimpl/ofdm_pkt.py
 2007-06-06 04:40:14 UTC (rev 5705)
@@ -58,28 +58,32 @@
 
         win = [] #[1 for i in range(self._fft_length)]
 
-        # doubled-up known symbol for correlation in time domain
-        ksfreq = 2*known_symbols_4512_3[0:options.occupied_tones/2]
-        kstime = fft.fftshift((fft.fft(ksfreq)))
-        kstime = kstime.tolist()
-        kstime_scaled = [i / math.sqrt(len(kstime)) for i in kstime]
+        preamble0 = options.occupied_tones*[0,]
+        for i in range(options.occupied_tones//2):
+            preamble0[i*2] = known_symbols_4512_3[i] 
 
+        f = open("tx_preamble_freq.txt", "w")
+        print >> f, preamble0
+        
         # hard-coded known symbols
         if 1:
-            ks = (kstime_scaled,
-                  known_symbols_4512_1[0:options.occupied_tones],
-                  known_symbols_4512_2[0:options.occupied_tones])
-        else:
-            ks = (known_symbols_4512_3[0:options.occupied_tones],
-                  known_symbols_4512_1[0:options.occupied_tones],
-                  known_symbols_4512_2[0:options.occupied_tones])
-                  
+            preambles = (preamble0,
+                         known_symbols_4512_1[0:options.occupied_tones],
+                         known_symbols_4512_2[0:options.occupied_tones])
+
+        if 0:
+            unoccupied_tones = options.fft_length - options.occupied_tones
+            unocc_2 = unoccupied_tones // 2
+            padded_preambles = len(preambles)*[options.fft_length*[0,]]
+            for padded,pre in zip(padded_preambles, preambles):
+                padded[unocc_2:options.fft_length - unocc_2] = pre        
+            
         symbol_length = options.fft_length + options.cp_length
 
         # accepts messages from the outside world
         self._pkt_input = gr.ofdm_bpsk_mapper(msgq_limit,
                                               options.occupied_tones, 
options.fft_length,
-                                              ks)
+                                              preambles)
         self.ifft = gr.fft_vcc(options.fft_length, False, win, True)
         self.cp_adder = gr.ofdm_cyclic_prefixer(options.fft_length, 
symbol_length)
         self.scale = gr.multiply_const_cc(1.0 / math.sqrt(options.fft_length))
@@ -168,40 +172,27 @@
         self._rcvd_pktq = gr.msg_queue()          # holds packets from the PHY
 
         # doubled-up known symbol for correlation in time domain
-        ksfreq = 2*known_symbols_4512_3[0:options.occupied_tones/2]
-        kstime = fft.fft(ksfreq)
-        kstime = kstime.tolist()
-
-        unoccupied_tones = options.fft_length - options.occupied_tones
-        ks0 = (unoccupied_tones//2)*[0.0,]
-        ks0.extend(kstime)
-        ks0.extend((unoccupied_tones//2)*[0.0,])
+        preamble0 = options.fft_length*[0,]
+        unocc_2 = (options.fft_length - options.occupied_tones) // 2
+        for i in range(options.occupied_tones//2):
+            preamble0[unocc_2 + i*2] = known_symbols_4512_3[i] 
         
-        ks0time = fft.ifft(ks0)
-        ks0time = ks0time.tolist()
+        preamble0_time = (fft.ifft(preamble0))
+        preamble0_time = preamble0_time.tolist()
+        preamble0_time_scaled = [p * math.sqrt(options.fft_length) for p in 
preamble0_time]
 
-        f1 = open("ksfreq", 'w')
-        f2 = open("kstime", 'w')
-        f3 = open("ks0", 'w')
-        f4 = open("ks0time", 'w')
-        print >> f1, ksfreq
-        print >> f2, kstime
-        print >> f3, ks0
-        print >> f4, ks0time
-        
-        # hard-coded known symbol
+        f = open("rx_preamble_time.txt", "w")
+        print >> f, preamble0_time_scaled
+
+        # hard-coded known symbols
         if 1:
-            ks = (ks0time,
-                  known_symbols_4512_1[0:options.occupied_tones],
-                  known_symbols_4512_2[0:options.occupied_tones])
-        else:
-            ks = (known_symbols_4512_3[0:options.occupied_tones],
-                  known_symbols_4512_1[0:options.occupied_tones],
-                  known_symbols_4512_2[0:options.occupied_tones])
+            preambles = (preamble0_time_scaled,
+                         known_symbols_4512_1[0:options.occupied_tones],
+                         known_symbols_4512_2[0:options.occupied_tones])
         
         symbol_length = options.fft_length + options.cp_length
         self.ofdm_recv = ofdm_receiver(fg, options.fft_length, 
options.cp_length,
-                                       options.occupied_tones, options.snr, ks)
+                                       options.occupied_tones, options.snr, 
preambles)
         self.ofdm_demod = gr.ofdm_frame_sink(self._rcvd_pktq,
                                              options.occupied_tones)
         





reply via email to

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