commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r4535 - gnuradio/branches/developers/n4hy/ofdm/gnuradi


From: trondeau
Subject: [Commit-gnuradio] r4535 - gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm
Date: Tue, 20 Feb 2007 09:58:17 -0700 (MST)

Author: trondeau
Date: 2007-02-20 09:58:17 -0700 (Tue, 20 Feb 2007)
New Revision: 4535

Modified:
   
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/benchmark_ofdm.py
   
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/benchmark_ofdm_rx.py
   gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/ofdm.py
   
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/ofdm_receiver.py
   
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/receive_path.py
Log:
work in progress

Modified: 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/benchmark_ofdm.py
===================================================================
--- 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/benchmark_ofdm.py
      2007-02-20 16:57:57 UTC (rev 4534)
+++ 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/benchmark_ofdm.py
      2007-02-20 16:58:17 UTC (rev 4535)
@@ -94,9 +94,10 @@
     def rx_callback(ok, payload):
         global n_rcvd, n_right
         n_rcvd += 1
+        (pktno,) = struct.unpack('!H', payload[0:2])
         if ok:
             n_right += 1
-        print "ok: %r \t n_rcvd: %d \t n_right: %d" % (ok, n_rcvd, n_right)
+        print "ok: %r \t pktno: %d \t n_rcvd: %d \t n_right: %d" % (ok, pktno, 
n_rcvd, n_right)
                 
     parser = OptionParser(option_class=eng_option, conflict_handler="resolve")
     expert_grp = parser.add_option_group("Expert")

Modified: 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/benchmark_ofdm_rx.py
===================================================================
--- 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/benchmark_ofdm_rx.py
   2007-02-20 16:57:57 UTC (rev 4534)
+++ 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/benchmark_ofdm_rx.py
   2007-02-20 16:58:17 UTC (rev 4535)
@@ -170,16 +170,13 @@
     def rx_callback(ok, payload):
         global n_rcvd, n_right
         n_rcvd += 1
+        (pktno,) = struct.unpack('!H', payload[0:2])
         if ok:
             n_right += 1
-        print "ok: %r \t n_rcvd: %d \t n_right: %d" % (ok, n_rcvd, n_right)
+        print "ok: %r \t pktno: %d \t n_rcvd: %d \t n_right: %d" % (ok, pktno, 
n_rcvd, n_right)
 
     parser = OptionParser(option_class=eng_option, conflict_handler="resolve")
     expert_grp = parser.add_option_group("Expert")
-    parser.add_option("-s", "--size", type="eng_float", default=1450,
-                      help="set packet size [default=%default]")
-    parser.add_option("-M", "--megabytes", type="eng_float", default=1.0,
-                      help="set megabytes to transmit [default=%default]")
     parser.add_option("-r", "--sample-rate", type="eng_float", default=1e5,
                       help="set sample rate to RATE (%default)") 
 
@@ -190,11 +187,6 @@
 
     (options, args) = parser.parse_args ()
 
-    if(options.mtu < options.size):
-        sys.stderr.write("MTU (%.0f) must be larger than the packet size 
(%.0f)\n"
-                         % (options.mtu, options.size))
-        sys.exit(1)
-
     # build the graph
     fg = usrp_graph(rx_callback, options)
 

Modified: 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/ofdm.py
===================================================================
--- 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/ofdm.py    
    2007-02-20 16:57:57 UTC (rev 4534)
+++ 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/ofdm.py    
    2007-02-20 16:58:17 UTC (rev 4535)
@@ -71,9 +71,9 @@
                           help="set maximum transmit unit [default=%default]")
         expert.add_option("", "--fft-length", type="intx", default=512,
                           help="set the number of FFT bins [default=%default]")
-        expert.add_option("", "--occupied-tones", type="intx", default=480,
+        expert.add_option("", "--occupied-tones", type="intx", default=200,
                           help="set the number of occupied FFT bins 
[default=%default]")
-        expert.add_option("", "--cp-length", type="intx", default=32,
+        expert.add_option("", "--cp-length", type="intx", default=128,
                           help="set the number of bits in the cyclic prefix 
[default=%default]")
     # Make a static method to call before instantiation
     add_options = staticmethod(add_options)
@@ -104,15 +104,15 @@
         self.ofdm_sync = ofdm_receiver(self.fg, self._fft_length, 
symbol_length, self._snr)
         
         # OFDM Demod
-        self.fftdemod = gr.fft_vcc(self._fft_length, True, win, True)
+        self.fft_demod = gr.fft_vcc(self._fft_length, True, win, True)
         self.ofdm_demod = gr.ofdm_bpsk_demapper(self._occupied_tones, 
self._fft_length)
 
         if options.verbose:
             self._print_verbage()
 
-        self.fg.connect(self.ofdm_sync, self.fftdemod, self.ofdm_demod)
+        self.fg.connect(self.ofdm_sync, self.fft_demod, self.ofdm_demod)
         gr.hier_block.__init__(self, self.fg, self.ofdm_sync, self.ofdm_demod)
-
+        
     def bits_per_symbol(self=None):   # staticmethod that's also callable on 
an instance
         return 1
     bits_per_symbol = staticmethod(bits_per_symbol)      # make it a static 
method.  RTFM
@@ -123,9 +123,9 @@
         """
         expert.add_option("", "--fft-length", type="intx", default=512,
                           help="set the number of FFT bins [default=%default]")
-        expert.add_option("", "--occupied-tones", type="intx", default=480,
+        expert.add_option("", "--occupied-tones", type="intx", default=200,
                           help="set the number of occupied FFT bins 
[default=%default]")
-        expert.add_option("", "--cp-length", type="intx", default=32,
+        expert.add_option("", "--cp-length", type="intx", default=128,
                           help="set the number of bits in the cyclic prefix 
[default=%default]")
     # Make a static method to call before instantiation
     add_options = staticmethod(add_options)

Modified: 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/ofdm_receiver.py
===================================================================
--- 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/ofdm_receiver.py
       2007-02-20 16:57:57 UTC (rev 4534)
+++ 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/ofdm_receiver.py
       2007-02-20 16:58:17 UTC (rev 4535)
@@ -97,6 +97,8 @@
         self.fg.connect(self.diff, self.f2c1,(self.sampler,1))
         self.fg.connect(self.angle, self.f2c2,(self.sampler,2))
 
-        self.fg.connect(self.diff, gr.file_sink(gr.sizeof_float, "theta.out"))
-
+        if 0:
+            self.fg.connect(self.diff, gr.file_sink(gr.sizeof_float, 
"ofdmrx_theta_f.dat"))
+            self.fg.connect(self.angle, gr.file_sink(gr.sizeof_float, 
"ofdmrx_epsilon_f.dat"))
+            
         gr.hier_block.__init__(self, fg, self.input, self.sampler)

Modified: 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/receive_path.py
===================================================================
--- 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/receive_path.py
        2007-02-20 16:57:57 UTC (rev 4534)
+++ 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/receive_path.py
        2007-02-20 16:58:17 UTC (rev 4535)
@@ -44,6 +44,7 @@
         self._rx_callback = rx_callback      # this callback is fired when 
there's a packet available
 
         if 0:
+            
             chan_coeffs = gr.firdes.low_pass (1.0,                  # gain
                                               2.0,                  # sampling 
rate
                                               bw,                   # midpoint 
of trans. band
@@ -74,6 +75,7 @@
             self._print_verbage()
         
         fg.connect(self.chan_filt, self.packet_receiver)
+        #fg.connect(self.chan_filt, gr.file_sink(gr.sizeof_gr_complex, 
"ofdmrx_chflt.dat"))
         gr.hier_block.__init__(self, fg, self.chan_filt, None)
 
     def carrier_sensed(self):





reply via email to

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