 |
OpendTect
6.6
|
Go to the documentation of this file.
8 #include "ceemdattribmod.h"
16 #define mDecompModeEMD 0
17 #define mDecompModeEEMD 1
18 #define mDecompModeCEEMD 2
20 #define mDecompOutputFreq 0
21 #define mDecompOutputPeakFreq 1
22 #define mDecompOutputPeakAmp 2
23 #define mDecompOutputIMF 3
30 : values_( new float[nrsamples] )
35 : values_( new float[comp.size_] )
38 , nrzeros_( comp.nrzeros_ )
40 for (
int idx=0; idx<size_; idx++ )
41 values_[idx] = comp.
values_[idx];
68 {
return itype_ == Snap ? snapVal(x) : myInterpVal(x); }
72 const int sz = x_.size();
73 if ( sz < 1 )
return mUdf(
float);
75 if ( x < x_[0] || x > x_[sz-1] )
76 return myOutsideVal(x);
80 const int i0 = baseIdx( x );
81 const float v0 = y_[i0];
85 const float x0 = x_[i0];
86 const int i1 = i0 + 1;
87 const float x1 = x_[i1];
88 const float v1 = y_[i1];
89 const float dx = x1 - x0;
90 if ( dx == 0 )
return v0;
92 const float relx = (x - x0) / dx;
94 return relx < 0.5 ? v0 : v1;
101 return v1 * relx + v0 * (1-relx);
103 const int im1 = i0 > 0 ? i0 - 1 : i0;
104 const float xm1 = im1 == i0 ? x0 - dx : x_[im1];
105 const float vm1 =
mIsUdf(y_[im1]) ? v0 : y_[im1];
107 const int i2 = i1 < sz-1 ? i1 + 1 : i1;
108 const float x2 = i2 == i1 ? x1 + dx : x_[i2];
109 const float v2 =
mIsUdf(y_[i2]) ? v1 : y_[i2];
121 if ( extrapol_==
None )
return mUdf(
float);
123 const int sz = x_.size();
125 if ( extrapol_==EndVal || sz<2 )
127 return x-x_[0] < x_[sz-1]-x ? y_[0] : y_[sz-1];
132 const float gradient =
134 mUdf(
float) : (y_[1]-y_[0])/(x_[1]-x_[0]);
135 return y_[0]+(x-x_[0])*gradient;
138 const float gradient =
139 mIsZero(x_[sz-1]-x_[sz-2], 1e-3 ) ?
140 mUdf(
float) : (y_[sz-1]-y_[sz-2])/(x_[sz-1]-x_[sz-2]);
141 return y_[sz-1] + (x-x_[sz-1])*gradient;
149 : values_( new float[nrsamples] )
196 : values_( new float[nrsamples] )
205 float startfreq,
float endfreq,
float stepoutfreq,
206 int startcomp,
int endcomp);
225 int comp,
int nrzeros)
const;
230 bool symmetricboundary ,
238 int maxnrimf ,
float stdevinput)
const;
246 & currentrealizations,
248 currentstackedcomponents,
252 & realizations)
const;
255 realizations )
const;
265 const float refstep)
const;
273 amplitudecomponents)
const;
278 float startfreq,
float endfreq,
float stepoutfreq,
279 int startcomp,
int outputcomp,
float average)
const;
284 float endfreq,
float stepoutfreq)
const;
289 float endfreq,
float stepoutfreq)
const;
291 float* unsortedfrequencies,
float* unsortedamplitudes,
mDefSetupMemb(bool, outputfreq)
mDefSetupMemb(bool, outputcomp)
T poly1D(float x0, T v0, float x1, T v1, float x2, T v2, float x3, T v3, float x)
Definition: interpol1d.h:217
void memValueSet(T *, T, int64_t, TaskRunner *taskrun=0)
Definition: odmemory.h:479
IMFComponent(const IMFComponent &comp)
Definition: ceemdalgo.h:34
MyPointBasedMathFunction(PointBasedMathFunction::InterpolType t=PointBasedMathFunction::Poly, PointBasedMathFunction::ExtrapolType e=PointBasedMathFunction::ExtraPolGradient)
Definition: ceemdalgo.h:56
~OrgTraceMinusAverage()
Definition: ceemdalgo.h:152
BufferString name_
Definition: ceemdalgo.h:153
#define mIsEqual(x, y, eps)
Definition: commondefs.h:67
mDefSetupMemb(bool, usetestdata)
Definition: ceemdalgo.h:27
#define mIsUdf(val)
Use mIsUdf to check for undefinedness of simple types.
Definition: undefval.h:289
float myOutsideVal(float x) const
Definition: ceemdalgo.h:119
#define mExpClass(module)
Definition: commondefs.h:177
mDefSetupMemb(float, noisepercentage)
mDefSetupMemb(int, method)
~IMFComponent()
Definition: ceemdalgo.h:44
mDefSetupMemb(bool, symmetricboundary)
ExtrapolType
Definition: mathfunc.h:155
float myInterpVal(float x) const
Definition: ceemdalgo.h:70
IMFComponent(int nrsamples)
Definition: ceemdalgo.h:29
@ ExtraPolGradient
Definition: mathfunc.h:155
float averageinput_
Definition: ceemdalgo.h:154
int size_
Definition: ceemdalgo.h:47
@ Poly
Definition: mathfunc.h:154
BufferString name_
Definition: ceemdalgo.h:45
ObjectSet where the objects contained are owned by this set.
Definition: manobjectset.h:57
int size(int icomp=0) const
Definition: tracedata.h:55
mDefSetupMemb(float, stopsift)
MathFunction based on bend points.
Definition: mathfunc.h:151
mDefSetupMemb(float, stopimf)
mDefSetupMemb(int, maxnoiseloop)
InterpolType
Definition: mathfunc.h:154
OrgTraceMinusAverage(int nrsamples)
Definition: ceemdalgo.h:148
float stdev_
Definition: ceemdalgo.h:155
float myGetValue(float x) const
Definition: ceemdalgo.h:67
mDefSetupMemb(int, maxnrimf)
#define mIsZero(x, eps)
Definition: commondefs.h:66
mDefSetupMemb(bool, stepoutfreq)
@ Linear
Definition: simpnumer.h:189
Definition: ceemdalgo.h:161
int size_
Definition: ceemdalgo.h:156
float * values_
Definition: ceemdalgo.h:48
float * values_
Definition: ceemdalgo.h:157
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size.
Definition: bufstring.h:40
@ None
Definition: networkcommon.h:33
void replace(int idx, float x, float y)
Definition: ceemdalgo.h:62
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:274
int nrzeros_
Definition: ceemdalgo.h:46
mDefSetupMemb(int, maxsift)
Definition: ceemdalgo.h:53
mDefSetupMemb(int, attriboutput)
Definition: ceemdalgo.h:146
Generated at
for the OpendTect
seismic interpretation project.
Copyright (C): dGB Beheer B.V. 1995-2021