commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r3620 - gnuradio/branches/developers/eb/digital-wip/gn


From: eb
Subject: [Commit-gnuradio] r3620 - gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/python/gnuradio/blksimpl
Date: Fri, 22 Sep 2006 14:03:04 -0600 (MDT)

Author: eb
Date: 2006-09-22 14:03:04 -0600 (Fri, 22 Sep 2006)
New Revision: 3620

Modified:
   
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/python/gnuradio/blksimpl/bpsk.py
   
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/python/gnuradio/blksimpl/dbpsk.py
   
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/python/gnuradio/blksimpl/dqpsk.py
Log:
fix --no-gray-code options

Modified: 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/python/gnuradio/blksimpl/bpsk.py
===================================================================
--- 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/python/gnuradio/blksimpl/bpsk.py
      2006-09-22 18:57:58 UTC (rev 3619)
+++ 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/python/gnuradio/blksimpl/bpsk.py
      2006-09-22 20:03:04 UTC (rev 3620)
@@ -126,14 +126,11 @@
         """
         Adds modulation-specific options to the standard parser
         """
-        from optparse import OptionConflictError
-        try:
-            parser.add_option("", "--excess-bw", type="float", default=0.35,
-                              help="set RRC excess bandwith factor 
[default=%default]")
-            parser.add_option("", "--no-gray-code", action="store_false", 
default=True,
-                              help="Don't use gray coding on modulated bits 
[default=%default]")
-        except OptionConflictError:
-            pass
+        parser.add_option("", "--excess-bw", type="float", default=0.35,
+                          help="set RRC excess bandwith factor 
[default=%default]")
+        parser.add_option("", "--no-gray-code", dest="gray_code",
+                          action="store_false", default=True,
+                          help="disable gray coding on modulated bits (PSK)")
     add_options=staticmethod(add_options)
 
 
@@ -278,8 +275,9 @@
         """
         parser.add_option("", "--excess-bw", type="float", default=0.3,
                           help="set RRC excess bandwith factor 
[default=%default]")
-        parser.add_option("", "--no-gray-code", action="store_false", 
default=True,
-                          help="Don't use gray coding on modulated bits 
[default=%default]")
+        parser.add_option("", "--no-gray-code", dest="gray_code",
+                          action="store_false", default=True,
+                          help="disable gray coding on modulated bits (PSK)")
         parser.add_option("", "--costas-alpha", type="float", default=0.05,
                           help="set Costas loop alpha value 
[default=%default]")
         parser.add_option("", "--gain-mu", type="float", default=0.05,

Modified: 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/python/gnuradio/blksimpl/dbpsk.py
===================================================================
--- 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/python/gnuradio/blksimpl/dbpsk.py
     2006-09-22 18:57:58 UTC (rev 3619)
+++ 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/python/gnuradio/blksimpl/dbpsk.py
     2006-09-22 20:03:04 UTC (rev 3620)
@@ -63,6 +63,7 @@
         self._fg = fg
         self._samples_per_symbol = samples_per_symbol
         self._excess_bw = excess_bw
+        self._gray_code = gray_code
 
         if not isinstance(self._samples_per_symbol, int) or 
self._samples_per_symbol < 2:
             raise TypeError, ("sbp must be an integer >= 2, is %d" % 
self._samples_per_symbol)
@@ -75,7 +76,7 @@
         self.bytes2chunks = \
           gr.packed_to_unpacked_bb(self.bits_per_symbol(), gr.GR_MSB_FIRST)
 
-        if gray_code:
+        if self._gray_code:
             self.gray_coder = gr.map_bb(psk.binary_to_gray[arity])
         else:
             self.gray_coder = gr.map_bb(psk.binary_to_ungray[arity])
@@ -120,11 +121,11 @@
         """
         Adds DBPSK modulation-specific options to the standard parser
         """
-        from optparse import OptionConflictError
         parser.add_option("", "--excess-bw", type="float", default=0.35,
                           help="set RRC excess bandwith factor 
[default=%default]")
-        parser.add_option("", "--no-gray-code", action="store_false", 
default=True,
-                          help="Don't use gray coding on modulated bits 
[default=%default]")
+        parser.add_option("", "--no-gray-code", dest="gray_code",
+                          action="store_false", default=True,
+                          help="disable gray coding on modulated bits (PSK)")
     add_options=staticmethod(add_options)
 
     def extract_kwargs_from_options(options):
@@ -138,6 +139,7 @@
 
     def _print_verbage(self):
         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
 
     def _setup_logging(self):
@@ -199,6 +201,7 @@
         self._gain_mu = gain_mu
         self._mu = mu
         self._omega_relative_limit = omega_relative_limit
+        self._gray_code = gray_code
         
         if samples_per_symbol < 2:
             raise TypeError, "samples_per_symbol must be >= 2, is %r" % 
(samples_per_symbol,)
@@ -243,6 +246,8 @@
         #self.diffdec = gr.diff_decoder_bb(arity)
 
         self.slicer = gr.constellation_decoder_cb(rotated_const, range(arity))
+
+        # FIXME should be conditional on self._gray 
         self.gray_decoder = gr.map_bb(psk.gray_to_binary[arity])
         
         # unpack the k bit vector into a stream of bits
@@ -268,6 +273,7 @@
 
     def _print_verbage(self):
         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 "M&M symbol sync gain = %.5f"  % self._gain_mu
@@ -303,8 +309,9 @@
         """
         parser.add_option("", "--excess-bw", type="float", default=0.35,
                           help="set RRC excess bandwith factor 
[default=%default] (PSK)")
-        parser.add_option("", "--no-gray-code", action="store_false", 
default=True,
-                          help="Don't use gray coding on modulated bits 
[default=%default] (PSK)")
+        parser.add_option("", "--no-gray-code", dest="gray_code",
+                          action="store_false", default=True,
+                          help="disable gray coding on modulated bits (PSK)")
         parser.add_option("", "--costas-alpha", type="float", default=0.05,
                           help="set Costas loop alpha value [default=%default] 
(PSK)")
         parser.add_option("", "--gain-mu", type="float", default=0.05,

Modified: 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/python/gnuradio/blksimpl/dqpsk.py
===================================================================
--- 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/python/gnuradio/blksimpl/dqpsk.py
     2006-09-22 18:57:58 UTC (rev 3619)
+++ 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/python/gnuradio/blksimpl/dqpsk.py
     2006-09-22 20:03:04 UTC (rev 3620)
@@ -62,7 +62,8 @@
 
         self._fg = fg
         self._samples_per_symbol = samples_per_symbol
-        self._excess_bw = excess_bw        
+        self._excess_bw = excess_bw
+        self._gray_code = gray_code
 
         if not isinstance(samples_per_symbol, int) or samples_per_symbol < 2:
             raise TypeError, ("sbp must be an integer >= 2, is %d" % 
samples_per_symbol)
@@ -75,7 +76,7 @@
         self.bytes2chunks = \
           gr.packed_to_unpacked_bb(self.bits_per_symbol(), gr.GR_MSB_FIRST)
 
-        if gray_code:
+        if self._gray_code:
             self.gray_coder = gr.map_bb(psk.binary_to_gray[arity])
         else:
             self.gray_coder = gr.map_bb(psk.binary_to_ungray[arity])
@@ -116,6 +117,7 @@
 
     def _print_verbage(self):
         print "bits per symbol = %d" % self.bits_per_symbol()
+        print "Gray code = %s" % self._gray_code
         print "RRS roll-off factor = %f" % self._excess_bw
 
     def _setup_logging(self):
@@ -137,8 +139,9 @@
         """
         parser.add_option("", "--excess-bw", type="float", default=0.35,
                           help="set RRC excess bandwith factor 
[default=%default] (PSK)")
-        parser.add_option("", "--no-gray-code", action="store_false", 
default=True,
-                          help="Don't use gray coding on modulated bits 
[default=%default] (PSK)")
+        parser.add_option("", "--no-gray-code", dest="gray_code",
+                          action="store_false", default=True,
+                          help="disable gray coding on modulated bits (PSK)")
     add_options=staticmethod(add_options)
 
 
@@ -196,6 +199,7 @@
         self._gain_mu = gain_mu
         self._mu = mu
         self._omega_relative_limit = omega_relative_limit
+        self._gray_code = gray_code
 
         if samples_per_symbol < 2:
             raise TypeError, "sbp must be >= 2, is %d" % samples_per_symbol
@@ -241,6 +245,8 @@
         print "rotated_const = %s" % rotated_const
 
         self.slicer = gr.constellation_decoder_cb(rotated_const, range(arity))
+
+        # FIXME  needs to be conditional on self._gray_code
         self.gray_decoder = gr.map_bb(psk.gray_to_binary[arity])
         
         # unpack the k bit vector into a stream of bits
@@ -266,11 +272,13 @@
 
     def _print_verbage(self):
         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 "M&M symbol sync gain = %.5f" % self._gain_mu
-        print "M&M symbol sync mu = %.5f"   % self._mu
+        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
+        
 
     def _setup_logging(self):
         print "Modulation logging turned on."
@@ -301,8 +309,9 @@
         """
         parser.add_option("", "--excess-bw", type="float", default=0.35,
                           help="set RRC excess bandwith factor 
[default=%default] (PSK)")
-        parser.add_option("", "--no-gray-code", action="store_false", 
default=True,
-                          help="Don't use gray coding on modulated bits 
[default=%default] (PSK)")
+        parser.add_option("", "--no-gray-code", dest="gray_code",
+                          action="store_false", default=True,
+                          help="disable gray coding on modulated bits (PSK)")
         parser.add_option("", "--costas-alpha", type="float", default=0.05,
                           help="set Costas loop alpha value [default=%default] 
(PSK)")
         parser.add_option("", "--gain-mu", type="float", default=0.05,





reply via email to

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