Orfeo Toolbox  3.16
vnl_fft_3d.h
Go to the documentation of this file.
1 // This is vxl/vnl/algo/vnl_fft_3d.h
2 #ifndef vnl_fft_3d_h_
3 #define vnl_fft_3d_h_
4 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
5 #pragma interface
6 #endif
7 //:
8 // \file
9 // \brief In-place 3D fast fourier transform
10 // \author fsm
11 
12 #include <vnl/vnl_matrix.h>
13 #include <vnl/algo/vnl_fft_base.h>
14 
15 //: In-place 3D fast fourier transform
16 
17 template <class T>
18 struct vnl_fft_3d : public vnl_fft_base<3, T>
19 {
20  typedef vnl_fft_base<3, T> base;
21 
22  //: constructor takes size of signal.
23  vnl_fft_3d(int M, int N,int Q) {
24  base::factors_[0].resize(M);
25  base::factors_[1].resize(N);
26  base::factors_[2].resize(Q);
27  }
28 
29  //: dir = +1/-1 according to direction of transform.
30  void transform(vnl_matrix<vcl_complex<T> > &signal, int dir)
31  { base::transform(signal.data_block(), dir); }
32 
33  //: forward FFT
34  void fwd_transform(vnl_matrix<vcl_complex<T> > &signal)
35  { transform(signal, +1); }
36 
37  //: backward (inverse) FFT
38  void bwd_transform(vnl_matrix<vcl_complex<T> > &signal)
39  { transform(signal, -1); }
40 
41  //: return size of signal.
42  unsigned rows() const { return base::factors_[0].number(); }
43  unsigned cols() const { return base::factors_[1].number(); }
44 };
45 
46 #endif // vnl_fft_3d_h_

Generated at Sun May 19 2013 01:02:01 for Orfeo Toolbox with doxygen 1.8.3.1