Changeset 4072
- Timestamp:
- 12/12/06 14:51:12
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
gnuradio/branches/releases/3.0/gnuradio-core/src/python/gnuradio/blksimpl/dbpsk.py
r3696 r4072 40 40 _def_log = False 41 41 42 _def_costas_alpha = 0.0542 _def_costas_alpha = None 43 43 _def_gain_mu = 0.03 44 44 _def_mu = 0.05 … … 242 242 243 243 # Costas loop (carrier tracking) 244 # FIXME: need to decide how to handle this more generally; do we pull it from higher layer? 245 costas_order = 2 246 beta = .25 * self._costas_alpha * self._costas_alpha 247 self.costas_loop = gr.costas_loop_cc(self._costas_alpha, beta, 0.002, -0.002, costas_order) 244 # The Costas loop is not needed for BPSK, though it can help. Turn the Costas loop on 245 # by setting an alpha value not None. 246 if self._costas_alpha is not None: 247 costas_order = 2 248 beta = .25 * self._costas_alpha * self._costas_alpha 249 self.costas_loop = gr.costas_loop_cc(self._costas_alpha, beta, 0.002, -0.002, costas_order) 248 250 249 251 # RRC data filter … … 290 292 291 293 # Connect and Initialize base class 292 self._fg.connect(self.pre_scaler, self.agc, self.costas_loop, 293 self.rrc_filter, self.clock_recovery, self.diffdec, 294 self.slicer, self.symbol_mapper, self.unpack) 294 if self._costas_alpha is not None: # With Costas Loop 295 self._fg.connect(self.pre_scaler, self.agc, self.costas_loop, 296 self.rrc_filter, self.clock_recovery, self.diffdec, 297 self.slicer, self.symbol_mapper, self.unpack) 298 else: # Without Costas Loop 299 self._fg.connect(self.pre_scaler, self.agc, 300 self.rrc_filter, self.clock_recovery, self.diffdec, 301 self.slicer, self.symbol_mapper, self.unpack) 295 302 296 303 gr.hier_block.__init__(self, self._fg, self.pre_scaler, self.unpack) … … 307 314 print "Gray code = %s" % self._gray_code 308 315 print "RRC roll-off factor = %.2f" % self._excess_bw 309 print "Costas Loop alpha = %.5f" % self._costas_alpha 316 if self._costas_alpha is not None: 317 print "Costas Loop alpha = %.5f" % self._costas_alpha 318 else: 319 print "Costas Loop is turned off" 310 320 print "M&M symbol sync gain = %.5f" % self._gain_mu 311 321 print "M&M symbol sync mu = %.5f" % self._mu … … 318 328 self._fg.connect(self.agc, 319 329 gr.file_sink(gr.sizeof_gr_complex, "agc.dat")) 320 self._fg.connect(self.costas_loop, 321 gr.file_sink(gr.sizeof_gr_complex, "costas_loop.dat")) 322 self._fg.connect((self.costas_loop,1), 323 gr.file_sink(gr.sizeof_gr_complex, "costas_error.dat")) 330 if self._costas_alpha is not None: 331 self._fg.connect(self.costas_loop, 332 gr.file_sink(gr.sizeof_gr_complex, "costas_loop.dat")) 333 self._fg.connect((self.costas_loop,1), 334 gr.file_sink(gr.sizeof_gr_complex, "costas_error.dat")) 324 335 self._fg.connect(self.rrc_filter, 325 336 gr.file_sink(gr.sizeof_gr_complex, "rrc_filter.dat")) gnuradio/branches/releases/3.0/gnuradio-core/src/python/gnuradio/blksimpl/dqpsk.py
r3662 r4072 40 40 _def_log = False 41 41 42 _def_costas_alpha = 0.1042 _def_costas_alpha = None 43 43 _def_gain_mu = 0.03 44 44 _def_mu = 0.05 … … 239 239 240 240 # Costas loop (carrier tracking) 241 # FIXME: need to decide how to handle this more generally; do we pull it from higher layer? 242 costas_order = 4 243 beta = .25 * self._costas_alpha * self._costas_alpha 244 #self.costas_loop = gr.costas_loop_cc(self._costas_alpha, beta, 0.1, -0.1, costas_order) 245 self.costas_loop = gr.costas_loop_cc(self._costas_alpha, beta, 0.002, -0.002, costas_order) 241 if self._costas_alpha is None: # If no alpha value was specified by the user 242 alpha_dir = {2:0.075, 3:0.09, 4:0.09, 5:0.095, 6:0.10, 7:0.105} 243 self._costas_alpha = alpha_dir[self._samples_per_symbol] 244 245 costas_order = 4 246 # The value of beta is now set to be underdamped; this value can have a huge impact on the 247 # performance of QPSK. Set to 0.25 for critically damped or higher for underdamped responses. 248 beta = .35 * self._costas_alpha * self._costas_alpha 249 self.costas_loop = gr.costas_loop_cc(self._costas_alpha, beta, 0.02, -0.02, costas_order) 246 250 247 251 # RRC data filter
