commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r3944 - gnuradio/branches/developers/trondeau/digital-


From: trondeau
Subject: [Commit-gnuradio] r3944 - gnuradio/branches/developers/trondeau/digital-wip/gnuradio-core/src/python/gnuradio/blksimpl
Date: Sun, 5 Nov 2006 12:42:19 -0700 (MST)

Author: trondeau
Date: 2006-11-05 12:42:19 -0700 (Sun, 05 Nov 2006)
New Revision: 3944

Modified:
   
gnuradio/branches/developers/trondeau/digital-wip/gnuradio-core/src/python/gnuradio/blksimpl/dbpsk.py
Log:
Allow Costas loop to be turned on and off by setting costas-alpha value; 
default is set to off (costas-alpha=0.0)

Modified: 
gnuradio/branches/developers/trondeau/digital-wip/gnuradio-core/src/python/gnuradio/blksimpl/dbpsk.py
===================================================================
--- 
gnuradio/branches/developers/trondeau/digital-wip/gnuradio-core/src/python/gnuradio/blksimpl/dbpsk.py
       2006-11-05 19:37:31 UTC (rev 3943)
+++ 
gnuradio/branches/developers/trondeau/digital-wip/gnuradio-core/src/python/gnuradio/blksimpl/dbpsk.py
       2006-11-05 19:42:19 UTC (rev 3944)
@@ -39,7 +39,7 @@
 _def_verbose = False
 _def_log = False
 
-_def_costas_alpha = 0.05
+_def_costas_alpha = 0.00
 _def_gain_mu = 0.03
 _def_mu = 0.05
 _def_omega_relative_limit = 0.005
@@ -241,12 +241,12 @@
 
         
         # Costas loop (carrier tracking)
-        # The Costas loop is not needed for BPSK (thanks to other nice 
properties of the system, the M&M
-        # block in particular. Uncomment these lines to add it back in and 
readd to the flow graph
-        # if your purposes demand its use.
-        #costas_order = 2
-        #beta = .25 * self._costas_alpha * self._costas_alpha
-        #self.costas_loop = gr.costas_loop_cc(self._costas_alpha, beta, 0.002, 
-0.002, costas_order)
+        # The Costas loop is not needed for BPSK, though it can help. Turn the 
Costas loop on
+        # by setting an alpha value of something greater than 0 (e.g., 0.1)
+        if self._costas_alpha > 0.0:
+            costas_order = 2
+            beta = .25 * self._costas_alpha * self._costas_alpha
+            self.costas_loop = gr.costas_loop_cc(self._costas_alpha, beta, 
0.002, -0.002, costas_order)
 
         # RRC data filter
         ntaps = 11 * self._samples_per_symbol
@@ -291,9 +291,14 @@
             self._setup_logging()
 
         # Connect and Initialize base class
-        self._fg.connect(self.pre_scaler, self.agc, #self.costas_loop,
-                         self.rrc_filter, self.clock_recovery, self.diffdec,
-                         self.slicer, self.symbol_mapper, self.unpack)
+        if self._costas_alpha > 0.0:   # With Costas Loop
+            self._fg.connect(self.pre_scaler, self.agc, self.costas_loop,
+                             self.rrc_filter, self.clock_recovery, 
self.diffdec,
+                             self.slicer, self.symbol_mapper, self.unpack)
+        else: # Without Costas Loop
+            self._fg.connect(self.pre_scaler, self.agc,
+                             self.rrc_filter, self.clock_recovery, 
self.diffdec,
+                             self.slicer, self.symbol_mapper, self.unpack)
 
         gr.hier_block.__init__(self, self._fg, self.pre_scaler, self.unpack)
 
@@ -308,7 +313,7 @@
         print "bits per symbol = %d"         % self.bits_per_symbol()
         print "Gray code = %s"               % self._gray_code
         print "RRC roll-off factor = %.2f"   % self._excess_bw
-        #print "Costas Loop alpha = %.5f"     % self._costas_alpha
+        print "Costas Loop alpha = %.5f"     % self._costas_alpha
         print "M&M symbol sync gain = %.5f"  % self._gain_mu
         print "M&M symbol sync mu = %.5f"    % self._mu
         print "M&M omega relative limit = %.5f" % self._omega_relative_limit
@@ -319,10 +324,11 @@
                          gr.file_sink(gr.sizeof_gr_complex, "prescaler.dat"))
         self._fg.connect(self.agc,
                          gr.file_sink(gr.sizeof_gr_complex, "agc.dat"))
-        #self._fg.connect(self.costas_loop,
-        #                 gr.file_sink(gr.sizeof_gr_complex, 
"costas_loop.dat"))
-        #self._fg.connect((self.costas_loop,1),
-        #                 gr.file_sink(gr.sizeof_gr_complex, 
"costas_error.dat"))
+        if self._costas_alpha > 0.0:
+            self._fg.connect(self.costas_loop,
+                             gr.file_sink(gr.sizeof_gr_complex, 
"costas_loop.dat"))
+            self._fg.connect((self.costas_loop,1),
+                             gr.file_sink(gr.sizeof_gr_complex, 
"costas_error.dat"))
         self._fg.connect(self.rrc_filter,
                          gr.file_sink(gr.sizeof_gr_complex, "rrc_filter.dat"))
         self._fg.connect(self.clock_recovery,





reply via email to

[Prev in Thread] Current Thread [Next in Thread]