diff options
Diffstat (limited to 'gr-digital/examples/ofdm/receive_path.py')
-rw-r--r-- | gr-digital/examples/ofdm/receive_path.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/gr-digital/examples/ofdm/receive_path.py b/gr-digital/examples/ofdm/receive_path.py index 90b572a08f..e46056c245 100644 --- a/gr-digital/examples/ofdm/receive_path.py +++ b/gr-digital/examples/ofdm/receive_path.py @@ -19,6 +19,7 @@ import sys # receive path # ///////////////////////////////////////////////////////////////////////////// + class receive_path(gr.hier_block2): def __init__(self, rx_callback, options): @@ -26,12 +27,13 @@ class receive_path(gr.hier_block2): gr.io_signature(1, 1, gr.sizeof_gr_complex), gr.io_signature(0, 0, 0)) + # make a copy so we can destructively modify + options = copy.copy(options) - options = copy.copy(options) # make a copy so we can destructively modify - - self._verbose = options.verbose - self._log = options.log - self._rx_callback = rx_callback # this callback is fired when there's a packet available + self._verbose = options.verbose + self._log = options.log + # this callback is fired when there's a packet available + self._rx_callback = rx_callback # receiver self.ofdm_rx = digital.ofdm_demod(options, @@ -40,7 +42,7 @@ class receive_path(gr.hier_block2): # Carrier Sensing Blocks alpha = 0.001 thresh = 30 # in dB, will have to adjust - self.probe = analog.probe_avg_mag_sqrd_c(thresh,alpha) + self.probe = analog.probe_avg_mag_sqrd_c(thresh, alpha) self.connect(self, self.ofdm_rx) self.connect(self.ofdm_rx, self.probe) @@ -53,7 +55,7 @@ class receive_path(gr.hier_block2): """ Return True if we think carrier is present. """ - #return self.probe.level() > X + # return self.probe.level() > X return self.probe.unmuted() def carrier_threshold(self): @@ -79,7 +81,8 @@ class receive_path(gr.hier_block2): normal.add_option("-W", "--bandwidth", type="eng_float", default=500e3, help="set symbol bandwidth [default=%default]") - normal.add_option("-v", "--verbose", action="store_true", default=False) + normal.add_option("-v", "--verbose", + action="store_true", default=False) expert.add_option("", "--log", action="store_true", default=False, help="Log all parts of flow graph to files (CAUTION: lots of data)") |