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 TDSPCORRELATIONFILTER_H 00019 #define TDSPCORRELATIONFILTER_H 00020 00021 #include <TDSPFilter.h> 00022 00029 enum eCorrFilterMethod { 00030 kCorrFilterYule, 00031 kCorrFilterProny 00032 }; 00033 00034 enum eCorrFilterOptions { 00035 kCorrFilterNormalize = 0x1 00036 }; 00037 00038 class TDSPCorrelationFilter : virtual public TDSPFilter { 00039 00040 protected: 00041 eCorrFilterMethod fMethod; // The Method 00042 UInt_t fAR,fMA; // Filter-Dimension AR=FIR, MA=IIR (=0 defaults) 00043 TDSPSignal *fCorrelation; // the Signal vector containing the discrete correlation function 00044 UInt_t fOptions; // Options 00045 00046 public: 00047 00048 TDSPCorrelationFilter(); 00049 ~TDSPCorrelationFilter(); 00050 00051 void Init(Double_t MaxTime=1, 00052 Int_t Entries=100); // Initialize the Filter / Calculate the Filter 00053 virtual Double_t Correlation(Double_t); // Calculates the Correlation for a given time delay 00054 TDSPSignal* GetCorrelation() { return fCorrelation;}; 00055 eCorrFilterMethod GetMethod() { return fMethod;}; // Get the Current Method 00056 void SetMethod(eCorrFilterMethod m) { fMethod = m;}; // Set the Method 00057 void SetAR(UInt_t ar) { fAR = ar;}; // Set the Number of AR-Parameters 00058 UInt_t GetAR() { return fAR;}; // Get the Number of AR-Parameters 00059 void SetMA(UInt_t ma) { fMA = ma;}; // Set the Number of AM-Parameters 00060 UInt_t GetMA() { return fMA;}; // Get the Number of AM-Parameters 00061 void SetARMA(UInt_t ar, UInt_t ma); // Set the Number of AR- and MA-Parameters 00062 00063 void EnableOption(eCorrFilterOptions o) { // Enable a option 00064 fOptions |= o; } 00065 void DisableOption(eCorrFilterOptions o) {// Disable a option 00066 fOptions &= !o; } 00067 00068 virtual void Test(); 00069 00070 ClassDef(TDSPCorrelationFilter,1) 00071 00072 }; 00073 00074 00075 inline void TDSPCorrelationFilter::SetARMA(UInt_t ar, UInt_t ma) { 00076 SetAR(ar); 00077 SetMA(ma); 00078 } 00079 00080 #endif
1.3.2