00001 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef TDSPLMMSE_H 00019 #define TDSPLMMSE_H 00020 00021 #include <TDSPEstimator.h> 00022 00034 class TDSPLmmse : public TDSPEstimator { 00035 00036 TDSPMatrix* fEstimatorMatrix; 00037 00038 // for a linear equation y=Hx+n 00039 00040 TComplex fNoiseScaler; // a Scaler to the Noise Covariance-Matrix scale * E[nn*] 00041 TDSPMatrix *fNoiseCovariance; // The Noise Covariance-Matrix E[nn*] 00042 TDSPMatrix *fXCovariance; // The Covariance-Matrix of the input data E[xx*] 00043 TDSPMatrix *fH; // The Matrix H in y=Hx+n 00044 00045 TDSPMatrix *fHCxHStar; // this H Cx H^* 00046 TDSPMatrix *fPost; // Postmultiplication (from right) ... 00047 00048 Bool_t _recalc1,_recalc2; // several recalculation steps 00049 Bool_t _my_x_matrix, _my_noise_matrix; // internal or external matrices ?? 00050 00051 void _init(); 00052 void recalc1() { _recalc1=kTRUE;}; 00053 void recalc2() { _recalc2=kTRUE;}; 00054 00055 void default_noise_covariance(Int_t rows, Int_t cols); // Set default noise covariance (unit matrix) 00056 void default_x_covariance(Int_t rows, Int_t cols); // Set default x covariance (unit matrix) 00057 void updatefHCxHStar(); 00058 00059 public: 00060 TDSPLmmse(); 00061 TDSPLmmse(TDSPMatrix* H); 00062 TDSPLmmse(TDSPMatrix* H, TDSPMatrix* Cx, TDSPMatrix* Cn); 00063 00064 ~TDSPLmmse(); 00065 00066 TDSPVector* Estimate(TDSPVector* y); // Estimate 00067 void Calculate(); 00068 00069 void SetMatrix(TDSPMatrix*h) { fH = h;recalc1();recalc2();}; 00070 TDSPMatrix* GetMatrix() const { return fH;}; 00071 void SetPostMatrix(TDSPMatrix *h) {fPost = h;}; 00072 TDSPMatrix* GetPostMatrix() const { return fPost;}; 00073 void SetXCovariance(TDSPMatrix*c); 00074 TDSPMatrix* GetXCovariance() const { return fXCovariance;}; 00075 void SetNoiseCovariance(TDSPMatrix*c); 00076 TDSPMatrix* GetNoiseCovariance() const { return fNoiseCovariance;}; 00077 void SetNoise(TComplex sigma2) { fNoiseScaler=sigma2;recalc2();}; 00078 TComplex GetNoise() const { return fNoiseScaler;}; 00079 00080 TDSPMatrix* GetEstimatorMatrix() { Calculate();return fEstimatorMatrix;}; 00081 00082 ClassDef(TDSPLmmse,1) 00083 00084 }; 00085 00086 inline TDSPVector* TDSPLmmse::Estimate(TDSPVector* y) { 00087 Calculate(); 00088 if (fEstimatorMatrix) { 00089 fEstimatorMatrix->RightApply(y,fEstimate); 00090 } else { 00091 Error("Estimate","No Estimation Matrix specified !!"); 00092 return NULL; 00093 } 00094 return fEstimate; 00095 } 00096 00097 #endif
1.3.2