WienerInterpolator.h

Go to the documentation of this file.
00001 #ifndef WIENERINTERPOLATOR_H_
00002 #define WIENERINTERPOLATOR_H_
00003 #include <boost/numeric/ublas/matrix.hpp>
00004 #include <boost/numeric/ublas/vector.hpp>
00005 #include "LSSOFilter.h"
00006 
00007 /** \addtogroup sigproc Signal processing methods */
00008 /* @{ */
00009 
00010 /*!*********************************************
00011  * WienerInterpolator implements a linear prediction filter
00012  * as described in Numerical Recipes, p. 566 , it uses the autocorrelation
00013  * structure of the input data to predict the next sample
00014  * Although it  does not work exactly like the adaptive filters it is part of
00015  * the class hierachy for now. The prediction coefficients are stored as Weights, but
00016  * in opposite order to NR memcof, so they can be immediately used for prediction
00017  */
00018  
00019 class WienerInterpolator: public LSSOFilter
00020 {
00021 private:
00022     //! The prediction error within the window used to calculate the filter coefficients
00023         double xms;
00024 public:
00025    //! Return the prediction error
00026         double GetXms() const {return xms;}
00027         //! Calculate the prediction coefficients, the contents of Desired are ignored, this function has to be implemented in the filter class hieraychy
00028         virtual void AdaptFilter(const gplib::rvec &Input, const gplib::rvec &Desired) ;
00029         //! A more convenient method to get the prediction coefficients, but unique to this class
00030         gplib::rvec CalcCoefficients(const gplib::rvec &Input){AdaptFilter(Input,Input); return GetWeights();}
00031     //! The constructor needs to know the filterlength
00032         WienerInterpolator(const int filterlength);
00033         virtual ~WienerInterpolator();
00034 };
00035 /* @} */
00036 #endif /*WIENERINTERPOLATOR_H_*/

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