diff options
author | jcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5> | 2007-04-26 22:51:48 +0000 |
---|---|---|
committer | jcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5> | 2007-04-26 22:51:48 +0000 |
commit | 43819f0f33498239970b4479684f12aa080859e6 (patch) | |
tree | cb48bd98bde120d4b9c9d098414f7a25cf9b41fd /gnuradio-examples/python/digital/benchmark_loopback.py | |
parent | c6baf9d41d452965fe6af642b61b2bb823dcf9ea (diff) |
Merged r4518:5130 from developer branch n4hy/ofdm into trunk, passes distcheck.
Adds incomplete OFDM implementation, further work to be completed in the
features/ofdm branch.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@5131 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-examples/python/digital/benchmark_loopback.py')
-rwxr-xr-x | gnuradio-examples/python/digital/benchmark_loopback.py | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/gnuradio-examples/python/digital/benchmark_loopback.py b/gnuradio-examples/python/digital/benchmark_loopback.py index d036f63aab..2b1e965fad 100755 --- a/gnuradio-examples/python/digital/benchmark_loopback.py +++ b/gnuradio-examples/python/digital/benchmark_loopback.py @@ -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 @@ class my_graph(gr.flow_graph): 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) + + 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) - # Connect components - self.connect(self.txpath, self.throttle, self.channel, self.rxpath) else: # Connect components self.connect(self.txpath, self.throttle, self.rxpath) @@ -106,6 +118,7 @@ def main(): 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 @@ def main(): 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) |