diff options
author | trondeau <trondeau@221aa14e-8319-0410-a670-987f0aec2ac5> | 2007-03-07 04:31:19 +0000 |
---|---|---|
committer | trondeau <trondeau@221aa14e-8319-0410-a670-987f0aec2ac5> | 2007-03-07 04:31:19 +0000 |
commit | 28e086141aead2e43f958f0ae14d58cac557fa2d (patch) | |
tree | 1ae54b3d508506d4ea25c7e8a335c5e2cd56dcef /gnuradio-examples/python/digital/receive_path.py | |
parent | 224434889bf564a4456011180c62a58e0ca55c8f (diff) |
merged trondeau/digital-wip2 r4193:4730 into trunk - improves digital receiver and fixes ticket:72
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@4731 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-examples/python/digital/receive_path.py')
-rw-r--r-- | gnuradio-examples/python/digital/receive_path.py | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/gnuradio-examples/python/digital/receive_path.py b/gnuradio-examples/python/digital/receive_path.py index 9d55c88ddb..03e623f9fd 100644 --- a/gnuradio-examples/python/digital/receive_path.py +++ b/gnuradio-examples/python/digital/receive_path.py @@ -57,7 +57,22 @@ class receive_path(gr.hier_block): # Set up USRP source; also adjusts decim, samples_per_symbol, and bitrate self._setup_usrp_source() - + + g = self.subdev.gain_range() + if options.show_rx_gain_range: + print "Rx Gain Range: minimum = %g, maximum = %g, step size = %g" \ + % (g[0], g[1], g[2]) + + self.set_gain(options.rx_gain) + + self.set_auto_tr(True) # enable Auto Transmit/Receive switching + + # Set RF frequency + ok = self.set_freq(self._rx_freq) + if not ok: + print "Failed to set Rx frequency to %s" % (eng_notation.num_to_str(self._rx_freq)) + raise ValueError, eng_notation.num_to_str(self._rx_freq) + # copy the final answers back into options for use by demodulator options.samples_per_symbol = self._samples_per_symbol options.bitrate = self._bitrate @@ -71,7 +86,7 @@ class receive_path(gr.hier_block): chan_coeffs = gr.firdes.low_pass (1.0, # gain sw_decim * self._samples_per_symbol, # sampling rate 1.0, # midpoint of trans. band - 0.1, # width of trans. band + 0.5, # width of trans. band gr.firdes.WIN_HANN) # filter type # Decimating channel filter @@ -86,21 +101,7 @@ class receive_path(gr.hier_block): access_code=None, callback=self._rx_callback, threshold=-1) - - ok = self.set_freq(self._rx_freq) - if not ok: - print "Failed to set Rx frequency to %s" % (eng_notation.num_to_str(self._rx_freq)) - raise ValueError, eng_notation.num_to_str(self._rx_freq) - g = self.subdev.gain_range() - if options.show_rx_gain_range: - print "Rx Gain Range: minimum = %g, maximum = %g, step size = %g" \ - % (g[0], g[1], g[2]) - - self.set_gain(options.rx_gain) - - self.set_auto_tr(True) # enable Auto Transmit/Receive switching - # Carrier Sensing Blocks alpha = 0.001 thresh = 30 # in dB, will have to adjust @@ -228,6 +229,7 @@ class receive_path(gr.hier_block): """ Prints information about the receive path """ + print "\nReceive Path:" print "Using RX d'board %s" % (self.subdev.side_and_name(),) print "Rx gain: %g" % (self.gain,) print "modulation: %s" % (self._demod_class.__name__) |