commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r8967 - in gnuradio/branches/features/experimental-gui


From: jcorgan
Subject: [Commit-gnuradio] r8967 - in gnuradio/branches/features/experimental-gui: . plotter
Date: Mon, 21 Jul 2008 18:21:04 -0600 (MDT)

Author: jcorgan
Date: 2008-07-21 18:21:02 -0600 (Mon, 21 Jul 2008)
New Revision: 8967

Modified:
   gnuradio/branches/features/experimental-gui/const_controller.py
   gnuradio/branches/features/experimental-gui/const_gui.py
   gnuradio/branches/features/experimental-gui/const_streamer.py
   gnuradio/branches/features/experimental-gui/const_top_block.py
   gnuradio/branches/features/experimental-gui/plotter/
   gnuradio/branches/features/experimental-gui/usrp_const.py
Log:
Updated constellation demo for OTA use.

Modified: gnuradio/branches/features/experimental-gui/const_controller.py
===================================================================
--- gnuradio/branches/features/experimental-gui/const_controller.py     
2008-07-22 00:07:51 UTC (rev 8966)
+++ gnuradio/branches/features/experimental-gui/const_controller.py     
2008-07-22 00:21:02 UTC (rev 8967)
@@ -55,8 +55,8 @@
                 bit_rate=None,
                 costas_alpha=0.1,
                 costas_max=0.05,
-                mm_alpha=0.05,
-                mm_max=0.05):
+                mm_gain_mu=0.05,
+                mm_omega_limit=0.05):
         
        prop_val_interface.__init__(self)
        threading.Thread.__init__(self)
@@ -76,24 +76,26 @@
                                   bit_rate=bit_rate,
                                   costas_alpha=costas_alpha,
                                   costas_max=costas_max,
-                                  mm_alpha=mm_alpha,
-                                  mm_max=mm_max)
+                                  mm_gain_mu=mm_gain_mu,
+                                  mm_omega_limit=mm_omega_limit)
        
        # External control interface.  These properties, when set by an external
        # caller, result in the correct top block methods being invoked.
        self.add_listener('decim',        self.set_decim)
        self.add_listener('gain',         self._tb.set_gain)
        self.add_listener('freq',         self._tb.set_freq)
-       #self.add_listener('costas_alpha', self._tb.set_costas_alpha)
-       #self.add_listener('costas_max',   self._tb.set_costas_max)
+       self.add_listener('costas_alpha', self._tb.set_costas_alpha)
+       self.add_listener('costas_beta',  self._tb.set_costas_beta)
+       self.add_listener('gain_mu',      self._tb.set_gain_mu)
+       self.add_listener('gain_omega',   self._tb.set_gain_omega)
        
        # Set providers for application properties
-       self.set_provider('sample_rate', self._tb.sample_rate)
+       self.set_provider('sample_rate',  self._tb.sample_rate)
+       self.set_provider('costas_alpha', self._tb.costas_alpha)
+       self.set_provider('costas_beta',  self._tb.costas_beta)
+       self.set_provider('gain_mu',      self._tb.gain_mu)
+       self.set_provider('gain_omega',   self._tb.gain_omega)
        
-       #temp!!!
-       self['costas_alpha'] = .5
-       self['costas_beta'] = .5
-       
        # The controller is a thread.  This is not required but convenient here.
        self.setDaemon(1)
        self._keep_running = True

Modified: gnuradio/branches/features/experimental-gui/const_gui.py
===================================================================
--- gnuradio/branches/features/experimental-gui/const_gui.py    2008-07-22 
00:07:51 UTC (rev 8966)
+++ gnuradio/branches/features/experimental-gui/const_gui.py    2008-07-22 
00:21:02 UTC (rev 8967)
@@ -29,18 +29,18 @@
 """
 
 class const_gui(wxgui_app):
-    def __init__(self, controller, title='const demo'):
+    def __init__(self, controller, title='USRP Constellation Plot'):
         wxgui_app.__init__(self, controller=controller, title=title)
 
         self._win = const_window(parent=self.GetWin(),
                                 controller=controller,
-                                size=(600, 300),
+                                size=(600, 600),
                                 title=title,
                                 msg_key='const',
                                 alpha_key='costas_alpha',
                                 beta_key='costas_beta',
-                                gain_mu_key='costas_alpha',
-                                gain_omega_key='costas_beta',
+                                gain_mu_key='gain_mu',
+                                gain_omega_key='gain_omega',
                             )
     
         self.Add(self._win)

Modified: gnuradio/branches/features/experimental-gui/const_streamer.py
===================================================================
--- gnuradio/branches/features/experimental-gui/const_streamer.py       
2008-07-22 00:07:51 UTC (rev 8966)
+++ gnuradio/branches/features/experimental-gui/const_streamer.py       
2008-07-22 00:21:02 UTC (rev 8967)
@@ -36,19 +36,19 @@
                  frame_rate=30,
                  costas_alpha=0.1,
                  costas_max=0.05,
-                 mm_alpha=0.005,
-                 mm_max=0.05):
+                 mm_gain_mu=0.005,
+                 mm_omega_limit=0.05):
         """!
         Create a const_streamer.
         @param sample_rate          Incoming sample rate
         @param bit_rate             Modulated bit rate/sec
-        @param order                    Constellation order (BPSK=2, QPSK=4, 
default is 2)
+        @param order                Constellation order (BPSK=2, QPSK=4, 
default is 2)
         @param frame_size           Number of constellation points to plot at 
a time
         @param frame_rate           Number of frames/sec to create (default is 
30)
         @param costas_alpha         Costas loop 1st order gain constant 
(default is 0.1)
         @param costas_max           Costas loop maximum offset, rad/sample 
(default is 0.05)
-        @param mm_alpha             Timing loop 1st order gain constant 
(default is 0.005)
-        @param mm_max               Maximum timing offset in bits/sample 
(default is 0.05)
+        @param mm_gain_mu           Timing loop 1st order gain constant 
(default is 0.005)
+        @param mm_omega_limit       Maximum timing offset in bits/sample 
(default is 0.05)
         """
         
         gr.hier_block2.__init__(self, "const_streamer",
@@ -67,14 +67,14 @@
         
         # Timing recovery loop
         # Critically damped 2nd order DLL
-        mm_freq = float(sample_rate)/bit_rate
-        mm_beta = 0.25*mm_alpha*mm_alpha
-        mu=0.5 # Center of bit
-        self._retime = gr.clock_recovery_mm_cc(mm_freq,   # omega,
-                                               mm_beta,   # gain_omega
-                                               mu,
-                                               mm_alpha,  # gain_mu,
-                                               mm_max)    # omega_limit
+        mm_omega = float(sample_rate)/bit_rate
+        mm_gain_omega = 0.25*mm_gain_mu*mm_gain_mu
+        mm_mu=0.5 # Center of bit
+        self._retime = gr.clock_recovery_mm_cc(mm_omega,   
+                                               mm_gain_omega,
+                                               mm_mu,
+                                               mm_gain_mu,
+                                               mm_omega_limit)
 
         # Scale to unity power
         self._agc = gr.agc_cc(1e-6);
@@ -85,3 +85,27 @@
                                                        vec_len=frame_size)
             
         self.connect(self, self._costas, self._retime, self._agc, self._decim, 
self)
+
+    def set_costas_alpha(self, alpha):
+       self._costas.set_alpha(alpha)
+
+    def costas_alpha(self):
+       return self._costas.alpha()
+       
+    def set_costas_beta(self, beta):
+       self._costas.set_beta(beta)
+
+    def costas_beta(self):
+       return self._costas.beta()
+
+    def set_gain_mu(self, gain_mu):
+       self._retime.set_gain_mu(gain_mu)
+       
+    def gain_mu(self):
+       return self._retime.gain_mu()
+       
+    def set_gain_omega(self, gain_omega):
+       self._retime.set_gain_omega(gain_omega)
+       
+    def gain_omega(self):
+       return self._return.gain_omega()

Modified: gnuradio/branches/features/experimental-gui/const_top_block.py
===================================================================
--- gnuradio/branches/features/experimental-gui/const_top_block.py      
2008-07-22 00:07:51 UTC (rev 8966)
+++ gnuradio/branches/features/experimental-gui/const_top_block.py      
2008-07-22 00:21:02 UTC (rev 8967)
@@ -45,28 +45,28 @@
                  bit_rate=None,
                  costas_alpha=0.1,
                  costas_max=0.05,
-                 mm_alpha=0.005,
-                 mm_max=0.05
+                 mm_gain_mu=0.005,
+                 mm_omega_limit=0.05
                  ):
         """!
         Create a const_top_block.
 
-        @param order                    Constellation order (BPSK=2, QPSK=4, 
default is 2)
+        @param order                Constellation order (BPSK=2, QPSK=4, 
default is 2)
         @param frame_size           Number of constellation points to plot at 
a time
         @param frame_rate           Number of frames/sec to create (default is 
30)
-        @param which                    USRP # on USB bus (default is 0)
-        @param decim                    Receive sample rate decimation 
(default is 16)
-        @param width_8                    Use 8-bit instead of 16-bit samples 
(default is False)
-        @param no_hb                    Don't use half-band filter (default is 
False)
+        @param which                USRP # on USB bus (default is 0)
+        @param decim                Receive sample rate decimation (default is 
16)
+        @param width_8              Use 8-bit instead of 16-bit samples 
(default is False)
+        @param no_hb                Don't use half-band filter (default is 
False)
         @param subdev_spec          Daughterboard selection (default is first 
found)
-        @param gain                    Daughterboard RX gain (default is 
mid-range)
-        @param freq                    Daughterboard RX frequency (default is 
mid-range)
-        @param antenna                    Daughterboard RX antenna (default is 
board-default)
+        @param gain                 Daughterboard RX gain (default is 
mid-range)
+        @param freq                 Daughterboard RX frequency (default is 
mid-range)
+        @param antenna              Daughterboard RX antenna (default is 
board-default)
         @param bit_rate             Modulated bit rate/sec (default equivalent 
to 2 samples/bit)
         @param costas_alpha         Costas loop 1st order gain constant 
(default is 0.1)
         @param costas_max           Costas loop maximum offset, rad/sample 
(default is 0.05)
-        @param mm_alpha             Timing loop 1st order gain constant 
(default is 0.005)
-        @param mm_max               Maximum timing offset in bits/sample 
(default is 0.05)
+        @param mm_gain_mu           Timing loop 1st order gain constant 
(default is 0.005)
+        @param mm_omega_limit       Maximum timing offset in bits/sample 
(default is 0.05)
         """
         
         gr.top_block.__init__(self, "const_top_block")
@@ -81,9 +81,8 @@
                                        freq=freq,
                                        antenna=antenna)
 
-        # TODO: make this a configuration matched filter
-        # for now assume square pulses
-        self._filt = gr.fir_filter_ccf(1, 
[1.0,]*int(self._u.sample_rate()/bit_rate))
+        # TODO: make this a configurable matched filter
+        # self._filt = gr.fir_filter_ccf(1, 
[1.0,]*int(self._u.sample_rate()/bit_rate))
 
         self._const = 
const_streamer.const_streamer(sample_rate=self._u.sample_rate(),
                                                     bit_rate=bit_rate,
@@ -92,13 +91,14 @@
                                                     frame_rate=frame_rate,
                                                     costas_alpha=costas_alpha,
                                                     costas_max=costas_max,
-                                                    mm_alpha=mm_alpha,
-                                                    mm_max=mm_max)
+                                                    mm_gain_mu=mm_gain_mu,
+                                                    
mm_omega_limit=mm_omega_limit)
 
         self._msgq = gr.msg_queue(2)
         self._sink = gr.message_sink(gr.sizeof_gr_complex*frame_size, 
self._msgq, True)
                     
-        self.connect(self._u, self._filt, self._const, self._sink)
+        self.connect(self._u, # self._filt,
+                    self._const, self._sink)
 
     # "Setters", which are called externally to affect flowgraph operation
     def set_gain(self, gain):
@@ -111,10 +111,33 @@
         self._u.set_decim(decim)
         self._const.set_sample_rate(self._u.sample_rate())
 
+    def set_costas_alpha(self, alpha):
+        self._const.set_costas_alpha(alpha)
+       
+    def set_costas_beta(self, beta):
+       self._const.set_costas_beta(beta)
+
+    def set_gain_mu(self, gain_mu):
+       self._const.set_gain_mu(gain_mu);
+
+    def set_gain_omega(self, gain_omega):
+       self._const.set_gain_omega(gain_omega)
+
     # Getters, which are called externally to get information about the 
flowgraph
     def queue(self):
             return self._msgq
 
     def sample_rate(self):
         return self._u.sample_rate()
+       
+    def costas_alpha(self):
+        return self._const.costas_alpha()
+       
+    def costas_beta(self):
+        return self._const.costas_beta()
 
+    def gain_mu(self):
+       return self._const.gain_mu()
+       
+    def gain_omega(self):
+       return self._const.gain_omega()


Property changes on: gnuradio/branches/features/experimental-gui/plotter
___________________________________________________________________
Name: svn:ignore
   + *.pyc


Modified: gnuradio/branches/features/experimental-gui/usrp_const.py
===================================================================
--- gnuradio/branches/features/experimental-gui/usrp_const.py   2008-07-22 
00:07:51 UTC (rev 8966)
+++ gnuradio/branches/features/experimental-gui/usrp_const.py   2008-07-22 
00:21:02 UTC (rev 8967)
@@ -57,9 +57,9 @@
                       help="Select Costas loop first order gain, 
[default=%%default]")
     parser.add_option("", "--costas-max", type="eng_float", default=0.05,
                       help="Select Costas loop max offset in radians/sample, 
[default=%default]")
-    parser.add_option("", "--mm-alpha", type="eng_float", default=0.05,
+    parser.add_option("", "--mm-gain-mu", type="eng_float", default=0.05,
                       help="Select timing recovery loop first order gain, 
[default=%default]")
-    parser.add_option("", "--mm-max", type="eng_float", default=0.05,
+    parser.add_option("", "--mm-omega-limit", type="eng_float", default=0.05,
                       help="Select timing recovery loop max offset in 
bits/sample, [default=%default]")
                      
     (options, args) = parser.parse_args()
@@ -99,8 +99,8 @@
                                  bit_rate=options.rate,
                                  costas_alpha=options.costas_alpha,
                                  costas_max=options.costas_max,
-                                 mm_alpha=options.mm_alpha,
-                                 mm_max=options.mm_max)
+                                 mm_gain_mu=options.mm_gain_mu,
+                                 mm_omega_limit=options.mm_omega_limit)
 
     # Step 2: Create the GUI and pass it the controller
     # to manipulate.  The GUI code doesn't know anything about GNU
@@ -112,16 +112,3 @@
     gui = const_gui(controller)
     gui.run()
 
-    # TEMPORARY
-    #f = open('const.dat', 'wb')
-    #def writer(frame):
-    #   f.write(frame)
-    #controller.add_listener('const', writer)
-
-    #controller.on_init()
-    #try:
-       #raw_input("Press return to stop.")
-    #except KeyboardInterrupt:
-       #pass
-       
-    #controller.on_exit()





reply via email to

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