GPLIB++
CRFSpecElement.h
Go to the documentation of this file.
1 #ifndef CRFSPECELEMENT_H_
2 #define CRFSPECELEMENT_H_
3 #include <functional>
4 #include "types.h"
5 
6 namespace gplib
7  {
8  /** \addtogroup seistools Seismic data analysis and modeling */
9  /* @{ */
10 
11  //! This class calculates one spectral element of the receiver function from the two input spectral elements
12  /*! The constructor takes the absolute value of the waterlevel, the overloaded operator() takes
13  * two complex numbers as arguments to calculate the resulting spectral value of the receiver function
14  * and can be used with standard algorithms like transform
15  */
16  class CalcSpectralElement: public std::binary_function<tcomp, tcomp, tcomp>
17  {
18  private:
19  tcomp DivThreshold;
20  public:
22  DivThreshold(t)
23  {
24  }
25  tcomp operator()(const tcomp rad, const tcomp ver) const
26  {
27  return rad * conj(ver) / std::max(std::abs(ver * conj(ver)), std::abs(
28  DivThreshold));
29  }
30  };
31  /* @} */
32  }
33 #endif /*CRFSPECELEMENT_H_*/
tcomp operator()(const tcomp rad, const tcomp ver) const
This class calculates one spectral element of the receiver function from the two input spectral eleme...