summaryrefslogtreecommitdiff
path: root/gnuradio-examples/python/ofdm/benchmark_ofdm_tx.py
diff options
context:
space:
mode:
authortrondeau <trondeau@221aa14e-8319-0410-a670-987f0aec2ac5>2008-01-02 17:35:35 +0000
committertrondeau <trondeau@221aa14e-8319-0410-a670-987f0aec2ac5>2008-01-02 17:35:35 +0000
commitce16514534e5d7ebbc4fe46e2b09a25ccc5fdafd (patch)
tree2d9ae1179cb26f213125accabaea8eb05d63f109 /gnuradio-examples/python/ofdm/benchmark_ofdm_tx.py
parent481636b7be1462dc9f1909ac4700002af63dc8c0 (diff)
Merging ofdm2 branch -r7047:7321 into trunk. This updates the OFDM code to hier_block2 in blks2impl and removed from blksimpl. The new code
implements a decision feedback sync loop to lock the phase/freq, removes two unnecessary premables and performs frame sync and equalization off single preamble symbol. Also adds/updates Python plotting tools and a branchless clip algorithm in gr_math.h. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@7324 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-examples/python/ofdm/benchmark_ofdm_tx.py')
-rwxr-xr-xgnuradio-examples/python/ofdm/benchmark_ofdm_tx.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/gnuradio-examples/python/ofdm/benchmark_ofdm_tx.py b/gnuradio-examples/python/ofdm/benchmark_ofdm_tx.py
index a9d1e00e6c..fb41ab1293 100755
--- a/gnuradio-examples/python/ofdm/benchmark_ofdm_tx.py
+++ b/gnuradio-examples/python/ofdm/benchmark_ofdm_tx.py
@@ -20,7 +20,7 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, blks
+from gnuradio import gr, blks2
from gnuradio import usrp
from gnuradio import eng_notation
from gnuradio.eng_option import eng_option
@@ -33,9 +33,9 @@ from transmit_path import transmit_path
from pick_bitrate import pick_tx_bitrate
import fusb_options
-class usrp_graph(gr.flow_graph):
+class my_top_block(gr.top_block):
def __init__(self, options):
- gr.flow_graph.__init__(self)
+ gr.top_block.__init__(self)
self._tx_freq = options.tx_freq # tranmitter's center frequency
self._tx_subdev_spec = options.tx_subdev_spec # daughterboard to use
@@ -53,10 +53,10 @@ class usrp_graph(gr.flow_graph):
# copy the final answers back into options for use by modulator
#options.bitrate = self._bitrate
- self.txpath = transmit_path(self, options)
+ self.txpath = transmit_path(options)
self.connect(self.txpath, self.u)
-
+
def _setup_usrp_sink(self):
"""
Creates a USRP sink, determines the settings for best bitrate,
@@ -167,7 +167,7 @@ def add_freq_option(parser):
def main():
def send_pkt(payload='', eof=False):
- return fg.txpath.send_pkt(payload, eof)
+ return tb.txpath.send_pkt(payload, eof)
parser = OptionParser(option_class=eng_option, conflict_handler="resolve")
expert_grp = parser.add_option_group("Expert")
@@ -178,23 +178,23 @@ def main():
parser.add_option("","--discontinuous", action="store_true", default=False,
help="enable discontinuous mode")
- usrp_graph.add_options(parser, expert_grp)
+ my_top_block.add_options(parser, expert_grp)
transmit_path.add_options(parser, expert_grp)
- blks.ofdm_mod.add_options(parser, expert_grp)
- blks.ofdm_demod.add_options(parser, expert_grp)
+ blks2.ofdm_mod.add_options(parser, expert_grp)
+ blks2.ofdm_demod.add_options(parser, expert_grp)
fusb_options.add_options(expert_grp)
(options, args) = parser.parse_args ()
# build the graph
- fg = usrp_graph(options)
-
+ tb = my_top_block(options)
+
r = gr.enable_realtime_scheduling()
if r != gr.RT_OK:
print "Warning: failed to enable realtime scheduling"
- fg.start() # start flow graph
-
+ tb.start() # start flow graph
+
# generate and send packets
nbytes = int(1e6 * options.megabytes)
n = 0
@@ -210,7 +210,7 @@ def main():
pktno += 1
send_pkt(eof=True)
- fg.wait() # wait for it to finish
+ tb.wait() # wait for it to finish
if __name__ == '__main__':
try: