MRPT  2.0.1
fourier.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
13 
14 namespace mrpt::math
15 {
16 /** \addtogroup fourier_grp Fourier transform functions
17  * \ingroup mrpt_math_grp
18  * @{ */
19 
20 /** Computes the FFT of a 2^N-size vector of real numbers, and returns the
21  * Re+Im+Magnitude parts.
22  * \sa fft2_real
23  */
24 void fft_real(
25  CVectorFloat& in_realData, CVectorFloat& out_FFT_Re,
26  CVectorFloat& out_FFT_Im, CVectorFloat& out_FFT_Mag);
27 
28 /** Compute the 2D Discrete Fourier Transform (DFT) of a real matrix, returning
29  * the real and imaginary parts separately.
30  * \param in_data The N_1xN_2 matrix.
31  * \param out_real The N_1xN_2 output matrix which will store the real values
32  * (user has not to initialize the size of this matrix).
33  * \param out_imag The N_1xN_2 output matrix which will store the imaginary
34  * values (user has not to initialize the size of this matrix).
35  * \sa fft_real, ifft2_read, fft2_complex
36  * If the dimensions of the matrix are powers of two, the fast fourier
37  * transform (FFT) is used instead of the general algorithm.
38  */
39 void dft2_real(
40  const CMatrixFloat& in_data, CMatrixFloat& out_real,
41  CMatrixFloat& out_imag);
42 
43 /** Compute the 2D inverse Discrete Fourier Transform (DFT)
44  * \param in_real The N_1xN_2 input matrix with real values.
45  * \param in_imag The N_1xN_2 input matrix with imaginary values.
46  * \param out_data The N_1xN_2 output matrix (user has not to initialize the
47  * size of this matrix).
48  * Note that the real and imaginary parts of the FFT will NOT be checked to
49  * assure that they represent the transformation
50  * of purely real data.
51  * If the dimensions of the matrix are powers of two, the fast fourier
52  * transform (FFT) is used instead of the general algorithm.
53  * \sa fft_real, fft2_real
54  */
55 void idft2_real(
56  const CMatrixFloat& in_real, const CMatrixFloat& in_imag,
57  CMatrixFloat& out_data);
58 
59 /** Compute the 2D Discrete Fourier Transform (DFT) of a complex matrix,
60  * returning the real and imaginary parts separately.
61  * \param in_real The N_1xN_2 matrix with the real part.
62  * \param in_imag The N_1xN_2 matrix with the imaginary part.
63  * \param out_real The N_1xN_2 output matrix which will store the real values
64  * (user has not to initialize the size of this matrix).
65  * \param out_imag The N_1xN_2 output matrix which will store the imaginary
66  * values (user has not to initialize the size of this matrix).
67  * If the dimensions of the matrix are powers of two, the fast fourier
68  * transform (FFT) is used instead of the general algorithm.
69  * \sa fft_real, idft2_complex,dft2_real
70  */
71 void dft2_complex(
72  const CMatrixFloat& in_real, const CMatrixFloat& in_imag,
73  CMatrixFloat& out_real, CMatrixFloat& out_imag);
74 
75 /** Compute the 2D inverse Discrete Fourier Transform (DFT).
76  * \param in_real The N_1xN_2 input matrix with real values, where both
77  * dimensions MUST BE powers of 2.
78  * \param in_imag The N_1xN_2 input matrix with imaginary values, where both
79  * dimensions MUST BE powers of 2.
80  * \param out_real The N_1xN_2 output matrix for real part (user has not to
81  * initialize the size of this matrix).
82  * \param out_imag The N_1xN_2 output matrix for imaginary part (user has not
83  * to initialize the size of this matrix).
84  * \sa fft_real, dft2_real,dft2_complex
85  * If the dimensions of the matrix are powers of two, the fast fourier
86  * transform (FFT) is used instead of the general algorithm.
87  */
88 void idft2_complex(
89  const CMatrixFloat& in_real, const CMatrixFloat& in_imag,
90  CMatrixFloat& out_real, CMatrixFloat& out_imag);
91 
92 /** Correlation of two matrixes using 2D FFT
93  */
95  const CMatrixFloat& A, const CMatrixFloat& B, CMatrixFloat& out_corr);
96 
97 /** @} */
98 
99 } // namespace mrpt::math
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:968
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:927
CMatrixDynamic< float > CMatrixFloat
Declares a matrix of float numbers (non serializable).
This base provides a set of functions for maths stuff.
void cross_correlation_FFT(const CMatrixFloat &A, const CMatrixFloat &B, CMatrixFloat &out_corr)
Correlation of two matrixes using 2D FFT.
Definition: fourier.cpp:1446
CVectorDynamic< float > CVectorFloat
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:1332
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:1068
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:1227



Page generated by Doxygen 1.8.14 for MRPT 2.0.1 Git: 0fef1a6d7 Fri Apr 3 23:00:21 2020 +0200 at vie abr 3 23:20:28 CEST 2020