Changeset 8967
- Timestamp:
- 07/21/08 18:21:02
- Files:
-
- gnuradio/branches/features/experimental-gui/const_controller.py (modified) (3 diffs)
- gnuradio/branches/features/experimental-gui/const_gui.py (modified) (1 diff)
- gnuradio/branches/features/experimental-gui/const_streamer.py (modified) (3 diffs)
- gnuradio/branches/features/experimental-gui/const_top_block.py (modified) (5 diffs)
- gnuradio/branches/features/experimental-gui/plotter (modified) (1 prop)
- gnuradio/branches/features/experimental-gui/usrp_const.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
gnuradio/branches/features/experimental-gui/const_controller.py
r8962 r8967 56 56 costas_alpha=0.1, 57 57 costas_max=0.05, 58 mm_ alpha=0.05,59 mm_ max=0.05):58 mm_gain_mu=0.05, 59 mm_omega_limit=0.05): 60 60 61 61 prop_val_interface.__init__(self) … … 77 77 costas_alpha=costas_alpha, 78 78 costas_max=costas_max, 79 mm_ alpha=mm_alpha,80 mm_ max=mm_max)79 mm_gain_mu=mm_gain_mu, 80 mm_omega_limit=mm_omega_limit) 81 81 82 82 # External control interface. These properties, when set by an external … … 85 85 self.add_listener('gain', self._tb.set_gain) 86 86 self.add_listener('freq', self._tb.set_freq) 87 #self.add_listener('costas_alpha', self._tb.set_costas_alpha) 88 #self.add_listener('costas_max', self._tb.set_costas_max) 87 self.add_listener('costas_alpha', self._tb.set_costas_alpha) 88 self.add_listener('costas_beta', self._tb.set_costas_beta) 89 self.add_listener('gain_mu', self._tb.set_gain_mu) 90 self.add_listener('gain_omega', self._tb.set_gain_omega) 89 91 90 92 # Set providers for application properties 91 self.set_provider('sample_rate', self._tb.sample_rate)92 93 #temp!!!94 self ['costas_alpha'] = .595 self ['costas_beta'] = .593 self.set_provider('sample_rate', self._tb.sample_rate) 94 self.set_provider('costas_alpha', self._tb.costas_alpha) 95 self.set_provider('costas_beta', self._tb.costas_beta) 96 self.set_provider('gain_mu', self._tb.gain_mu) 97 self.set_provider('gain_omega', self._tb.gain_omega) 96 98 97 99 # The controller is a thread. This is not required but convenient here. gnuradio/branches/features/experimental-gui/const_gui.py
r8962 r8967 30 30 31 31 class const_gui(wxgui_app): 32 def __init__(self, controller, title=' const demo'):32 def __init__(self, controller, title='USRP Constellation Plot'): 33 33 wxgui_app.__init__(self, controller=controller, title=title) 34 34 35 35 self._win = const_window(parent=self.GetWin(), 36 36 controller=controller, 37 size=(600, 300),37 size=(600, 600), 38 38 title=title, 39 39 msg_key='const', 40 40 alpha_key='costas_alpha', 41 41 beta_key='costas_beta', 42 gain_mu_key=' costas_alpha',43 gain_omega_key=' costas_beta',42 gain_mu_key='gain_mu', 43 gain_omega_key='gain_omega', 44 44 ) 45 45 gnuradio/branches/features/experimental-gui/const_streamer.py
r8962 r8967 37 37 costas_alpha=0.1, 38 38 costas_max=0.05, 39 mm_ alpha=0.005,40 mm_ max=0.05):39 mm_gain_mu=0.005, 40 mm_omega_limit=0.05): 41 41 """! 42 42 Create a const_streamer. 43 43 @param sample_rate Incoming sample rate 44 44 @param bit_rate Modulated bit rate/sec 45 @param order Constellation order (BPSK=2, QPSK=4, default is 2)45 @param order Constellation order (BPSK=2, QPSK=4, default is 2) 46 46 @param frame_size Number of constellation points to plot at a time 47 47 @param frame_rate Number of frames/sec to create (default is 30) 48 48 @param costas_alpha Costas loop 1st order gain constant (default is 0.1) 49 49 @param costas_max Costas loop maximum offset, rad/sample (default is 0.05) 50 @param mm_ alphaTiming loop 1st order gain constant (default is 0.005)51 @param mm_ maxMaximum timing offset in bits/sample (default is 0.05)50 @param mm_gain_mu Timing loop 1st order gain constant (default is 0.005) 51 @param mm_omega_limit Maximum timing offset in bits/sample (default is 0.05) 52 52 """ 53 53 … … 68 68 # Timing recovery loop 69 69 # Critically damped 2nd order DLL 70 mm_ freq= float(sample_rate)/bit_rate71 mm_ beta = 0.25*mm_alpha*mm_alpha72 m u=0.5 # Center of bit73 self._retime = gr.clock_recovery_mm_cc(mm_ freq, # omega,74 mm_ beta, # gain_omega75 m u,76 mm_ alpha, #gain_mu,77 mm_ max) # omega_limit70 mm_omega = float(sample_rate)/bit_rate 71 mm_gain_omega = 0.25*mm_gain_mu*mm_gain_mu 72 mm_mu=0.5 # Center of bit 73 self._retime = gr.clock_recovery_mm_cc(mm_omega, 74 mm_gain_omega, 75 mm_mu, 76 mm_gain_mu, 77 mm_omega_limit) 78 78 79 79 # Scale to unity power … … 86 86 87 87 self.connect(self, self._costas, self._retime, self._agc, self._decim, self) 88 89 def set_costas_alpha(self, alpha): 90 self._costas.set_alpha(alpha) 91 92 def costas_alpha(self): 93 return self._costas.alpha() 94 95 def set_costas_beta(self, beta): 96 self._costas.set_beta(beta) 97 98 def costas_beta(self): 99 return self._costas.beta() 100 101 def set_gain_mu(self, gain_mu): 102 self._retime.set_gain_mu(gain_mu) 103 104 def gain_mu(self): 105 return self._retime.gain_mu() 106 107 def set_gain_omega(self, gain_omega): 108 self._retime.set_gain_omega(gain_omega) 109 110 def gain_omega(self): 111 return self._return.gain_omega() gnuradio/branches/features/experimental-gui/const_top_block.py
r8962 r8967 46 46 costas_alpha=0.1, 47 47 costas_max=0.05, 48 mm_ alpha=0.005,49 mm_ max=0.0548 mm_gain_mu=0.005, 49 mm_omega_limit=0.05 50 50 ): 51 51 """! 52 52 Create a const_top_block. 53 53 54 @param order Constellation order (BPSK=2, QPSK=4, default is 2)54 @param order Constellation order (BPSK=2, QPSK=4, default is 2) 55 55 @param frame_size Number of constellation points to plot at a time 56 56 @param frame_rate Number of frames/sec to create (default is 30) 57 @param which USRP # on USB bus (default is 0)58 @param decim Receive sample rate decimation (default is 16)59 @param width_8 Use 8-bit instead of 16-bit samples (default is False)60 @param no_hb Don't use half-band filter (default is False)57 @param which USRP # on USB bus (default is 0) 58 @param decim Receive sample rate decimation (default is 16) 59 @param width_8 Use 8-bit instead of 16-bit samples (default is False) 60 @param no_hb Don't use half-band filter (default is False) 61 61 @param subdev_spec Daughterboard selection (default is first found) 62 @param gain Daughterboard RX gain (default is mid-range)63 @param freq Daughterboard RX frequency (default is mid-range)64 @param antenna Daughterboard RX antenna (default is board-default)62 @param gain Daughterboard RX gain (default is mid-range) 63 @param freq Daughterboard RX frequency (default is mid-range) 64 @param antenna Daughterboard RX antenna (default is board-default) 65 65 @param bit_rate Modulated bit rate/sec (default equivalent to 2 samples/bit) 66 66 @param costas_alpha Costas loop 1st order gain constant (default is 0.1) 67 67 @param costas_max Costas loop maximum offset, rad/sample (default is 0.05) 68 @param mm_ alphaTiming loop 1st order gain constant (default is 0.005)69 @param mm_ maxMaximum timing offset in bits/sample (default is 0.05)68 @param mm_gain_mu Timing loop 1st order gain constant (default is 0.005) 69 @param mm_omega_limit Maximum timing offset in bits/sample (default is 0.05) 70 70 """ 71 71 … … 82 82 antenna=antenna) 83 83 84 # TODO: make this a configuration matched filter 85 # for now assume square pulses 86 self._filt = gr.fir_filter_ccf(1, [1.0,]*int(self._u.sample_rate()/bit_rate)) 84 # TODO: make this a configurable matched filter 85 # self._filt = gr.fir_filter_ccf(1, [1.0,]*int(self._u.sample_rate()/bit_rate)) 87 86 88 87 self._const = const_streamer.const_streamer(sample_rate=self._u.sample_rate(), … … 93 92 costas_alpha=costas_alpha, 94 93 costas_max=costas_max, 95 mm_ alpha=mm_alpha,96 mm_ max=mm_max)94 mm_gain_mu=mm_gain_mu, 95 mm_omega_limit=mm_omega_limit) 97 96 98 97 self._msgq = gr.msg_queue(2) 99 98 self._sink = gr.message_sink(gr.sizeof_gr_complex*frame_size, self._msgq, True) 100 99 101 self.connect(self._u, self._filt, self._const, self._sink) 100 self.connect(self._u, # self._filt, 101 self._const, self._sink) 102 102 103 103 # "Setters", which are called externally to affect flowgraph operation … … 112 112 self._const.set_sample_rate(self._u.sample_rate()) 113 113 114 def set_costas_alpha(self, alpha): 115 self._const.set_costas_alpha(alpha) 116 117 def set_costas_beta(self, beta): 118 self._const.set_costas_beta(beta) 119 120 def set_gain_mu(self, gain_mu): 121 self._const.set_gain_mu(gain_mu); 122 123 def set_gain_omega(self, gain_omega): 124 self._const.set_gain_omega(gain_omega) 125 114 126 # Getters, which are called externally to get information about the flowgraph 115 127 def queue(self): … … 118 130 def sample_rate(self): 119 131 return self._u.sample_rate() 132 133 def costas_alpha(self): 134 return self._const.costas_alpha() 135 136 def costas_beta(self): 137 return self._const.costas_beta() 120 138 139 def gain_mu(self): 140 return self._const.gain_mu() 141 142 def gain_omega(self): 143 return self._const.gain_omega() gnuradio/branches/features/experimental-gui/plotter
- Property svn:ignore set to *.pyc
gnuradio/branches/features/experimental-gui/usrp_const.py
r8962 r8967 58 58 parser.add_option("", "--costas-max", type="eng_float", default=0.05, 59 59 help="Select Costas loop max offset in radians/sample, [default=%default]") 60 parser.add_option("", "--mm- alpha", type="eng_float", default=0.05,60 parser.add_option("", "--mm-gain-mu", type="eng_float", default=0.05, 61 61 help="Select timing recovery loop first order gain, [default=%default]") 62 parser.add_option("", "--mm- max", type="eng_float", default=0.05,62 parser.add_option("", "--mm-omega-limit", type="eng_float", default=0.05, 63 63 help="Select timing recovery loop max offset in bits/sample, [default=%default]") 64 64 … … 100 100 costas_alpha=options.costas_alpha, 101 101 costas_max=options.costas_max, 102 mm_ alpha=options.mm_alpha,103 mm_ max=options.mm_max)102 mm_gain_mu=options.mm_gain_mu, 103 mm_omega_limit=options.mm_omega_limit) 104 104 105 105 # Step 2: Create the GUI and pass it the controller … … 113 113 gui.run() 114 114 115 # TEMPORARY116 #f = open('const.dat', 'wb')117 #def writer(frame):118 # f.write(frame)119 #controller.add_listener('const', writer)120 121 #controller.on_init()122 #try:123 #raw_input("Press return to stop.")124 #except KeyboardInterrupt:125 #pass126 127 #controller.on_exit()
