CRFSpecElement.h

Go to the documentation of this file.
00001 #ifndef CRFSPECELEMENT_H_
00002 #define CRFSPECELEMENT_H_
00003 #include <functional>
00004 #include "types.h"
00005 
00006 namespace gplib
00007   {
00008     /** \addtogroup seistools Seismic data analysis and modeling */
00009     /* @{ */
00010 
00011     //! This class calculates one spectral element of the receiver function from the two input spectral elements
00012     /*! The constructor takes the absolute value of the waterlevel, the overloaded operator() takes
00013      * two complex numbers as arguments to calculate the resulting spectral value of the receiver function
00014      * and can be used with standard algorithms like transform
00015      */
00016     class CalcSpectralElement: public std::binary_function<tcomp, tcomp, tcomp>
00017       {
00018     private:
00019       tcomp DivThreshold;
00020     public:
00021       CalcSpectralElement(tcomp t) :
00022         DivThreshold(t)
00023         {
00024         }
00025       tcomp operator()(const tcomp rad, const tcomp ver) const
00026         {
00027           return rad * conj(ver) / std::max(abs(ver * conj(ver)), abs(
00028               DivThreshold));
00029         }
00030       };
00031   /* @} */
00032   }
00033 #endif /*CRFSPECELEMENT_H_*/

Generated on Tue May 4 16:52:14 2010 for GPLIB++ by  doxygen 1.5.8