Main MRPT website > C++ reference
MRPT logo
fourier.h
Go to the documentation of this file.
00001 /* +---------------------------------------------------------------------------+
00002    |          The Mobile Robot Programming Toolkit (MRPT) C++ library          |
00003    |                                                                           |
00004    |                       http://www.mrpt.org/                                |
00005    |                                                                           |
00006    |   Copyright (C) 2005-2011  University of Malaga                           |
00007    |                                                                           |
00008    |    This software was written by the Machine Perception and Intelligent    |
00009    |      Robotics Lab, University of Malaga (Spain).                          |
00010    |    Contact: Jose-Luis Blanco  <jlblanco@ctima.uma.es>                     |
00011    |                                                                           |
00012    |  This file is part of the MRPT project.                                   |
00013    |                                                                           |
00014    |     MRPT is free software: you can redistribute it and/or modify          |
00015    |     it under the terms of the GNU General Public License as published by  |
00016    |     the Free Software Foundation, either version 3 of the License, or     |
00017    |     (at your option) any later version.                                   |
00018    |                                                                           |
00019    |   MRPT is distributed in the hope that it will be useful,                 |
00020    |     but WITHOUT ANY WARRANTY; without even the implied warranty of        |
00021    |     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         |
00022    |     GNU General Public License for more details.                          |
00023    |                                                                           |
00024    |     You should have received a copy of the GNU General Public License     |
00025    |     along with MRPT.  If not, see <http://www.gnu.org/licenses/>.         |
00026    |                                                                           |
00027    +---------------------------------------------------------------------------+ */
00028 #ifndef  mrpt_math_fourier_H
00029 #define  mrpt_math_fourier_H
00030 
00031 #include <mrpt/utils/utils_defs.h>
00032 #include <mrpt/math/CMatrixTemplateNumeric.h>
00033 
00034 /*---------------------------------------------------------------
00035                 Namespace
00036   ---------------------------------------------------------------*/
00037 namespace mrpt
00038 {
00039         namespace math
00040         {
00041 
00042                 /** \addtogroup fourier_grp Fourier transform functions
00043                   *  \ingroup mrpt_base_grp
00044                   * @{ */
00045 
00046                 /** Computes the FFT of a 2^N-size vector of real numbers, and returns the Re+Im+Magnitude parts.
00047                   * \sa fft2_real
00048                   */
00049                 void BASE_IMPEXP  fft_real(     vector_float    &in_realData,
00050                                                                 vector_float    &out_FFT_Re,
00051                                                                 vector_float    &out_FFT_Im,
00052                                                                 vector_float    &out_FFT_Mag );
00053 
00054                 /** Compute the 2D Discrete Fourier Transform (DFT) of a real matrix, returning the real and imaginary parts separately.
00055                   * \param in_data The N_1xN_2 matrix.
00056                   * \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).
00057                   * \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).
00058                   * \sa fft_real, ifft2_read, fft2_complex
00059                   *  If the dimensions of the matrix are powers of two, the fast fourier transform (FFT) is used instead of the general algorithm.
00060                   */
00061                 void BASE_IMPEXP  dft2_real(
00062                         const CMatrixFloat &in_data,
00063                         CMatrixFloat            &out_real,
00064                         CMatrixFloat            &out_imag );
00065 
00066                 /** Compute the 2D inverse Discrete Fourier Transform (DFT)
00067                   * \param in_real The N_1xN_2 input matrix with real values.
00068                   * \param in_imag The N_1xN_2 input matrix with imaginary values.
00069                   * \param out_data The N_1xN_2 output matrix (user has not to initialize the size of this matrix).
00070                   *  Note that the real and imaginary parts of the FFT will NOT be checked to assure that they represent the transformation
00071                   *    of purely real data.
00072                   *  If the dimensions of the matrix are powers of two, the fast fourier transform (FFT) is used instead of the general algorithm.
00073                   * \sa fft_real, fft2_real
00074                   */
00075                 void BASE_IMPEXP  idft2_real(
00076                         const CMatrixFloat      &in_real,
00077                         const CMatrixFloat      &in_imag,
00078                         CMatrixFloat            &out_data );
00079 
00080                 /** Compute the 2D Discrete Fourier Transform (DFT) of a complex matrix, returning the real and imaginary parts separately.
00081                   * \param in_real The N_1xN_2 matrix with the real part.
00082                   * \param in_imag The N_1xN_2 matrix with the imaginary part.
00083                   * \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).
00084                   * \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).
00085                   *  If the dimensions of the matrix are powers of two, the fast fourier transform (FFT) is used instead of the general algorithm.
00086                   * \sa fft_real, idft2_complex,dft2_real
00087                   */
00088                 void BASE_IMPEXP  dft2_complex(
00089                         const CMatrixFloat &in_real,
00090                         const CMatrixFloat &in_imag,
00091                         CMatrixFloat            &out_real,
00092                         CMatrixFloat            &out_imag);
00093 
00094                 /** Compute the 2D inverse Discrete Fourier Transform (DFT).
00095                   * \param in_real The N_1xN_2 input matrix with real values, where both dimensions MUST BE powers of 2.
00096                   * \param in_imag The N_1xN_2 input matrix with imaginary values, where both dimensions MUST BE powers of 2.
00097                   * \param out_real The N_1xN_2 output matrix for real part (user has not to initialize the size of this matrix).
00098                   * \param out_imag The N_1xN_2 output matrix for imaginary part (user has not to initialize the size of this matrix).
00099                   * \sa fft_real, dft2_real,dft2_complex
00100                   *  If the dimensions of the matrix are powers of two, the fast fourier transform (FFT) is used instead of the general algorithm.
00101                   */
00102                 void BASE_IMPEXP  idft2_complex(
00103                         const CMatrixFloat      &in_real,
00104                         const CMatrixFloat      &in_imag,
00105                         CMatrixFloat            &out_real,
00106                         CMatrixFloat            &out_imag );
00107 
00108 
00109                 /** Correlation of two matrixes using 2D FFT
00110                   */
00111                 void  BASE_IMPEXP  cross_correlation_FFT(
00112                         const CMatrixFloat      &A,
00113                         const CMatrixFloat      &B,
00114                         CMatrixFloat            &out_corr );
00115 
00116                 /** @} */
00117 
00118         } // End of MATH namespace
00119 
00120 } // End of namespace
00121 
00122 #endif



Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011