Adding accessor functions to set alpha and beta gains for the FLL.
authorTom <trondeau@vt.edu>
Thu, 10 Dec 2009 05:32:49 +0000 (00:32 -0500)
committerTom <trondeau@vt.edu>
Thu, 10 Dec 2009 05:32:49 +0000 (00:32 -0500)
gnuradio-core/src/lib/general/gr_fll_band_edge_cc.cc
gnuradio-core/src/lib/general/gr_fll_band_edge_cc.h
gnuradio-core/src/lib/general/gr_fll_band_edge_cc.i
grc/blocks/gr_fll_band_edge_cc.xml

index 5ed9cf5f524019f5b7f814f1af10e772e3452f29..156ad278a28529e2085e3da4370dbd30d504f44b 100644 (file)
@@ -130,7 +130,7 @@ gr_fll_band_edge_cc::work (int noutput_items,
     error = out_lower - out_upper;
 
     d_freq = d_freq + d_beta * error;
-    d_phase = d_phase + d_freq + d_alpha * error;
+    d_phase = d_phase + d_freq; // + d_alpha * error;
 
     if(d_phase > M_PI)
       d_phase -= M_TWOPI;
index ca268859ac34db989dbacc87189c63cef4fc749f..feb5e0a77dd677366dfdb556f7534e233ba2d19d 100644 (file)
@@ -78,7 +78,19 @@ public:
    * Resets the filter taps with the new prototype filter
    * \param taps    (vector/list of gr_complex) The band-edge filter
    */
-   void set_taps (const std::vector<gr_complex> &taps);
+  void set_taps (const std::vector<gr_complex> &taps);
+
+  /*!
+   * Set the alpha gainvalue
+   * \param alpha    (float) new gain value
+   */
+  void set_alpha(float alpha) { d_alpha = alpha; }
+
+  /*!
+   * Set the beta gain value
+   * \param beta    (float) new gain value
+   */
+  void set_beta(float beta) { d_beta = beta; }
 
   /*!
    * Print the taps to screen.
index 9891d1405c9205557c2d82bcbfca27b20a1bf387..13714951b193e08fd8b2e5a91f1fef39341ca629 100644 (file)
@@ -35,4 +35,6 @@ class gr_fll_band_edge_cc : public gr_sync_block
   ~gr_fll_band_edge_cc ();
 
   void set_taps (const std::vector<gr_complex> &taps);
+  void set_alpha (float alpha);
+  void set_beta (float beta);
 };
index dc4a650ea962cd1b1f608c43579c96c5e3d16d30..61dc378a9d028c4aad38e7c8a5f04570dce8eca3 100644 (file)
@@ -10,6 +10,8 @@
        <import>from gnuradio import gr</import>
        <make>gr.fll_band_edge_cc($alpha, $beta, $taps)</make>
        <callback>set_taps($taps)</callback>
+       <callback>set_alpha($alpha)</callback>
+       <callback>set_beta($beta)</callback>
 
        <param>
                <name>Type</name>