summaryrefslogtreecommitdiff
path: root/gr-filter
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2012-06-20 09:10:23 -0400
committerTom Rondeau <trondeau@vt.edu>2012-06-20 09:10:23 -0400
commitedfa18840e2caf738596578acd0bf4efedc88fd1 (patch)
tree0390a469c7bbf16e5645eb4e4700b29ad2a2314c /gr-filter
parentd8830d6dfcb2ddb8d1794c2575019993ca7eb3ad (diff)
filter: added documentation to adaptive_filter blocks.
Diffstat (limited to 'gr-filter')
-rw-r--r--gr-filter/include/filter/adaptive_fir_ccc.h36
-rw-r--r--gr-filter/include/filter/adaptive_fir_ccf.h31
-rw-r--r--gr-filter/lib/adaptive_fir_ccf_impl.cc2
-rw-r--r--gr-filter/lib/adaptive_fir_ccf_impl.h2
4 files changed, 66 insertions, 5 deletions
diff --git a/gr-filter/include/filter/adaptive_fir_ccc.h b/gr-filter/include/filter/adaptive_fir_ccc.h
index b30cd353c3..616a52f735 100644
--- a/gr-filter/include/filter/adaptive_fir_ccc.h
+++ b/gr-filter/include/filter/adaptive_fir_ccc.h
@@ -30,6 +30,35 @@
namespace gr {
namespace filter {
+ /*!
+ * \brief Adaptive FIR filter with gr_complex input, gr_complex output and gr_complex taps
+ * \ingroup filter_blk
+ *
+ * This is a base class to implement an adaptive FIR
+ * filter. Generally, another block will inherit from this one to
+ * build a new type of adaptive filter such as an equalizer.
+ *
+ * This class implements two functions that are designed to be
+ * overloaded by the child class: error(gr_complex out) and
+ * update_tap(gr_complex tap, gr_complex in).
+ *
+ * The error() function calculates the error value that will be
+ * used to adjust the taps. The update_tap function then uses the
+ * error and the input signal value to update a particular
+ * tap. Typically, the error is calculated for a given output and
+ * then this is used in a loop to update all of the filter taps in
+ * a loop:
+ *
+ * \code
+ * d_error = error(sum);
+ * for(k = 0; k < l; k++) {
+ * update_tap(d_taps[ntaps-k-1], in[i+k]);
+ * }
+ * \endcode
+ *
+ * See digital::cma_equalizer_cc and digital::lms_dd_equalizer_cc
+ * for example usage.
+ */
class FILTER_API adaptive_fir_ccc : virtual public gr_sync_decimator
{
public:
@@ -37,8 +66,11 @@ namespace gr {
typedef boost::shared_ptr<adaptive_fir_ccc> sptr;
/*!
- * \brief Adaptive FIR filter with gr_complex input, gr_complex output and float taps
- * \ingroup filter_blk
+ * \brief Adaptive FIR filter with gr_complex input, gr_complex output and gr_complex taps
+ *
+ * \param name Provides a name to identify this type of algorithm
+ * \param decimation (interger) decimation rate of the filter
+ * \param taps (complex) filter taps
*/
static FILTER_API sptr make(const char *name, int decimation,
const std::vector<gr_complex> &taps);
diff --git a/gr-filter/include/filter/adaptive_fir_ccf.h b/gr-filter/include/filter/adaptive_fir_ccf.h
index 0503acd4e5..0c19611d5e 100644
--- a/gr-filter/include/filter/adaptive_fir_ccf.h
+++ b/gr-filter/include/filter/adaptive_fir_ccf.h
@@ -29,6 +29,32 @@
namespace gr {
namespace filter {
+ /*!
+ * \brief Adaptive FIR filter with gr_complex input, gr_complex output and float taps
+ * \ingroup filter_blk
+ *
+ * This is a base class to implement an adaptive FIR
+ * filter. Generally, another block will inherit from this one to
+ * build a new type of adaptive filter such as an equalizer.
+ *
+ * This class implements two functions that are designed to be
+ * overloaded by the child class: error(gr_complex out) and
+ * update_tap(float tap, gr_complex in).
+ *
+ * The error() function calculates the error value that will be
+ * used to adjust the taps. The update_tap function then uses the
+ * error and the input signal value to update a particular
+ * tap. Typically, the error is calculated for a given output and
+ * then this is used in a loop to update all of the filter taps in
+ * a loop:
+ *
+ * \code
+ * d_error = error(sum);
+ * for(k = 0; k < l; k++) {
+ * update_tap(d_taps[ntaps-k-1], in[i+k]);
+ * }
+ * \endcode
+ */
class FILTER_API adaptive_fir_ccf : virtual public gr_sync_decimator
{
public:
@@ -37,7 +63,10 @@ namespace gr {
/*!
* \brief Adaptive FIR filter with gr_complex input, gr_complex output and float taps
- * \ingroup filter_blk
+ *
+ * \param name Provides a name to identify this type of algorithm
+ * \param decimation (interger) decimation rate of the filter
+ * \param taps (real) filter taps
*/
static FILTER_API sptr make(const char *name, int decimation,
const std::vector<float> &taps);
diff --git a/gr-filter/lib/adaptive_fir_ccf_impl.cc b/gr-filter/lib/adaptive_fir_ccf_impl.cc
index 62d7e53371..004a9286bb 100644
--- a/gr-filter/lib/adaptive_fir_ccf_impl.cc
+++ b/gr-filter/lib/adaptive_fir_ccf_impl.cc
@@ -69,7 +69,7 @@ namespace gr {
}
void
- adaptive_fir_ccf_impl::update_tap(gr_complex &tap, const gr_complex &in)
+ adaptive_fir_ccf_impl::update_tap(float &tap, const gr_complex &in)
{
tap = tap;
}
diff --git a/gr-filter/lib/adaptive_fir_ccf_impl.h b/gr-filter/lib/adaptive_fir_ccf_impl.h
index 2a1c7e5e9c..a0c9581ea2 100644
--- a/gr-filter/lib/adaptive_fir_ccf_impl.h
+++ b/gr-filter/lib/adaptive_fir_ccf_impl.h
@@ -41,7 +41,7 @@ namespace gr {
float error(const gr_complex &out);
// Override to calculate new weight from old, corresponding input
- void update_tap(gr_complex &tap, const gr_complex &in);
+ void update_tap(float &tap, const gr_complex &in);
public:
void set_taps(const std::vector<float> &taps);