PCL
pcl::GenericRealFFT2D< T > Class Template Reference

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

#include <FFT2D.h>

+ Inheritance diagram for pcl::GenericRealFFT2D< 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

 GenericRealFFT2D (int rows, int cols)
 
 GenericRealFFT2D (int rows, int cols, StatusMonitor &status)
 
 ~GenericRealFFT2D () override
 
GenericRealFFT2Doperator() (complex *y, const scalar *x) const
 
GenericRealFFT2Doperator() (scalar *y, const complex *x) const
 
GenericRealFFT2Doperator<< (const matrix &x)
 
GenericRealFFT2Doperator<< (const scalar *x)
 
GenericRealFFT2Doperator>> (matrix &y) const
 
GenericRealFFT2Doperator>> (scalar *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::GenericRealFFT2D< T >

The GenericRealFFT2D template class performs forward and inverse, out-of-place fast two-dimensional Fourier transforms of real-valued data. For real data in the time domain, this class performs nearly twice as fast as Fourier transform classes for complex data.

For two-dimensional fast Fourier transforms of complex-valued data, see the GenericFFT2D template class.

See also
AbstractFFT2D, GenericFFT2D

Definition at line 541 of file FFT2D.h.

Member Typedef Documentation

◆ base

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

Identifies the base class of this FFT class.

Definition at line 548 of file FFT2D.h.

◆ complex

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

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

Definition at line 558 of file FFT2D.h.

◆ complex_matrix

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

Represents a complex matrix.

Definition at line 578 of file FFT2D.h.

◆ complex_vector

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

Represents a vector of complex numbers.

Definition at line 568 of file FFT2D.h.

◆ matrix

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

Represents a real matrix.

Definition at line 573 of file FFT2D.h.

◆ scalar

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

Represents a scalar in the context of this FFT class.

Definition at line 553 of file FFT2D.h.

◆ transform

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

Represents a discrete Fourier transform matrix.

Definition at line 583 of file FFT2D.h.

◆ vector

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

Represents a vector of real numbers.

Definition at line 563 of file FFT2D.h.

Constructor & Destructor Documentation

◆ GenericRealFFT2D() [1/2]

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

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

The current PCL implementation supports FFTs for real data of any even 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, and n is an even integer. For best performance, you should call GenericRealFFT2D::OptimizedLength() to get the smallest optimal dimensions for your real-valued data, then place them on a matrix of the obtained dimensions, padded with zeros.

Note
We stress the fact that the specified dimensions rows and cols must be even integer numbers.

Definition at line 604 of file FFT2D.h.

◆ GenericRealFFT2D() [2/2]

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

Constructs a GenericRealFFT2D 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 GenericRealFFT2D( int, int ) constructor for more information.

Definition at line 618 of file FFT2D.h.

◆ ~GenericRealFFT2D()

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

Destroys a GenericRealFFT2D object.

Definition at line 626 of file FFT2D.h.

Member Function Documentation

◆ operator()() [1/2]

template<typename T >
GenericRealFFT2D& pcl::GenericRealFFT2D< T >::operator() ( complex y,
const scalar x 
) const
inline

Performs the two-dimensional FFT of an input matrix of real numbers, and stores the result in an output matrix of complex numbers.

Parameters
[in]xInput matrix. Must be the starting address of a contiguous sequence of at least NumberOfElements() real 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 Rows()*(Cols()/2 + 1) 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, where each row has Cols()/2 + 1 complex numbers.

The output matrix will have Rows() rows and Cols()/2 + 1 columns, stored in row order.

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 735 of file FFT2D.h.

◆ operator()() [2/2]

template<typename T >
GenericRealFFT2D& pcl::GenericRealFFT2D< T >::operator() ( scalar y,
const complex x 
) const
inline

Performs the inverse two-dimensional FFT of an input matrix of complex numbers, and stores the result in an output matrix of real numbers.

Parameters
[in]xInput matrix. Must be the starting address of a contiguous sequence of at least Rows()*(Cols()/2 + 1) complex numbers, stored in row order: all elements of the first row followed by all elements of the second row, and so on, where each row must have Cols()/2 + 1 complex numbers.
[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() real 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.

The input matrix must have Rows() rows and Cols()/2 + 1 columns, stored in row order.

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 766 of file FFT2D.h.

◆ operator<<() [1/2]

template<typename T >
GenericRealFFT2D& pcl::GenericRealFFT2D< T >::operator<< ( const matrix x)
inline

Fast Fourier transform. Performs the two-dimensional FFT of a matrix of real numbers.

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 680 of file FFT2D.h.

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

◆ operator<<() [2/2]

template<typename T >
GenericRealFFT2D& pcl::GenericRealFFT2D< T >::operator<< ( const scalar x)
inline

Fast Fourier transform. Performs the two-dimensional FFT of the specified matrix of real 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 641 of file FFT2D.h.

◆ operator>>() [1/2]

template<typename T >
GenericRealFFT2D& pcl::GenericRealFFT2D< T >::operator>> ( matrix y) const
inline

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

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 701 of file FFT2D.h.

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

◆ operator>>() [2/2]

template<typename T >
GenericRealFFT2D& pcl::GenericRealFFT2D< T >::operator>> ( scalar y) const
inline

Inverse fast Fourier transform. Performs the two-dimensional inverse FFT and stores the result in the specified matrix of real 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 663 of file FFT2D.h.

◆ OptimizedLength()

template<typename T >
static int pcl::GenericRealFFT2D< 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 real 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 real-valued data transforms.

Definition at line 779 of file FFT2D.h.

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


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