Starting to rework QT app to control new PFB clock recovery alg.
authorTom <trondeau@vt.edu>
Sat, 10 Oct 2009 01:22:44 +0000 (18:22 -0700)
committerTom <trondeau@vt.edu>
Sat, 10 Oct 2009 01:22:44 +0000 (18:22 -0700)
gnuradio-examples/python/digital/benchmark_qt_loopback.py

index 1bfda4a96c680e8e6cb17fc3a71fe57df1e649d8..35cc2e376d16bda6e51bedd57e9df484e9fae3ff 100755 (executable)
@@ -52,7 +52,7 @@ class dialog_box(QtGui.QMainWindow):
         self.set_frequency(self.fg.frequency_offset())
         self.set_time_offset(self.fg.timing_offset())
 
-        self.set_gain_mu(self.fg.rx_gain_mu())
+        self.set_gain_mu(self.fg.rx_timing_gain_alpha())
         self.set_alpha(self.fg.rx_alpha())
 
         # Add the qtsnk widgets to the hlayout box
@@ -158,7 +158,7 @@ class dialog_box(QtGui.QMainWindow):
     def gainMuEditText(self):
         try:
             gain = self.gui.gainMuEdit.text().toDouble()[0]
-            self.fg.set_rx_gain_mu(gain)
+            self.fg.set_rx_timing_gain_alpha(gain)
         except RuntimeError:
             pass
 
@@ -202,7 +202,7 @@ class my_top_block(gr.top_block):
         self.rxpath = receive_path(demod_class, rx_callback, options)
 
         # FIXME: do better exposure to lower issues for control
-        self._gain_mu = self.rxpath.packet_receiver._demodulator._mm_gain_mu
+        self._timing_gain_alpha = self.rxpath.packet_receiver._demodulator._timing_alpha
         self._alpha = self.rxpath.packet_receiver._demodulator._costas_alpha
 
         if channelon:
@@ -234,20 +234,20 @@ class my_top_block(gr.top_block):
                 self.snk_rx = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
                                            0, 1,
                                            "Rx", True, True, False, True, True)
-                self.snk_err = qtgui.sink_f(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
-                                            0, 1,
-                                            "Error", True, True, False, False, False)
 
                 self.snk_tx.set_frequency_axis(-80, 0)
                 self.snk_rx.set_frequency_axis(-60, 20)
             
                 # Connect to the QT sinks
                 # FIXME: make better exposure to receiver from rxpath
-                #self.freq_recov = self.rxpath.packet_receiver._demodulator.clock_recov
+                self.freq_recov = self.rxpath.packet_receiver._demodulator.clock_recov
                 self.time_recov = self.rxpath.packet_receiver._demodulator.time_recov
+                self.freq_recov.set_alpha(0)
+                self.freq_recov.set_beta(0)
+                self.time_recov.set_alpha(2)
+                self.time_recov.set_beta(0.02)
                 self.connect(self.channel, self.snk_tx)
                 self.connect(self.time_recov, self.snk_rx)
-                self.connect((self.time_recov, 1), self.snk_err)
 
                 pyTxQt  = self.snk_tx.pyqwidget()
                 pyTx = sip.wrapinstance(pyTxQt, QtGui.QWidget)
@@ -255,9 +255,6 @@ class my_top_block(gr.top_block):
                 pyRxQt  = self.snk_rx.pyqwidget()
                 pyRx = sip.wrapinstance(pyRxQt, QtGui.QWidget)
 
-                pyErrQt  = self.snk_err.pyqwidget()
-                pyErr = sip.wrapinstance(pyRxQt, QtGui.QWidget)
-
                 self.main_box = dialog_box(pyTx, pyRx, self)
                 self.main_box.show()
                 
@@ -307,18 +304,15 @@ class my_top_block(gr.top_block):
 
 
     # Receiver Parameters
-    def rx_gain_mu(self):
-        return self._gain_mu
+    def rx_timing_gain_alpha(self):
+        return self._timing_gain_alpha
 
-    def rx_gain_omega(self):
-        return self.gain_omega
+    def rx_timing_gain_beta(self):
+        return self._timing_gain_beta
     
-    def set_rx_gain_mu(self, gain):
-        self._gain_mu = gain
-        self.gain_omega = .25 * self._gain_mu * self._gain_mu
-        #self.time_recov.set_gain_mu(self._gain_mu)
-        #self.time_recov.set_gain_omega(self.gain_omega)
-        self.time_recov.set_gain(self._gain_mu)
+    def set_rx_timing_gain_alpha(self, gain):
+        self._timing_gain_alpha = gain
+        self.time_recov.set_gain(self._timing_gain_alpha)
 
     def rx_alpha(self):
         return self._alpha