Changeset 8980

Show
Ignore:
Timestamp:
07/22/08 17:03:05
Author:
jcorgan
Message:

Added test MPSK transmitter.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gnuradio/branches/features/experimental-gui/simple_usrp.py

    r8978 r8980  
    126126                 subdev_spec=None, 
    127127                 freq=None): 
     128 
    128129        """! 
    129130        Create a simple_usrp object accepting complex samples. 
     
    144145 
    145146    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) 
    148149 
    149150    def _setup_db(self, subdev_spec, freq): 
    150151        if subdev_spec is None: 
    151152            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) 
    153155        self._subdev = usrp.selected_subdev(self._u, subdev_spec) 
     156        self._subdev.set_enable(True) 
     157        print "Using", self._subdev.side_and_name() 
    154158        self.set_freq(freq) 
    155  
     159         
    156160    def set_interp(self, interp): 
    157161        """! 
     
    172176            f = self._subdev.freq_range() 
    173177            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 
    175180 
    176181    def sample_rate(self): 
  • gnuradio/branches/features/experimental-gui/tx_mpsk.py

    r8978 r8980  
    2525from gnuradio.eng_option import eng_option 
    2626from math import pi, log10 
     27import cmath 
    2728import simple_usrp 
    2829 
     
    4849         
    4950        # 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)      
    5353        # Throttle to specified symbol rate 
    5454        self._throttle = gr.throttle(gr.sizeof_gr_complex, sym_rate) 
     
    109109if __name__ == "__main__": 
    110110    (options, args) = get_options() 
    111  
     111    print options 
     112     
    112113    tb = tx_mpsk_top_block(arity=options.arity, 
    113114                           sps=options.sps,