OpendTect  6.3
hilberttransform.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: Nanne Hemstra
8  Date: December 2007
9 ________________________________________________________________________
10 
11 -*/
12 
13 #include "algomod.h"
14 #include "transform.h"
15 #include "bufstring.h"
16 
17 class ArrayNDInfo;
18 template <class T> class ValueSeries;
19 template <class T> class ArrayND;
20 
21 
27 {
28 public:
29  HilbertTransform();
30  ~HilbertTransform();
31 
32  bool setInputInfo(const ArrayNDInfo&);
33  const ArrayNDInfo& getInputInfo() const { return *info_; }
34 
35  bool real2real() const { return true; }
36  bool real2complex() const { return false; }
37  bool complex2real() const { return false; }
38  bool complex2complex() const { return false; }
39 
40  bool biDirectional() const { return false; }
41  bool setDir(bool fw) { return fw; }
42  bool getDir() const { return forward_; }
43 
44  bool init();
45  void setHalfLen( int hl ) { halflen_ = hl; }
46  void setCalcRange(int startidx,int convstartidx);
47 
48  /*<! Will handle some undefined values
49  BUT will be very slow if there are mostly
50  undefined values.
51  Returns unchanged output if all input values are
52  undefined
53  */
54  bool transform(const float*,int szin,float*,int szout) const;
55  bool transform(const ValueSeries<float>&,int szin,
56  ValueSeries<float>&,int szout) const;
57  bool transform(const ArrayND<float>&,ArrayND<float>&) const;
58  bool transform(const ArrayND<float_complex>&,
59  ArrayND<float_complex>&) const;
60  bool transform(const ArrayND<float>&,
61  ArrayND<float_complex>&) const;
62 
63  uiString errMsg() const { return errmsg_; }
64 
65 protected:
66 
67  float* makeHilbWindow(int);
68  bool isPossible(int) const;
69  bool isFast( int ) const { return true; }
70 
71  bool transform(const float*,int szin,float*,int szout,
72  const ValueSeries<float>* in) const;
73 
74  bool forward_;
76  int halflen_;
77  float* hilbwindow_;
79  int startidx_;
81 
82  mutable uiString errmsg_;
83 };
#define mExpClass(module)
Definition: commondefs.h:157
void setHalfLen(int hl)
Definition: hilberttransform.h:45
int convstartidx_
Definition: hilberttransform.h:80
uiString errmsg_
Definition: hilberttransform.h:82
bool complex2complex() const
Definition: hilberttransform.h:38
float * hilbwindow_
Definition: hilberttransform.h:77
const ArrayNDInfo & getInputInfo() const
Definition: hilberttransform.h:33
uiString errMsg() const
Definition: hilberttransform.h:63
bool init()
Contains the information about the size of ArrayND, and in what order the data is stored (if accessab...
Definition: arrayndinfo.h:21
int startidx_
Definition: hilberttransform.h:79
bool complex2real() const
Definition: hilberttransform.h:37
Definition: uistring.h:88
bool real2real() const
Definition: hilberttransform.h:35
bool forward_
Definition: hilberttransform.h:74
int nrsamples_
Definition: hilberttransform.h:75
bool biDirectional() const
Definition: hilberttransform.h:40
bool isFast(int) const
Definition: hilberttransform.h:69
Interface to a series of values.
Definition: odmemory.h:15
An ArrayND is an array with a given number of dimensions and a size.
Definition: arraynd.h:29
bool real2complex() const
Definition: hilberttransform.h:36
BufferString errmsg_
Definition: horizontracker.h:117
int halflen_
Definition: hilberttransform.h:76
bool setDir(bool fw)
Definition: hilberttransform.h:41
bool getDir() const
Definition: hilberttransform.h:42
Class to compute Hilbert Transform.
Definition: hilberttransform.h:26
ArrayNDInfo * info_
Definition: hilberttransform.h:78

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2017