GCpp general purpose C++ library  version 1.0
GFFTDianelsonLanczos.hh
Go to the documentation of this file.
1 //======================================================================
2 /*! \file GFFTDianelsonLanczos.hh
3  *
4  * Include file for the Fast Fourier Transform (FFT) functions using the
5  * Danielson-Lanczos algorithm (see \ref FFT_Dianelson_Lanczos).
6  */
7 //======================================================================
8 
9 #ifndef G_FFT_DIANELSON_LANCZOS_HH
10 #define G_FFT_DIANELSON_LANCZOS_HH
11 
12 //======================================================================
13 
14 #include <math.h>
15 #include "GGlobal.hh"
16 #include "GBaseFunctions.hh"
17 #include "GStringFunctions.hh"
18 #include "GString.hh"
19 
20 //! Pi value
21 #define FFT_PI M_PIl
22 //! 2*Pi value
23 #define FFT_2PI (2*M_PIl)
24 
25 //! Conversion factor from standard deviation to FWHM
26 #define FFT_SIGMA_TO_FWHM 2.354820045030949327014013761072419583797L
27 //! Conversion factor from FWHM to standard deviation
28 #define FFT_FWHM_TO_SIGMA 0.424660900144009534340483469350147061050L
29 
30 //! Swap 2 double values
31 #define SWAP_DOUBLE(a,b) {double _tmp=(a);(a)=(b);(b)=_tmp;}
32 
33 
34 // Error codes for FFT functions
35 
36 //! Bad array dimension (typically not a power of 2)
37 #define GFFT_DIM_ERROR 1
38 //! Invalid transform mode
39 #define GFFT_MODE_ERROR 2
40 //! Memory allocation error
41 #define GFFT_ALLOC_ERROR 3
42 
43 //======================================================================
44 // FFT BASE FUNCTIONS
45 
46 extern bool GFFTCheckDim ( u_int n );
47 extern u_int GFFTGetPower2Dim ( u_int n );
48 
49 extern int GFFTBaseComplex ( double data[], u_int n, bool inv = false );
50 extern int GFFTComplex ( double f_in[], double f_out[], u_int n, bool inv = false);
51 extern int GFFTReal2 ( double f_in1[], double f_in2[], double f_out1[], double f_out2[], u_int n, bool inv = false);
52 
53 extern int GFFTBaseReal ( double data[], u_int n, bool inv = false );
54 extern int GFFTReal ( double f_in[], double f_out[], u_int n, bool inv = false);
55 
56 //======================================================================
57 #endif
int GFFTBaseReal(double data[], u_int n, bool inv)
Definition: GFFTDianelsonLanczos.cpp:299
bool GFFTCheckDim(u_int n)
Definition: GFFTDianelsonLanczos.cpp:17
int GFFTComplex(double f_in[], double f_out[], u_int n, bool inv)
Definition: GFFTDianelsonLanczos.cpp:166
int GFFTReal2(double f_in1[], double f_in2[], double f_out1[], double f_out2[], u_int n, bool inv)
Definition: GFFTDianelsonLanczos.cpp:215
int GFFTBaseComplex(double data[], u_int n, bool inv)
Definition: GFFTDianelsonLanczos.cpp:73
u_int GFFTGetPower2Dim(u_int n)
Definition: GFFTDianelsonLanczos.cpp:37
int GFFTReal(double f_in[], double f_out[], u_int n, bool inv)
Definition: GFFTDianelsonLanczos.cpp:387
unsigned int u_int
Definition: GTypes.hh:38