commit-gnuradio
[Top][All Lists]
Advanced

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

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


From: trondeau
Subject: [Commit-gnuradio] r5124 - gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/digital
Date: Thu, 26 Apr 2007 13:03:10 -0600 (MDT)

Author: trondeau
Date: 2007-04-26 13:03:10 -0600 (Thu, 26 Apr 2007)
New Revision: 5124

Modified:
   
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/digital/benchmark_loopback.py
Log:
added use of MUX to give discontinuous behavior to loopback code; current 
hardcoded value produces about 1 second delay every 5 packets

Modified: 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/digital/benchmark_loopback.py
===================================================================
--- 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/digital/benchmark_loopback.py
       2007-04-26 19:02:01 UTC (rev 5123)
+++ 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/digital/benchmark_loopback.py
       2007-04-26 19:03:10 UTC (rev 5124)
@@ -1,7 +1,6 @@
 #!/usr/bin/env python
-#!/usr/bin/env python
 #
-# Copyright 2005, 2006 Free Software Foundation, Inc.
+# Copyright 2005, 2006, 2007 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -77,10 +76,23 @@
         self.rxpath = receive_path(self, demod_class, rx_callback, options)
 
         if channelon:
-            self.channel = awgn_channel(self, options.sample_rate, 
noise_voltage, frequency_offset, options.seed)
+            self.channel = awgn_channel(self, options.sample_rate, 
noise_voltage,
+                                        frequency_offset, options.seed)
 
-            # Connect components
-            self.connect(self.txpath, self.throttle, self.channel, self.rxpath)
+            if options.discontinuous:
+                z = 20000*[0,]
+                self.zeros = gr.vector_source_c(z, True)
+                packet_size = 5*((4+8+4+1500+4) * 8)
+                self.mux = gr.stream_mux(gr.sizeof_gr_complex, [packet_size-0, 
int(9e5)])
+
+                # Connect components
+                self.connect(self.txpath, (self.mux,0))
+                self.connect(self.zeros, (self.mux,1))
+                self.connect(self.mux, self.channel, self.rxpath)
+
+            else:
+                self.connect(self.txpath, self.channel, self.rxpath)
+
         else:
             # Connect components
             self.connect(self.txpath, self.throttle, self.rxpath)
@@ -106,6 +118,7 @@
 
         print "ok = %5s  pktno = %4d  n_rcvd = %4d  n_right = %4d" % (
             ok, pktno, n_rcvd, n_right)
+        # print payload[2:len(payload)]
 
     def send_pkt(payload='', eof=False):
         return fg.txpath.send_pkt(payload, eof)
@@ -170,8 +183,6 @@
     while n < nbytes:
         send_pkt(struct.pack('!H', pktno) + (pkt_size - 2) * chr(pktno & 0xff))
         n += pkt_size
-        if options.discontinuous and pktno % 5 == 4:
-            time.sleep(1)
         pktno += 1
         
     send_pkt(eof=True)





reply via email to

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