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-2018, 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 #pragma once
10 
12 
13 namespace mrpt
14 {
15 namespace math
16 {
17 /** \addtogroup fourier_grp Fourier transform functions
18  * \ingroup mrpt_math_grp
19  * @{ */
20 
21 /** Computes the FFT of a 2^N-size vector of real numbers, and returns the
22  * Re+Im+Magnitude parts.
23  * \sa fft2_real
24  */
25 void fft_real(
26  CVectorFloat& in_realData, CVectorFloat& out_FFT_Re,
27  CVectorFloat& out_FFT_Im, CVectorFloat& out_FFT_Mag);
28 
29 /** Compute the 2D Discrete Fourier Transform (DFT) of a real matrix, returning
30  * the real and imaginary parts separately.
31  * \param in_data The N_1xN_2 matrix.
32  * \param out_real The N_1xN_2 output matrix which will store the real values
33  * (user has not to initialize the size of this matrix).
34  * \param out_imag The N_1xN_2 output matrix which will store the imaginary
35  * values (user has not to initialize the size of this matrix).
36  * \sa fft_real, ifft2_read, fft2_complex
37  * If the dimensions of the matrix are powers of two, the fast fourier
38  * transform (FFT) is used instead of the general algorithm.
39  */
40 void dft2_real(
41  const CMatrixFloat& in_data, CMatrixFloat& out_real,
42  CMatrixFloat& out_imag);
43 
44 /** Compute the 2D inverse Discrete Fourier Transform (DFT)
45  * \param in_real The N_1xN_2 input matrix with real values.
46  * \param in_imag The N_1xN_2 input matrix with imaginary values.
47  * \param out_data The N_1xN_2 output matrix (user has not to initialize the
48  * size of this matrix).
49  * Note that the real and imaginary parts of the FFT will NOT be checked to
50  * assure that they represent the transformation
51  * of purely real data.
52  * If the dimensions of the matrix are powers of two, the fast fourier
53  * transform (FFT) is used instead of the general algorithm.
54  * \sa fft_real, fft2_real
55  */
56 void idft2_real(
57  const CMatrixFloat& in_real, const CMatrixFloat& in_imag,
58  CMatrixFloat& out_data);
59 
60 /** Compute the 2D Discrete Fourier Transform (DFT) of a complex matrix,
61  * returning the real and imaginary parts separately.
62  * \param in_real The N_1xN_2 matrix with the real part.
63  * \param in_imag The N_1xN_2 matrix with the imaginary part.
64  * \param out_real The N_1xN_2 output matrix which will store the real values
65  * (user has not to initialize the size of this matrix).
66  * \param out_imag The N_1xN_2 output matrix which will store the imaginary
67  * values (user has not to initialize the size of this matrix).
68  * If the dimensions of the matrix are powers of two, the fast fourier
69  * transform (FFT) is used instead of the general algorithm.
70  * \sa fft_real, idft2_complex,dft2_real
71  */
72 void dft2_complex(
73  const CMatrixFloat& in_real, const CMatrixFloat& in_imag,
74  CMatrixFloat& out_real, CMatrixFloat& out_imag);
75 
76 /** Compute the 2D inverse Discrete Fourier Transform (DFT).
77  * \param in_real The N_1xN_2 input matrix with real values, where both
78  * dimensions MUST BE powers of 2.
79  * \param in_imag The N_1xN_2 input matrix with imaginary values, where both
80  * dimensions MUST BE powers of 2.
81  * \param out_real The N_1xN_2 output matrix for real part (user has not to
82  * initialize the size of this matrix).
83  * \param out_imag The N_1xN_2 output matrix for imaginary part (user has not
84  * to initialize the size of this matrix).
85  * \sa fft_real, dft2_real,dft2_complex
86  * If the dimensions of the matrix are powers of two, the fast fourier
87  * transform (FFT) is used instead of the general algorithm.
88  */
89 void idft2_complex(
90  const CMatrixFloat& in_real, const CMatrixFloat& in_imag,
91  CMatrixFloat& out_real, CMatrixFloat& out_imag);
92 
93 /** Correlation of two matrixes using 2D FFT
94  */
96  const CMatrixFloat& A, const CMatrixFloat& B, CMatrixFloat& out_corr);
97 
98 /** @} */
99 
100 } // End of MATH namespace
101 } // End of namespace
mrpt::math::CMatrixFloat
CMatrixTemplateNumeric< float > CMatrixFloat
Declares a matrix of float numbers (non serializable).
Definition: CMatrixTemplateNumeric.h:138
mrpt::math::dft2_real
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: fourier.cpp:970
mrpt::math::idft2_complex
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: fourier.cpp:1337
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::math::cross_correlation_FFT
void cross_correlation_FFT(const CMatrixFloat &A, const CMatrixFloat &B, CMatrixFloat &out_corr)
Correlation of two matrixes using 2D FFT.
Definition: fourier.cpp:1451
mrpt::math::fft_real
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: fourier.cpp:929
CMatrixTemplateNumeric.h
mrpt::math::idft2_real
void idft2_real(const CMatrixFloat &in_real, const CMatrixFloat &in_imag, CMatrixFloat &out_data)
Compute the 2D inverse Discrete Fourier Transform (DFT)
Definition: fourier.cpp:1070
mrpt::math::dft2_complex
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: fourier.cpp:1232
mrpt::math::CVectorFloat
dynamic_vector< float > CVectorFloat
Column vector, like Eigen::MatrixXf, but automatically initialized to zeros since construction.
Definition: eigen_frwds.h:45



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST