diff options
author | Tom | 2009-12-10 00:12:51 -0500 |
---|---|---|
committer | Tom | 2009-12-10 00:12:51 -0500 |
commit | 101be00674a59e347932aa586ca07f1722665964 (patch) | |
tree | 210d0eb77ee2c57e00d0020122eb45b80878325c /gnuradio-core/src/lib | |
parent | 691209a1fd00052002af42d79d7a8aff56b7df27 (diff) | |
download | gnuradio-101be00674a59e347932aa586ca07f1722665964.tar.gz gnuradio-101be00674a59e347932aa586ca07f1722665964.tar.bz2 gnuradio-101be00674a59e347932aa586ca07f1722665964.zip |
Adding alpha and beta gains to FLL constructor.
Diffstat (limited to 'gnuradio-core/src/lib')
-rw-r--r-- | gnuradio-core/src/lib/general/gr_fll_band_edge_cc.cc | 17 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_fll_band_edge_cc.h | 9 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_fll_band_edge_cc.i | 6 |
3 files changed, 19 insertions, 13 deletions
diff --git a/gnuradio-core/src/lib/general/gr_fll_band_edge_cc.cc b/gnuradio-core/src/lib/general/gr_fll_band_edge_cc.cc index 946fc1e85..5ed9cf5f5 100644 --- a/gnuradio-core/src/lib/general/gr_fll_band_edge_cc.cc +++ b/gnuradio-core/src/lib/general/gr_fll_band_edge_cc.cc @@ -35,20 +35,22 @@ #define M_TWOPI (2*M_PI) -gr_fll_band_edge_cc_sptr gr_make_fll_band_edge_cc (const std::vector<gr_complex> &taps) +gr_fll_band_edge_cc_sptr gr_make_fll_band_edge_cc (float alpha, float beta, + const std::vector<gr_complex> &taps) { - return gr_fll_band_edge_cc_sptr (new gr_fll_band_edge_cc (taps)); + return gr_fll_band_edge_cc_sptr (new gr_fll_band_edge_cc (alpha, beta, + taps)); } -gr_fll_band_edge_cc::gr_fll_band_edge_cc (const std::vector<gr_complex> &taps) +gr_fll_band_edge_cc::gr_fll_band_edge_cc (float alpha, float beta, + const std::vector<gr_complex> &taps) : gr_sync_block ("fll_band_edge_cc", gr_make_io_signature (1, 1, sizeof(gr_complex)), gr_make_io_signature (1, 1, sizeof(gr_complex))), - d_updated (false) + d_alpha(alpha), d_beta(beta), d_updated (false) { - d_alpha = 0.01; - d_beta = 0.25*d_alpha*d_alpha; + // base this on the number of samples per symbol d_max_freq = M_TWOPI * 0.25; d_min_freq = M_TWOPI * -0.5; @@ -125,8 +127,7 @@ gr_fll_band_edge_cc::work (int noutput_items, out_upper = norm(d_filter_upper->filter(&out[i])); out_lower = norm(d_filter_lower->filter(&out[i])); - error = 0.1*(out_lower - out_upper); - printf("error: %f\n", out_upper); + error = out_lower - out_upper; d_freq = d_freq + d_beta * error; d_phase = d_phase + d_freq + d_alpha * error; diff --git a/gnuradio-core/src/lib/general/gr_fll_band_edge_cc.h b/gnuradio-core/src/lib/general/gr_fll_band_edge_cc.h index 1c47167f8..ca268859a 100644 --- a/gnuradio-core/src/lib/general/gr_fll_band_edge_cc.h +++ b/gnuradio-core/src/lib/general/gr_fll_band_edge_cc.h @@ -28,7 +28,8 @@ class gr_fll_band_edge_cc; typedef boost::shared_ptr<gr_fll_band_edge_cc> gr_fll_band_edge_cc_sptr; -gr_fll_band_edge_cc_sptr gr_make_fll_band_edge_cc (const std::vector<gr_complex> &taps); +gr_fll_band_edge_cc_sptr gr_make_fll_band_edge_cc (float alpha, float beta, + const std::vector<gr_complex> &taps); class gr_fir_ccc; class gri_fft_complex; @@ -47,7 +48,8 @@ class gr_fll_band_edge_cc : public gr_sync_block * Build the FLL * \param taps (vector/list of gr_complex) The taps of the band-edge filter */ - friend gr_fll_band_edge_cc_sptr gr_make_fll_band_edge_cc (const std::vector<gr_complex> &taps); + friend gr_fll_band_edge_cc_sptr gr_make_fll_band_edge_cc (float alpha, float beta, + const std::vector<gr_complex> &taps); float d_alpha; float d_beta; @@ -66,7 +68,8 @@ class gr_fll_band_edge_cc : public gr_sync_block * Build the FLL * \param taps (vector/list of gr_complex) The taps of the band-edge filter */ - gr_fll_band_edge_cc(const std::vector<gr_complex> &taps); + gr_fll_band_edge_cc(float alpha, float beta, + const std::vector<gr_complex> &taps); public: ~gr_fll_band_edge_cc (); diff --git a/gnuradio-core/src/lib/general/gr_fll_band_edge_cc.i b/gnuradio-core/src/lib/general/gr_fll_band_edge_cc.i index a550bec4e..9891d1405 100644 --- a/gnuradio-core/src/lib/general/gr_fll_band_edge_cc.i +++ b/gnuradio-core/src/lib/general/gr_fll_band_edge_cc.i @@ -22,12 +22,14 @@ GR_SWIG_BLOCK_MAGIC(gr,fll_band_edge_cc); -gr_fll_band_edge_cc_sptr gr_make_fll_band_edge_cc (const std::vector<gr_complex> &taps); +gr_fll_band_edge_cc_sptr gr_make_fll_band_edge_cc (float alpha, float beta, + const std::vector<gr_complex> &taps); class gr_fll_band_edge_cc : public gr_sync_block { private: - gr_fll_band_edge_cc (const std::vector<gr_complex> &taps); + gr_fll_band_edge_cc (float alpha, float beta, + const std::vector<gr_complex> &taps); public: ~gr_fll_band_edge_cc (); |