diff options
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 (); |