GPLIB++
tsfuncs.h
Go to the documentation of this file.
1 #include <math.h>
2 
3 namespace gplib
4  {
5  /** \addtogroup mttools MT data analysis, processing and inversion */
6  /* @{ */
7 
8  inline bool IsSpikeAbsolute(const double prediff, const double postdiff,
9  const double currvalue, const double Threshold)
10  {
11  if ((prediff * postdiff < 0) && (currvalue > Threshold))
12  return (true);
13  else
14  return (false);
15  }
16 
17  inline bool IsSpikePreRel(const double prediff, const double postdiff,
18  const double currvalue, const double Threshold)
19  {
20  if ((prediff * postdiff < 0) && (std::abs(prediff) > Threshold))
21  return (true);
22  else
23  return (false);
24  }
25 
26  inline bool IsSpikePostRel(const double prediff, const double postdiff,
27  const double currvalue, const double Threshold)
28  {
29  if ((prediff * postdiff < 0) && (std::abs(postdiff) > Threshold))
30  return (true);
31  else
32  return (false);
33  }
34 
35  inline bool IsSpikeAnyRel(const double prediff, const double postdiff,
36  const double currvalue, const double Threshold)
37  {
38  if ((prediff * postdiff < 0) && ((std::abs(postdiff) > Threshold) || (fabs(
39  prediff) > Threshold)))
40  return (true);
41  else
42  return (false);
43  }
44 
45  inline bool IsSpikeBothRel(const double prediff, const double postdiff,
46  const double currvalue, const double Threshold)
47  {
48  if ((prediff * postdiff < 0) && ((std::abs(postdiff) > Threshold) && (fabs(
49  prediff) > Threshold)))
50  return (true);
51  else
52  return (false);
53 
54  }
55  /* @} */
56  }
bool IsSpikeBothRel(const double prediff, const double postdiff, const double currvalue, const double Threshold)
Definition: tsfuncs.h:45
bool IsSpikeAbsolute(const double prediff, const double postdiff, const double currvalue, const double Threshold)
Definition: tsfuncs.h:8
bool IsSpikePostRel(const double prediff, const double postdiff, const double currvalue, const double Threshold)
Definition: tsfuncs.h:26
bool IsSpikeAnyRel(const double prediff, const double postdiff, const double currvalue, const double Threshold)
Definition: tsfuncs.h:35
bool IsSpikePreRel(const double prediff, const double postdiff, const double currvalue, const double Threshold)
Definition: tsfuncs.h:17