diff options
author | Tom | 2010-02-01 19:21:54 -0500 |
---|---|---|
committer | Tom | 2010-02-01 19:21:54 -0500 |
commit | 4640708a2cb9740c41f0e27a6ce865a85473a4a0 (patch) | |
tree | f95c41a7c24ef25c5be1b23893f06de5cb14818b /gnuradio-examples/python/digital/usrp_transmit_path.py | |
parent | 824aa242f143a088f04031840bc36ed54de74005 (diff) | |
parent | 3bac2fa547168ca52352892e5f9db3335724682e (diff) | |
download | gnuradio-4640708a2cb9740c41f0e27a6ce865a85473a4a0.tar.gz gnuradio-4640708a2cb9740c41f0e27a6ce865a85473a4a0.tar.bz2 gnuradio-4640708a2cb9740c41f0e27a6ce865a85473a4a0.zip |
Merge branch 'fll'
Diffstat (limited to 'gnuradio-examples/python/digital/usrp_transmit_path.py')
-rw-r--r-- | gnuradio-examples/python/digital/usrp_transmit_path.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/gnuradio-examples/python/digital/usrp_transmit_path.py b/gnuradio-examples/python/digital/usrp_transmit_path.py index ad9f741a6..ee63dcd2b 100644 --- a/gnuradio-examples/python/digital/usrp_transmit_path.py +++ b/gnuradio-examples/python/digital/usrp_transmit_path.py @@ -62,12 +62,18 @@ class usrp_transmit_path(gr.hier_block2): for attr in dir(tx_path): #forward the methods if not attr.startswith('_') and not hasattr(self, attr): setattr(self, attr, getattr(tx_path, attr)) + #setup usrp self._modulator_class = modulator_class self._setup_usrp_sink(options) - #connect - self.connect(tx_path, self.u) + # Set up resampler based on rate determined by _setup_usrp_sink + rs_taps = gr.firdes.low_pass_2(32, 32, 0.45, 0.1, 60) + self.resampler = gr.pfb_arb_resampler_ccf(self.rs_rate, rs_taps) + + #connect + self.connect(tx_path, self.resampler, self.u) + def _setup_usrp_sink(self, options): """ Creates a USRP sink, determines the settings for best bitrate, @@ -75,6 +81,7 @@ class usrp_transmit_path(gr.hier_block2): """ self.u = usrp_options.create_usrp_sink(options) dac_rate = self.u.dac_rate() + self.rs_rate = options.bitrate # Store requested bit rate if options.verbose: print 'USRP Sink:', self.u (self._bitrate, self._samples_per_symbol, self._interp) = \ @@ -82,6 +89,10 @@ class usrp_transmit_path(gr.hier_block2): options.samples_per_symbol, options.interp, dac_rate, \ self.u.get_interp_rates()) + # Calculate resampler rate based on requested and actual rates + self.rs_rate = self._bitrate / self.rs_rate + print "Resampling by %f to get bitrate of %ssps" % (self.rs_rate, eng_notation.num_to_str(self._bitrate/self.rs_rate)) + self.u.set_interp(self._interp) self.u.set_auto_tr(True) |