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

Generated on Fri Jul 4 15:30:21 2008 for GPLIB++ by  doxygen 1.5.5