| 
    BornAgain
    1.19.0
    
   Simulate and fit neutron and x-ray scattering at grazing incidence 
   | 
 
Fourier transform of vectors (in 1D or 2D) using Fast Fourier Transform (fftw package). More...
Classes | |
| class | Workspace | 
| Workspace for Fourier Transform.  More... | |
Public Types | |
| typedef std::vector< double > | double1d_t | 
| definition of 1D vector of double  More... | |
| typedef std::vector< double1d_t > | double2d_t | 
| definition of 2D vector of double  More... | |
Public Member Functions | |
| FourierTransform () | |
| void | fft (const double1d_t &source, double1d_t &result) | 
| FT in 1D.  More... | |
| void | fft (const double2d_t &source, double2d_t &result) | 
| FT in 2D.  More... | |
| void | fftshift (double1d_t &result) | 
| Shift low frequency to the center of 1D FT array.  More... | |
| void | fftshift (double2d_t &result) | 
| Shift low frequency to the center of 2D FT array.  More... | |
| void | init (int h_src, int w_src) | 
| prepare arrays for 2D Fourier Transformation (FT) of the given vector  More... | |
Private Member Functions | |
| void | fftw_forward_FT (const double2d_t &source) | 
| compute FT of source using Fast Fourier transformation from fftw  More... | |
Private Attributes | |
| Workspace | ws | 
| input and output data for fftw3  More... | |
Fourier transform of vectors (in 1D or 2D) using Fast Fourier Transform (fftw package).
Usage: std::vector<double> signal, result; FourierTransform ft; ft.fft(signal, result)
Given code rely on code from Jeremy Fix page, http://jeremy.fix.free.fr/spip.php?article15, see also "Efficient convolution using the Fast Fourier Transform, Application in C++" by Jeremy Fix, May 30, 2011
Definition at line 39 of file FourierTransform.h.
| typedef std::vector<double> FourierTransform::double1d_t | 
definition of 1D vector of double
Definition at line 42 of file FourierTransform.h.
| typedef std::vector<double1d_t> FourierTransform::double2d_t | 
definition of 2D vector of double
Definition at line 45 of file FourierTransform.h.
      
  | 
  default | 
| void FourierTransform::fft | ( | const double1d_t & | source, | 
| double1d_t & | result | ||
| ) | 
FT in 1D.
Definition at line 123 of file FourierTransform.cpp.
| void FourierTransform::fft | ( | const double2d_t & | source, | 
| double2d_t & | result | ||
| ) | 
FT in 2D.
Definition at line 58 of file FourierTransform.cpp.
References fftw_forward_FT(), FourierTransform::Workspace::h_fftw, init(), FourierTransform::Workspace::out_fftw, FourierTransform::Workspace::w_fftw, and ws.
| void FourierTransform::fftshift | ( | double1d_t & | result | ) | 
Shift low frequency to the center of 1D FT array.
Definition at line 141 of file FourierTransform.cpp.
| void FourierTransform::fftshift | ( | double2d_t & | result | ) | 
Shift low frequency to the center of 2D FT array.
Definition at line 95 of file FourierTransform.cpp.
References FourierTransform::Workspace::h_fftw, and ws.
      
  | 
  private | 
compute FT of source using Fast Fourier transformation from fftw
Definition at line 191 of file FourierTransform.cpp.
References FourierTransform::Workspace::h_fftw, FourierTransform::Workspace::h_src, FourierTransform::Workspace::in_src, FourierTransform::Workspace::out_fftw, FourierTransform::Workspace::p_forw_src, FourierTransform::Workspace::w_fftw, FourierTransform::Workspace::w_src, and ws.
Referenced by fft().
| void FourierTransform::init | ( | int | h_src, | 
| int | w_src | ||
| ) | 
prepare arrays for 2D Fourier Transformation (FT) of the given vector
Definition at line 156 of file FourierTransform.cpp.
References FourierTransform::Workspace::clear(), FourierTransform::Workspace::h_fftw, FourierTransform::Workspace::h_src, FourierTransform::Workspace::in_src, FourierTransform::Workspace::out_fftw, FourierTransform::Workspace::p_forw_src, FourierTransform::Workspace::w_fftw, FourierTransform::Workspace::w_src, and ws.
Referenced by fft().
      
  | 
  private | 
input and output data for fftw3
Definition at line 94 of file FourierTransform.h.
Referenced by fft(), fftshift(), fftw_forward_FT(), and init().