[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r4179 - gnuradio/branches/developers/n4hy/ofdm/gnuradi
From: |
n4hy |
Subject: |
[Commit-gnuradio] r4179 - gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm |
Date: |
Wed, 20 Dec 2006 20:12:14 -0700 (MST) |
Author: n4hy
Date: 2006-12-20 20:12:14 -0700 (Wed, 20 Dec 2006)
New Revision: 4179
Modified:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/benchmark_ofdm.py
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/ofdm.py
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/transmit_path_simple.py
Log:
updates to add MTU as an option and improve default settings
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
2006-12-21 02:44:55 UTC (rev 4178)
+++
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/benchmark_ofdm.py
2006-12-21 03:12:14 UTC (rev 4179)
@@ -108,7 +108,7 @@
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=1500,
+ 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]")
@@ -123,6 +123,11 @@
ofdm.ofdm_demod.add_options(parser, expert_grp)
(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 = my_graph(rx_callback, options)
@@ -132,7 +137,7 @@
# print "Warning: failed to enable realtime scheduling"
fg.start() # start flow graph
-
+
# generate and send packets
nbytes = int(1e6 * options.megabytes)
n = 0
Modified:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/ofdm.py
===================================================================
---
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/ofdm.py
2006-12-21 02:44:55 UTC (rev 4178)
+++
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/ofdm.py
2006-12-21 03:12:14 UTC (rev 4179)
@@ -30,6 +30,7 @@
self._occupied_tones = options.occupied_tones
self._fft_length = options.fft_length
self._cp_length = options.cp_length
+ self._mtu = options.mtu
symbol_length = self._fft_length + self._cp_length
@@ -42,7 +43,7 @@
win = [] #[1 for i in range(self._fft_length)]
- self.ofdm = gr.ofdm_bpsk_mapper(1500, self._occupied_tones,
self._fft_length)
+ self.ofdm = gr.ofdm_bpsk_mapper(self._mtu, self._occupied_tones,
self._fft_length)
self.ifft = gr.fft_vcc(self._fft_length, False, win, True)
self.cp_adder = gr.ofdm_cyclic_prefixer(self._fft_length,
symbol_length)
@@ -55,6 +56,9 @@
def samples_per_symbol(self):
return 2
+ def mtu(self):
+ return self._mtu
+
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
@@ -63,6 +67,8 @@
"""
Adds OFDM-specific options to the Options Parser
"""
+ expert.add_option("", "--mtu", type="eng_float", default=1500,
+ 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,
Modified:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/transmit_path_simple.py
===================================================================
---
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/transmit_path_simple.py
2006-12-21 02:44:55 UTC (rev 4178)
+++
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm/transmit_path_simple.py
2006-12-21 03:12:14 UTC (rev 4179)
@@ -46,7 +46,6 @@
self.packet_transmitter = \
blks.mod_ofdm_pkts(fg,
self.ofdm_mod,
- mtu=1500,
access_code=None,
msgq_limit=4,
pad_for_usrp=False)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r4179 - gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm,
n4hy <=