diff options
author | Josh Morman <jmorman@gnuradio.org> | 2021-11-24 12:25:09 -0500 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2021-11-24 14:41:53 -0500 |
commit | 3cecf9268b15bb0e9e2fedaeb2528bd3038beee6 (patch) | |
tree | ba0bb14fa03664b4e69e0dcb944b96ae298264d8 /gr-digital/examples/ofdm/receive_path.py | |
parent | 310b7f0cc25edf90c0bc6754031d763119b0ae97 (diff) |
digital: pep8 formatting
Signed-off-by: Josh Morman <jmorman@gnuradio.org>
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)") |