def _setup_usrp_sink(self, options):
        """
        Creates a USRP sink, determines the settings for best bitrate,
        and attaches to the transmitter's subdevice.
        """
        self.u = usrp_options.create_usrp_sink(options)
        dac_rate = self.u.dac_rate()
        self.rs_rate = options.bitrate  # Store requested bit rate

        (self._bitrate, self._samples_per_symbol, self._interp) = \
                        pick_tx_bitrate(options.bitrate, self._modulator_class.bits_per_symbol(),
                                        options.samples_per_symbol, options.interp,
                                        dac_rate, self.u.get_interp_rates())

        options.interp = self._interp
        options.samples_per_symbol = self._samples_per_symbol
        options.bitrate = self._bitrate

        if options.verbose:
            print 'USRP Sink:', self.u
            print "Interpolation Rate: ", self._interp

        self.u.set_interp(self._interp)
        self.u.set_auto_tr(True)

        if not self.u.set_center_freq(options.tx_freq):
            print "Failed to set Rx frequency to %s" % (
                eng_notation.num_to_str(options.tx_freq))
            raise ValueError, eng_notation.num_to_str(options.tx_freq)
Exemple #2
0
    def _setup_usrp_sink(self, options):
        """
        Creates a USRP sink, determines the settings for best bitrate,
        and attaches to the transmitter's subdevice.
        """
        self.u = usrp_options.create_usrp_sink(options)
        dac_rate = self.u.dac_rate()
        self.rs_rate = options.bitrate    # Store requested bit rate
            
        (self._bitrate, self._samples_per_symbol, self._interp) = \
                        pick_tx_bitrate(options.bitrate, self._modulator_class.bits_per_symbol(),
                                        options.samples_per_symbol, options.interp,
                                        dac_rate, self.u.get_interp_rates())

        options.interp = self._interp
        options.samples_per_symbol = self._samples_per_symbol
        options.bitrate = self._bitrate

        if options.verbose:
            print 'USRP Sink:', self.u
            print "Interpolation Rate: ", self._interp
        
        self.u.set_interp(self._interp)
        self.u.set_auto_tr(True)

        if not self.u.set_center_freq(options.tx_freq):
            print "Failed to set Rx frequency to %s" % (eng_notation.num_to_str(options.tx_freq))
            raise ValueError, eng_notation.num_to_str(options.tx_freq)
Exemple #3
0
 def _setup_usrpx(self, options):
     self._u = usrp_options.create_usrp_sink(options)
     self.publish(DESC_KEY, lambda: str(self._u))
     self.publish(DAC_RATE_KEY, self._u.dac_rate)
     self.publish(FREQ_RANGE_KEY, self._u.freq_range)
     self.publish(GAIN_RANGE_KEY, self._u.gain_range)
     self.publish(GAIN_KEY, self._u.gain)
     if self._verbose: print str(self._u)
Exemple #4
0
 def _setup_usrpx(self, options):
     self._u = usrp_options.create_usrp_sink(options)
     self.publish(DESC_KEY, lambda: str(self._u))
     self.publish(DAC_RATE_KEY, self._u.dac_rate)
     self.publish(FREQ_RANGE_KEY, self._u.freq_range)
     self.publish(GAIN_RANGE_KEY, self._u.gain_range)
     self.publish(GAIN_KEY, self._u.gain)
     if self._verbose: print str(self._u)