summaryrefslogtreecommitdiff
path: root/gnuradio-examples/python/digital
diff options
context:
space:
mode:
authorjcorgan2007-05-12 23:50:46 +0000
committerjcorgan2007-05-12 23:50:46 +0000
commitc95b26a7d8f04140d2371c075016c39c45b92580 (patch)
treee125c5bc08f816ab01cf4fe078e2c07f8de0890c /gnuradio-examples/python/digital
parentbbc84f59726f2aab25a9647c734208adf744e6d3 (diff)
downloadgnuradio-c95b26a7d8f04140d2371c075016c39c45b92580.tar.gz
gnuradio-c95b26a7d8f04140d2371c075016c39c45b92580.tar.bz2
gnuradio-c95b26a7d8f04140d2371c075016c39c45b92580.zip
Added ability to log receive path power to file in digital examples.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@5461 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-examples/python/digital')
-rw-r--r--gnuradio-examples/python/digital/receive_path.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/gnuradio-examples/python/digital/receive_path.py b/gnuradio-examples/python/digital/receive_path.py
index 03e623f9f..06a63095d 100644
--- a/gnuradio-examples/python/digital/receive_path.py
+++ b/gnuradio-examples/python/digital/receive_path.py
@@ -105,8 +105,14 @@ class receive_path(gr.hier_block):
# Carrier Sensing Blocks
alpha = 0.001
thresh = 30 # in dB, will have to adjust
- self.probe = gr.probe_avg_mag_sqrd_c(thresh,alpha)
- fg.connect(self.chan_filt, self.probe)
+
+ if options.log_rx_power == True:
+ self.probe = gr.probe_avg_mag_sqrd_cf(thresh,alpha)
+ self.power_sink = gr.file_sink(gr.sizeof_float, "rxpower.dat")
+ fg.connect(self.chan_filt, self.probe, self.power_sink)
+ else:
+ self.probe = gr.probe_avg_mag_sqrd_c(thresh,alpha)
+ fg.connect(self.chan_filt, self.probe)
# Display some information about the setup
if self._verbose:
@@ -220,6 +226,8 @@ class receive_path(gr.hier_block):
help="set fpga decimation rate to DECIM [default=%default]")
expert.add_option("", "--log", action="store_true", default=False,
help="Log all parts of flow graph to files (CAUTION: lots of data)")
+ expert.add_option("", "--log-rx-power", action="store_true", default=False,
+ help="Log receive signal power to file (CAUTION: lots of data)")
# Make a static method to call before instantiation
add_options = staticmethod(add_options)
@@ -238,7 +246,7 @@ class receive_path(gr.hier_block):
print "decim: %3d" % (self._decim)
print "Rx Frequency: %s" % (eng_notation.num_to_str(self._rx_freq))
# print "Rx Frequency: %f" % (self._rx_freq)
-
+
def add_freq_option(parser):
"""
Hackery that has the -f / --freq option set both tx_freq and rx_freq