00001
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef TDSPFILTERBANK_H
00019 #define TDSPFILTERBANK_H
00020
00021 #include <TNamed.h>
00022 #include <TH2.h>
00023 #include <TDSPRating.h>
00024 #include <TDSPVector.h>
00025 #include <TDSPMatrix.h>
00026
00031 #define OPT_MY_FILTERMATRIX 0x1
00032 #define OPT_DFT_FILTERBANK 0x2
00033
00034 class TDSPFilterBank : public TNamed, virtual public TDSPRating {
00035
00036 private:
00037
00038 Bool_t _isMyMatrix() { return fOpt&OPT_MY_FILTERMATRIX;};
00039 void _enableMyMatrix() { fOpt|=OPT_MY_FILTERMATRIX;};
00040 void _disableMyMatrix() { fOpt&=(!OPT_MY_FILTERMATRIX);};
00041
00042
00043 Bool_t _isDFT() { return fOpt&OPT_DFT_FILTERBANK;};
00044 void _enableDFT() { fOpt|=OPT_DFT_FILTERBANK;};
00045 void _disableDFT() { fOpt&=(!OPT_DFT_FILTERBANK);};
00046
00047 Bool_t _IsReady();
00048 void _CleanMe();
00049 void _MinMaxSubSampling();
00050
00051 void _reset_options();
00052 Int_t fZero;
00053 UInt_t fNumActive;
00054
00055 protected:
00056
00057 UInt_t fOpt;
00058 TDSPMatrix* fFilterBank;
00059 TArrayI fSubSamplings;
00060 UInt_t fMinSubSampling;
00061 UInt_t fMaxSubSampling;
00062 TArrayI fFilterOptions;
00063 TString fMethodStr;
00064
00065
00066
00067 UInt_t fFreqPad;
00068
00069 public:
00070 TDSPFilterBank(UInt_t N=0, UInt_t L=0);
00071 ~TDSPFilterBank();
00072
00073 void SetFilter(UInt_t n, TDSPVector *f);
00074 TDSPVector* GetFilter(UInt_t n, TDSPVector *f=NULL);
00075
00076 void SetMatrix(TDSPMatrix *a);
00077 TDSPMatrix* GetMatrix() const { return fFilterBank;};
00078 void LoadMatrix(char *fname, char *key);
00079
00080 void SetSize(UInt_t N, UInt_t L);
00081 void SetSubSampling(UInt_t n, UInt_t T);
00082 void SetSubSamplings(UInt_t T);
00083 void SetTimePad(UInt_t T) { SetSubSamplings(T);};
00084 void SetFilterOption(UInt_t opt);
00085 void SetFilterOption(UInt_t n, UInt_t opt);
00086 UInt_t GetFilterOption(UInt_t n);
00087 Bool_t IsActive(UInt_t n);
00088 void Activate(UInt_t n);
00089 void Deactivate(UInt_t n);
00090
00091 Bool_t IsCommonSubSampling();
00092 UInt_t GetSubSampling(UInt_t n);
00093 UInt_t GetSubSamplings();
00094 UInt_t GetMaxSubSampling() const { return fMaxSubSampling;};
00095 UInt_t GetMinSubSampling() const { return fMinSubSampling;};
00096
00097 UInt_t GetLength();
00098 UInt_t GetNum();
00099 void SetLength(UInt_t);
00100 void SetNum(UInt_t);
00101 void SetZero(Int_t z) { fZero=z;};
00102 Int_t GetZero() const { return fZero;};
00103
00104
00105 TDSPVector* Synthesize(TDSPVector *input, TDSPVector *output=NULL);
00106 TDSPVector* Analyze( TDSPVector *input, TDSPVector *output=NULL);
00107
00108
00109
00110 virtual void InitFromProtoType(Option_t* method, TDSPVector *input);
00111 virtual void LoadAndInitFromProtoType(Option_t* method,char *fname,char*key=NULL);
00112
00113
00114
00115 UInt_t GetFreqPad() const { return fFreqPad;};
00116 void SetFreqPad(UInt_t f) { fFreqPad=f;};
00117 UInt_t GetNumActiveFilters() const { return fNumActive;};
00118
00119
00120 void Print();
00121
00122
00123
00124 Double_t GetBandWidthEfficiency();
00125
00126
00127
00128 TDSPMatrix* GetDualMatrix(Option_t *method="pseudoinverse");
00129
00130 ClassDef(TDSPFilterBank,1)
00131
00132 };
00133
00134 #endif