PCL
pcl::GenericFFT2D< T > Class Template Reference

Generic two-dimensional fast Fourier transform of complex data. More...

#include <FFT2D.h>

+ Inheritance diagram for pcl::GenericFFT2D< T >:

Public Types

using base = AbstractFFT2D< T >
 
using complex = typename base::complex
 
using complex_matrix = typename base::complex_matrix
 
using complex_vector = typename base::complex_vector
 
using matrix = typename base::matrix
 
using scalar = typename base::scalar
 
using transform = typename base::transform
 
using vector = typename base::vector
 
- Public Types inherited from pcl::AbstractFFT2D< T >
using complex = Complex< T >
 
using complex_matrix = GenericMatrix< complex >
 
using complex_vector = GenericVector< complex >
 
using matrix = GenericMatrix< scalar >
 
using scalar = T
 
using transform = complex_matrix
 
using vector = GenericVector< scalar >
 

Public Member Functions

 GenericFFT2D (int rows, int cols)
 
 GenericFFT2D (int rows, int cols, StatusMonitor &status)
 
 ~GenericFFT2D () override
 
GenericFFT2Doperator() (complex *y, const complex *x, int dir=PCL_FFT_FORWARD) const
 
GenericFFT2Doperator<< (const complex *x)
 
GenericFFT2Doperator<< (const complex_matrix &x)
 
GenericFFT2Doperator>> (complex *y) const
 
GenericFFT2Doperator>> (complex_matrix &y) const
 
- Public Member Functions inherited from pcl::AbstractFFT2D< T >
 AbstractFFT2D (int rows, int cols)
 
 AbstractFFT2D (int rows, int cols, StatusMonitor &monitor)
 
 ~AbstractFFT2D () override
 
int Cols () const
 
transformDFT ()
 
transform DFT () const
 
int NumberOfElements () const
 
virtual void Release ()
 
int Rows () const
 
- Public Member Functions inherited from pcl::ParallelProcess
 ParallelProcess ()=default
 
 ParallelProcess (const ParallelProcess &)=default
 
virtual ~ParallelProcess ()
 
void DisableParallelProcessing (bool disable=true) noexcept
 
void EnableParallelProcessing (bool enable=true, int maxProcessors=0) noexcept
 
bool IsParallelProcessingEnabled () const noexcept
 
int MaxProcessors () const noexcept
 
ParallelProcessoperator= (const ParallelProcess &)=default
 
void SetMaxProcessors (int maxProcessors) noexcept
 
void Swap (ParallelProcess &process) noexcept
 

Static Public Member Functions

static int OptimizedLength (int n)
 

Detailed Description

template<typename T>
class pcl::GenericFFT2D< T >

The GenericFFT2D template class performs two-dimensional forward and inverse, out-of-place fast Fourier transforms of complex data.

For fast Fourier transforms of 2-D real-valued data, see the GenericRealFFT2D template class.

See also
AbstractFFT2D, GenericRealFFT2D

Definition at line 308 of file FFT2D.h.

Member Typedef Documentation

◆ base

template<typename T >
using pcl::GenericFFT2D< T >::base = AbstractFFT2D<T>

Identifies the base class of this FFT class.

Definition at line 315 of file FFT2D.h.

◆ complex

template<typename T >
using pcl::GenericFFT2D< T >::complex = typename base::complex

Represents a complex number in the context of this FFT class.

Definition at line 325 of file FFT2D.h.

◆ complex_matrix

template<typename T >
using pcl::GenericFFT2D< T >::complex_matrix = typename base::complex_matrix

Represents a complex matrix.

Definition at line 345 of file FFT2D.h.

◆ complex_vector

template<typename T >
using pcl::GenericFFT2D< T >::complex_vector = typename base::complex_vector

Represents a vector of complex numbers.

Definition at line 335 of file FFT2D.h.

◆ matrix

template<typename T >
using pcl::GenericFFT2D< T >::matrix = typename base::matrix

Represents a real matrix.

Definition at line 340 of file FFT2D.h.

◆ scalar

template<typename T >
using pcl::GenericFFT2D< T >::scalar = typename base::scalar

Represents a scalar in the context of this FFT class.

Definition at line 320 of file FFT2D.h.

◆ transform

template<typename T >
using pcl::GenericFFT2D< T >::transform = typename base::transform

Represents a discrete Fourier transform matrix.

Definition at line 350 of file FFT2D.h.

◆ vector

template<typename T >
using pcl::GenericFFT2D< T >::vector = typename base::vector

Represents a vector of real numbers.

Definition at line 330 of file FFT2D.h.

Constructor & Destructor Documentation

◆ GenericFFT2D() [1/2]

template<typename T >
pcl::GenericFFT2D< T >::GenericFFT2D ( int  rows,
int  cols 
)
inline

Constructs a GenericFFT2D object of the specified dimensions rows and cols.

The current PCL implementation supports FFTs of arbitrary length, but the underlying routines have been optimized for performance when the length of the input vector can be factorized as follows:

n = 2^n2 * 3^n3 * 4^n4 * 5^n5

where n2, n3, n4, and n5 are arbitrary positive integers. For best performance, you should call GenericFFT2D::OptimizedLength() to get the smallest optimal dimensions for your data, then place them on a matrix of the obtained dimensions, padded with zeros.

Definition at line 367 of file FFT2D.h.

◆ GenericFFT2D() [2/2]

template<typename T >
pcl::GenericFFT2D< T >::GenericFFT2D ( int  rows,
int  cols,
StatusMonitor status 
)
inline

Constructs a GenericFFT2D object of the specified dimensions rows and cols, using the specified status monitoring object status.

On each transform performed with this object, the status m_monitor will be incremented by the sum of transform dimensions: rows + cols.

See the GenericFFT2D( int, int ) constructor for more information.

Definition at line 381 of file FFT2D.h.

◆ ~GenericFFT2D()

template<typename T >
pcl::GenericFFT2D< T >::~GenericFFT2D ( )
inlineoverride

Destroys a GenericFFT2D object.

Definition at line 389 of file FFT2D.h.

Member Function Documentation

◆ operator()()

template<typename T >
GenericFFT2D& pcl::GenericFFT2D< T >::operator() ( complex y,
const complex x,
int  dir = PCL_FFT_FORWARD 
) const
inline

Performs the forward or inverse two-dimensional FFT of an input matrix of complex values, and stores the result in a caller-supplied output matrix.

Parameters
[in]xInput matrix. Must be the starting address of a contiguous sequence of at least NumberOfElements() complex numbers, stored in row order: all elements of the first row followed by all elements of the second row, and so on.
[out]yOutput matrix, where the result of the transform will be stored. Must be the starting address of a contiguous sequence of at least NumberOfElements() complex numbers. The result will be stored in row order: all elements of the first row followed by all elements of the second row, and so on.
dirIndicates the direction of the Fourier transform:

PCL_FFT_FORWARD The FFT is calculated.
PCL_FFT_BACKWARD The inverse FFT is calculated.


This parameter is optional; the default value is PCL_FFT_FORWARD.

This member function does not change the current Fourier transform in this object, if it exists.

Returns a reference to this object.

Definition at line 505 of file FFT2D.h.

◆ operator<<() [1/2]

template<typename T >
GenericFFT2D& pcl::GenericFFT2D< T >::operator<< ( const complex x)
inline

Fast Fourier transform. Performs the two-dimensional FFT of the specified matrix of complex values.

The argument x must be the starting address of a contiguous block of at least NumberOfElements() elements, stored in row order: all elements of the first matrix row followed by all elements of the second row, and so on.

Returns a reference to this object.

Definition at line 404 of file FFT2D.h.

◆ operator<<() [2/2]

template<typename T >
GenericFFT2D& pcl::GenericFFT2D< T >::operator<< ( const complex_matrix x)
inline

Fast Fourier transform. Performs the two-dimensional FFT of a matrix of complex values.

The specified matrix x must have Rows() and Cols() dimensions. Otherwise an Error exception will be thrown.

Returns a reference to this object.

Definition at line 443 of file FFT2D.h.

References pcl::GenericMatrix< T >::Rows().

◆ operator>>() [1/2]

template<typename T >
GenericFFT2D& pcl::GenericFFT2D< T >::operator>> ( complex y) const
inline

Inverse fast Fourier transform. Performs the two-dimensional inverse FFT and stores the result in the specified matrix of complex values.

The argument y must be the starting address of a contiguous block of at least NumberOfElements() elements. The result matrix will be stored in row order: all elements of the first matrix row followed by all elements of the second row, and so on.

If no FFT has been performed on this object (by a previous call to operator <<()), this member function throws an Error exception.

Returns a reference to this object.

Definition at line 426 of file FFT2D.h.

◆ operator>>() [2/2]

template<typename T >
GenericFFT2D& pcl::GenericFFT2D< T >::operator>> ( complex_matrix y) const
inline

Inverse fast Fourier transform. Performs the two-dimensional inverse FFT and stores the result in a matrix of complex values.

The specified matrix y must have Rows() and Cols() dimensions. Otherwise an Error exception will be thrown.

If no FFT has been performed on this object (by a previous call to operator <<()), this member function throws an Error exception.

Returns a reference to this object.

Definition at line 464 of file FFT2D.h.

References pcl::GenericMatrix< T >::Rows().

◆ OptimizedLength()

template<typename T >
static int pcl::GenericFFT2D< T >::OptimizedLength ( int  n)
inlinestatic

Returns the optimized complex FFT length larger than or equal to a given length n. The returned length will be optimal to perform a FFT of complex data with the current PCL implementation. The optimized length can be used as the rows or cols argument to the constructor of any two-dimensional FFT class for complex data transforms.

Definition at line 518 of file FFT2D.h.

References pcl::GenericFFT< T >::OptimizedLength().


The documentation for this class was generated from the following file: