diff options
Diffstat (limited to 'gnuradio-core/src/lib/general')
-rw-r--r-- | gnuradio-core/src/lib/general/gr_skiphead.cc | 4 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gri_control_loop.cc | 23 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gri_control_loop.h | 39 |
3 files changed, 58 insertions, 8 deletions
diff --git a/gnuradio-core/src/lib/general/gr_skiphead.cc b/gnuradio-core/src/lib/general/gr_skiphead.cc index c887376e4..7b441bea9 100644 --- a/gnuradio-core/src/lib/general/gr_skiphead.cc +++ b/gnuradio-core/src/lib/general/gr_skiphead.cc @@ -43,14 +43,14 @@ gr_make_skiphead (size_t itemsize, uint64_t nitems_to_skip) int gr_skiphead::general_work(int noutput_items, - gr_vector_int &ninput_items_ignored, + gr_vector_int &ninput_items_, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { const char *in = (const char *) input_items[0]; char *out = (char *) output_items[0]; - int ninput_items = noutput_items; // we've got at least this many input items + int ninput_items = std::min(ninput_items_[0], noutput_items); int ii = 0; // input index while (ii < ninput_items){ diff --git a/gnuradio-core/src/lib/general/gri_control_loop.cc b/gnuradio-core/src/lib/general/gri_control_loop.cc index 5a93737f9..bb3c4a326 100644 --- a/gnuradio-core/src/lib/general/gri_control_loop.cc +++ b/gnuradio-core/src/lib/general/gri_control_loop.cc @@ -144,6 +144,17 @@ gri_control_loop::set_phase(float phase) d_phase += M_TWOPI; } +void +gri_control_loop::set_max_freq(float freq) +{ + d_max_freq = freq; +} + +void +gri_control_loop::set_min_freq(float freq) +{ + d_min_freq = freq; +} /******************************************************************* GET FUNCTIONS @@ -185,3 +196,15 @@ gri_control_loop::get_phase() const { return d_phase; } + +float +gri_control_loop::get_max_freq() const +{ + return d_max_freq; +} + +float +gri_control_loop::get_min_freq() const +{ + return d_min_freq; +} diff --git a/gnuradio-core/src/lib/general/gri_control_loop.h b/gnuradio-core/src/lib/general/gri_control_loop.h index df260d2cf..304857ac7 100644 --- a/gnuradio-core/src/lib/general/gri_control_loop.h +++ b/gnuradio-core/src/lib/general/gri_control_loop.h @@ -141,9 +141,9 @@ class GR_CORE_API gri_control_loop void set_beta(float beta); /*! - * \brief Set the Costas loop's frequency. + * \brief Set the control loop's frequency. * - * Set's the Costas Loop's frequency. While this is normally updated by the + * Set's the control loop's frequency. While this is normally updated by the * inner loop of the algorithm, it could be useful to manually initialize, * set, or reset this under certain circumstances. * @@ -153,9 +153,9 @@ class GR_CORE_API gri_control_loop void set_frequency(float freq); /*! - * \brief Set the Costas loop's phase. + * \brief Set the control loop's phase. * - * Set's the Costas Loop's phase. While this is normally updated by the + * Set's the control loop's phase. While this is normally updated by the * inner loop of the algorithm, it could be useful to manually initialize, * set, or reset this under certain circumstances. * @@ -164,6 +164,23 @@ class GR_CORE_API gri_control_loop */ void set_phase(float phase); + /*! + * \brief Set the control loop's maximum frequency. + * + * Set the maximum frequency the control loop can track. + * + * \param freq (float) new max frequency + */ + void set_max_freq(float freq); + + /*! + * \brief Set the control loop's minimum frequency. + * + * Set the minimum frequency the control loop can track. + * + * \param freq (float) new min frequency + */ + void set_min_freq(float freq); /******************************************************************* GET FUNCTIONS @@ -190,14 +207,24 @@ class GR_CORE_API gri_control_loop float get_beta() const; /*! - * \brief Get the Costas loop's frequency estimate + * \brief Get the control loop's frequency estimate */ float get_frequency() const; /*! - * \brief Get the Costas loop's phase estimate + * \brief Get the control loop's phase estimate */ float get_phase() const; + + /*! + * \brief Get the control loop's maximum frequency. + */ + float get_max_freq() const; + + /*! + * \brief Get the control loop's minimum frequency. + */ + float get_min_freq() const; }; #endif /* GRI_CONTROL_LOOP */ |