Main MRPT website > C++ reference
MRPT logo
fourier.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | The Mobile Robot Programming Toolkit (MRPT) C++ library |
3  | |
4  | http://www.mrpt.org/ |
5  | |
6  | Copyright (C) 2005-2012 University of Malaga |
7  | |
8  | This software was written by the Machine Perception and Intelligent |
9  | Robotics Lab, University of Malaga (Spain). |
10  | Contact: Jose-Luis Blanco <jlblanco@ctima.uma.es> |
11  | |
12  | This file is part of the MRPT project. |
13  | |
14  | MRPT is free software: you can redistribute it and/or modify |
15  | it under the terms of the GNU General Public License as published by |
16  | the Free Software Foundation, either version 3 of the License, or |
17  | (at your option) any later version. |
18  | |
19  | MRPT is distributed in the hope that it will be useful, |
20  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
21  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
22  | GNU General Public License for more details. |
23  | |
24  | You should have received a copy of the GNU General Public License |
25  | along with MRPT. If not, see <http://www.gnu.org/licenses/>. |
26  | |
27  +---------------------------------------------------------------------------+ */
28 #ifndef mrpt_math_fourier_H
29 #define mrpt_math_fourier_H
30 
31 #include <mrpt/utils/utils_defs.h>
33 
34 /*---------------------------------------------------------------
35  Namespace
36  ---------------------------------------------------------------*/
37 namespace mrpt
38 {
39  namespace math
40  {
41 
42  /** \addtogroup fourier_grp Fourier transform functions
43  * \ingroup mrpt_base_grp
44  * @{ */
45 
46  /** Computes the FFT of a 2^N-size vector of real numbers, and returns the Re+Im+Magnitude parts.
47  * \sa fft2_real
48  */
49  void BASE_IMPEXP fft_real( vector_float &in_realData,
50  vector_float &out_FFT_Re,
51  vector_float &out_FFT_Im,
52  vector_float &out_FFT_Mag );
53 
54  /** Compute the 2D Discrete Fourier Transform (DFT) of a real matrix, returning the real and imaginary parts separately.
55  * \param in_data The N_1xN_2 matrix.
56  * \param out_real The N_1xN_2 output matrix which will store the real values (user has not to initialize the size of this matrix).
57  * \param out_imag The N_1xN_2 output matrix which will store the imaginary values (user has not to initialize the size of this matrix).
58  * \sa fft_real, ifft2_read, fft2_complex
59  * If the dimensions of the matrix are powers of two, the fast fourier transform (FFT) is used instead of the general algorithm.
60  */
62  const CMatrixFloat &in_data,
63  CMatrixFloat &out_real,
64  CMatrixFloat &out_imag );
65 
66  /** Compute the 2D inverse Discrete Fourier Transform (DFT)
67  * \param in_real The N_1xN_2 input matrix with real values.
68  * \param in_imag The N_1xN_2 input matrix with imaginary values.
69  * \param out_data The N_1xN_2 output matrix (user has not to initialize the size of this matrix).
70  * Note that the real and imaginary parts of the FFT will NOT be checked to assure that they represent the transformation
71  * of purely real data.
72  * If the dimensions of the matrix are powers of two, the fast fourier transform (FFT) is used instead of the general algorithm.
73  * \sa fft_real, fft2_real
74  */
76  const CMatrixFloat &in_real,
77  const CMatrixFloat &in_imag,
78  CMatrixFloat &out_data );
79 
80  /** Compute the 2D Discrete Fourier Transform (DFT) of a complex matrix, returning the real and imaginary parts separately.
81  * \param in_real The N_1xN_2 matrix with the real part.
82  * \param in_imag The N_1xN_2 matrix with the imaginary part.
83  * \param out_real The N_1xN_2 output matrix which will store the real values (user has not to initialize the size of this matrix).
84  * \param out_imag The N_1xN_2 output matrix which will store the imaginary values (user has not to initialize the size of this matrix).
85  * If the dimensions of the matrix are powers of two, the fast fourier transform (FFT) is used instead of the general algorithm.
86  * \sa fft_real, idft2_complex,dft2_real
87  */
89  const CMatrixFloat &in_real,
90  const CMatrixFloat &in_imag,
91  CMatrixFloat &out_real,
92  CMatrixFloat &out_imag);
93 
94  /** Compute the 2D inverse Discrete Fourier Transform (DFT).
95  * \param in_real The N_1xN_2 input matrix with real values, where both dimensions MUST BE powers of 2.
96  * \param in_imag The N_1xN_2 input matrix with imaginary values, where both dimensions MUST BE powers of 2.
97  * \param out_real The N_1xN_2 output matrix for real part (user has not to initialize the size of this matrix).
98  * \param out_imag The N_1xN_2 output matrix for imaginary part (user has not to initialize the size of this matrix).
99  * \sa fft_real, dft2_real,dft2_complex
100  * If the dimensions of the matrix are powers of two, the fast fourier transform (FFT) is used instead of the general algorithm.
101  */
103  const CMatrixFloat &in_real,
104  const CMatrixFloat &in_imag,
105  CMatrixFloat &out_real,
106  CMatrixFloat &out_imag );
107 
108 
109  /** Correlation of two matrixes using 2D FFT
110  */
112  const CMatrixFloat &A,
113  const CMatrixFloat &B,
114  CMatrixFloat &out_corr );
115 
116  /** @} */
117 
118  } // End of MATH namespace
119 
120 } // End of namespace
121 
122 #endif



Page generated by Doxygen 1.8.3 for MRPT 0.9.6 SVN: at Fri Feb 15 22:05:02 EST 2013