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



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020