RLSCanceller.h

Go to the documentation of this file.
00001 #ifndef RLSCANCELLER_H
00002 #define RLSCANCELLER_H
00003 
00004 #include "LSSOFilter.h"
00005 #include "VecMat.h"
00006 namespace ublas = boost::numeric::ublas;
00007 
00008 namespace gplib
00009   {
00010 
00011     /** \addtogroup sigproc Signal processing methods */
00012     /* @{ */
00013     //! Implements a recursive least-squares adaptive filter, as described in Haykin, p. 443
00014     /*! The RLS filter is a more eeffective, but computationally much more expensive version
00015      * of the LMS filter.
00016      */
00017     class RLSCanceller: public LSSOFilter
00018       {
00019     private:
00020       double delta;
00021       double lambda;
00022       gplib::rmat P;
00023       gplib::rvec pi;
00024       gplib::rvec k;
00025     protected:
00026       const gplib::rmat &GetP()
00027         {
00028           return P;
00029         }
00030       const gplib::rvec &GetPi()
00031         {
00032           return pi;
00033         }
00034       const gplib::rvec &GetK()
00035         {
00036           return k;
00037         }
00038     public:
00039       //! Set the forgetting factor \f$ \lambda \f$, usually \f$ \lambda \ll 1 \f$
00040       void SetLambda(const double Mylambda)
00041         {
00042           lambda = Mylambda;
00043         }
00044       //! Get the current forgetting factor
00045       double GetLambda()
00046         {
00047           return lambda;
00048         }
00049       //! Set the regularization factor
00050       void SetDelta(const double Mydelta)
00051         {
00052           delta = Mydelta;
00053         }
00054       double GetDelta()
00055         {
00056           return delta;
00057         }
00058       virtual void
00059       AdaptFilter(const gplib::rvec &Input, const gplib::rvec &Desired);
00060       RLSCanceller(const int inputsize);
00061       RLSCanceller(const int inputsize, const double MyDelta,
00062           const double MyLambda);
00063       virtual ~RLSCanceller();
00064       };
00065   /* @} */
00066   }
00067 #endif // RLSCANCELLER_H

Generated on Tue May 4 16:52:15 2010 for GPLIB++ by  doxygen 1.5.8