3 #ifndef __hilbert_transform_inline_hpp
4 #define __hilbert_transform_inline_hpp
6 template <
typename FFT_T>
10 if (direction != -1 && direction != 1)
12 printf (
"S2Corr::hilbertTransform: warning: incorrect direction (%d), fixed to 1.\n",
18 fft.setRotateFlag(
true);
20 #warning proper t0 calc should be fixed in CDFT2D_FFTW
27 if (!fft.calc(trace, trace_im))
29 printf (
"S2Corr::hilbertTransform: error: can't calc direct FFT.\n");
34 for (
size_t i=0; i<trace.
size(); i++)
37 double sig_w = (w>0)?1:(-1);
41 double re = direction*sig_w*trace_im[i];
42 trace_im[i] = -direction*sig_w*trace[i];
48 if (!fft.calc(trace, trace_im))
50 printf (
"S2Corr::hilbertTransform: error: can't calc inverse FFT.\n");
bool transform(FFT_T &fft, Trace &trace, int direction=1)
Definition: hilbert_transform_inline.hpp:7
const Header & header() const
Definition: trace.hpp:196