Main MRPT website > C++ reference for MRPT 1.9.9
fourier.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #ifndef mrpt_math_fourier_H
10 #define mrpt_math_fourier_H
11 
12 #include <mrpt/utils/utils_defs.h>
14 
15 /*---------------------------------------------------------------
16  Namespace
17  ---------------------------------------------------------------*/
18 namespace mrpt
19 {
20 namespace math
21 {
22 /** \addtogroup fourier_grp Fourier transform functions
23  * \ingroup mrpt_base_grp
24  * @{ */
25 
26 /** Computes the FFT of a 2^N-size vector of real numbers, and returns the
27  * Re+Im+Magnitude parts.
28  * \sa fft2_real
29  */
30 void fft_real(
31  CVectorFloat& in_realData, CVectorFloat& out_FFT_Re,
32  CVectorFloat& out_FFT_Im, CVectorFloat& out_FFT_Mag);
33 
34 /** Compute the 2D Discrete Fourier Transform (DFT) of a real matrix, returning
35  * the real and imaginary parts separately.
36  * \param in_data The N_1xN_2 matrix.
37  * \param out_real The N_1xN_2 output matrix which will store the real values
38  * (user has not to initialize the size of this matrix).
39  * \param out_imag The N_1xN_2 output matrix which will store the imaginary
40  * values (user has not to initialize the size of this matrix).
41  * \sa fft_real, ifft2_read, fft2_complex
42  * If the dimensions of the matrix are powers of two, the fast fourier
43  * transform (FFT) is used instead of the general algorithm.
44  */
45 void dft2_real(
46  const CMatrixFloat& in_data, CMatrixFloat& out_real,
47  CMatrixFloat& out_imag);
48 
49 /** Compute the 2D inverse Discrete Fourier Transform (DFT)
50  * \param in_real The N_1xN_2 input matrix with real values.
51  * \param in_imag The N_1xN_2 input matrix with imaginary values.
52  * \param out_data The N_1xN_2 output matrix (user has not to initialize the
53  * size of this matrix).
54  * Note that the real and imaginary parts of the FFT will NOT be checked to
55  * assure that they represent the transformation
56  * of purely real data.
57  * If the dimensions of the matrix are powers of two, the fast fourier
58  * transform (FFT) is used instead of the general algorithm.
59  * \sa fft_real, fft2_real
60  */
61 void idft2_real(
62  const CMatrixFloat& in_real, const CMatrixFloat& in_imag,
63  CMatrixFloat& out_data);
64 
65 /** Compute the 2D Discrete Fourier Transform (DFT) of a complex matrix,
66  * returning the real and imaginary parts separately.
67  * \param in_real The N_1xN_2 matrix with the real part.
68  * \param in_imag The N_1xN_2 matrix with the imaginary part.
69  * \param out_real The N_1xN_2 output matrix which will store the real values
70  * (user has not to initialize the size of this matrix).
71  * \param out_imag The N_1xN_2 output matrix which will store the imaginary
72  * values (user has not to initialize the size of this matrix).
73  * If the dimensions of the matrix are powers of two, the fast fourier
74  * transform (FFT) is used instead of the general algorithm.
75  * \sa fft_real, idft2_complex,dft2_real
76  */
77 void dft2_complex(
78  const CMatrixFloat& in_real, const CMatrixFloat& in_imag,
79  CMatrixFloat& out_real, CMatrixFloat& out_imag);
80 
81 /** Compute the 2D inverse Discrete Fourier Transform (DFT).
82  * \param in_real The N_1xN_2 input matrix with real values, where both
83  * dimensions MUST BE powers of 2.
84  * \param in_imag The N_1xN_2 input matrix with imaginary values, where both
85  * dimensions MUST BE powers of 2.
86  * \param out_real The N_1xN_2 output matrix for real part (user has not to
87  * initialize the size of this matrix).
88  * \param out_imag The N_1xN_2 output matrix for imaginary part (user has not
89  * to initialize the size of this matrix).
90  * \sa fft_real, dft2_real,dft2_complex
91  * If the dimensions of the matrix are powers of two, the fast fourier
92  * transform (FFT) is used instead of the general algorithm.
93  */
94 void idft2_complex(
95  const CMatrixFloat& in_real, const CMatrixFloat& in_imag,
96  CMatrixFloat& out_real, CMatrixFloat& out_imag);
97 
98 /** Correlation of two matrixes using 2D FFT
99  */
101  const CMatrixFloat& A, const CMatrixFloat& B, CMatrixFloat& out_corr);
102 
103 /** @} */
104 
105 } // End of MATH namespace
106 
107 } // End of namespace
108 
109 #endif
void dft2_real(const CMatrixFloat &in_data, CMatrixFloat &out_real, CMatrixFloat &out_imag)
Compute the 2D Discrete Fourier Transform (DFT) of a real matrix, returning the real and imaginary pa...
Definition: math.cpp:1211
void fft_real(CVectorFloat &in_realData, CVectorFloat &out_FFT_Re, CVectorFloat &out_FFT_Im, CVectorFloat &out_FFT_Mag)
Computes the FFT of a 2^N-size vector of real numbers, and returns the Re+Im+Magnitude parts...
Definition: math.cpp:1036
dynamic_vector< float > CVectorFloat
Column vector, like Eigen::MatrixXf, but automatically initialized to zeros since construction...
Definition: eigen_frwds.h:42
void cross_correlation_FFT(const CMatrixFloat &A, const CMatrixFloat &B, CMatrixFloat &out_corr)
Correlation of two matrixes using 2D FFT.
Definition: math.cpp:1925
CMatrixTemplateNumeric< float > CMatrixFloat
Declares a matrix of float numbers (non serializable).
void idft2_complex(const CMatrixFloat &in_real, const CMatrixFloat &in_imag, CMatrixFloat &out_real, CMatrixFloat &out_imag)
Compute the 2D inverse Discrete Fourier Transform (DFT).
Definition: math.cpp:1581
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void idft2_real(const CMatrixFloat &in_real, const CMatrixFloat &in_imag, CMatrixFloat &out_data)
Compute the 2D inverse Discrete Fourier Transform (DFT)
Definition: math.cpp:1314
void dft2_complex(const CMatrixFloat &in_real, const CMatrixFloat &in_imag, CMatrixFloat &out_real, CMatrixFloat &out_imag)
Compute the 2D Discrete Fourier Transform (DFT) of a complex matrix, returning the real and imaginary...
Definition: math.cpp:1476



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019