Changeset 8980
- Timestamp:
- 07/22/08 17:03:05
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
gnuradio/branches/features/experimental-gui/simple_usrp.py
r8978 r8980 126 126 subdev_spec=None, 127 127 freq=None): 128 128 129 """! 129 130 Create a simple_usrp object accepting complex samples. … … 144 145 145 146 def _setup_usrp(self, which, interp): 146 self._u = usrp.sink_c(which=which )147 self.set_interp(interp)147 self._u = usrp.sink_c(which=which, 148 interp_rate=interp) 148 149 149 150 def _setup_db(self, subdev_spec, freq): 150 151 if subdev_spec is None: 151 152 subdev_spec = usrp.pick_tx_subdevice(self._u) 152 self._u.set_mux(usrp.determine_tx_mux_value(self._u, subdev_spec)) 153 mux = usrp.determine_tx_mux_value(self._u, subdev_spec) 154 self._u.set_mux(mux) 153 155 self._subdev = usrp.selected_subdev(self._u, subdev_spec) 156 self._subdev.set_enable(True) 157 print "Using", self._subdev.side_and_name() 154 158 self.set_freq(freq) 155 159 156 160 def set_interp(self, interp): 157 161 """! … … 172 176 f = self._subdev.freq_range() 173 177 freq = float(f[0]+f[1])/2.0 174 return self._u.tune(0, self._subdev, freq) 178 r = usrp.tune(self._u, self._subdev._which, self._subdev, freq) 179 return r 175 180 176 181 def sample_rate(self): gnuradio/branches/features/experimental-gui/tx_mpsk.py
r8978 r8980 25 25 from gnuradio.eng_option import eng_option 26 26 from math import pi, log10 27 import cmath 27 28 import simple_usrp 28 29 … … 48 49 49 50 # Map to constellation 50 self._constellation = blks2.constellation[arity] 51 self._mapper = gr.chunks_to_symbols_bc(self._constellation) 52 51 self._constellation = [cmath.exp(i*2*pi/arity*1j) for i in range(arity)] 52 self._mapper = gr.chunks_to_symbols_bc(self._constellation) 53 53 # Throttle to specified symbol rate 54 54 self._throttle = gr.throttle(gr.sizeof_gr_complex, sym_rate) … … 109 109 if __name__ == "__main__": 110 110 (options, args) = get_options() 111 111 print options 112 112 113 tb = tx_mpsk_top_block(arity=options.arity, 113 114 sps=options.sps,
