PCL
pcl::GenericFFT< T > Class Template Reference

Generic fast Fourier transform of complex data. More...

#include <FFT1D.h>

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

Public Types

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

Public Member Functions

 GenericFFT (int n)
 
 ~GenericFFT () override
 
GenericFFToperator() (complex *y, const complex *x, int dir=PCL_FFT_FORWARD) const
 
GenericFFToperator<< (const complex *x)
 
GenericFFToperator<< (const complex_vector &x)
 
GenericFFToperator>> (complex *y) const
 
GenericFFToperator>> (complex_vector &y) const
 
- Public Member Functions inherited from pcl::AbstractFFT< T >
 AbstractFFT (int length)
 
virtual ~AbstractFFT ()
 
transformDFT ()
 
transform DFT () const
 
int Length () const
 
complexoperator* ()
 
const complexoperator* () const
 
virtual void Release ()
 

Static Public Member Functions

static int OptimizedLength (int n)
 

Detailed Description

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

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

For fast Fourier transforms of real-valued data, see the GenericRealFFT template class.

See also
AbstractFFT, GenericRealFFT

Definition at line 329 of file FFT1D.h.

Member Typedef Documentation

◆ base

template<typename T >
using pcl::GenericFFT< T >::base = AbstractFFT<T>

Identifies the base class of this FFT class.

Definition at line 336 of file FFT1D.h.

◆ complex

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

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

Definition at line 346 of file FFT1D.h.

◆ complex_vector

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

Represents a vector of complex numbers.

Definition at line 356 of file FFT1D.h.

◆ scalar

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

Represents a scalar in the context of this FFT class.

Definition at line 341 of file FFT1D.h.

◆ transform

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

Represents the container type used to store an out-of-place discrete Fourier transform.

Definition at line 362 of file FFT1D.h.

◆ vector

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

Represents a vector of real numbers.

Definition at line 351 of file FFT1D.h.

Constructor & Destructor Documentation

◆ GenericFFT()

template<typename T >
pcl::GenericFFT< T >::GenericFFT ( int  n)
inline

Constructs a GenericFFT object of the specified length n.

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 GenericFFT::OptimizedLength() to get the smallest optimal length for your data, then place them on an array of the obtained length, padded with zeros.

Definition at line 378 of file FFT1D.h.

◆ ~GenericFFT()

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

Destroys a GenericFFT object.

Definition at line 386 of file FFT1D.h.

Member Function Documentation

◆ operator()()

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

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

Parameters
[in]xInput vector. Must be the starting address of a contiguous sequence of at least Length() complex numbers.
[out]yOutput vector, where the result of the transform will be stored. Must be the starting address of a contiguous sequence of at least Length() complex numbers.
dirIndicates the direction of the Fourier transform:

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


This parameter is optional; the default value is PCL_FFT_FORWARD.

The specified arguments x and y must be the starting addresses of two different, non-overlapping contiguous blocks of at least Length() elements.

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 496 of file FFT1D.h.

References PCL_FFT_BACKWARD.

◆ operator<<() [1/2]

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

Fast Fourier transform. Performs the FFT of the specified vector of complex values.

The argument x must be the starting address of a contiguous block of at least Length() elements.

Returns a reference to this object.

Definition at line 399 of file FFT1D.h.

◆ operator<<() [2/2]

template<typename T >
GenericFFT& pcl::GenericFFT< T >::operator<< ( const complex_vector x)
inline

Fast Fourier transform. Performs the FFT of a vector of complex values.

The specified vector x must have at least Length() elements. Otherwise an Error exception will be thrown.

Returns a reference to this object.

Definition at line 439 of file FFT1D.h.

References pcl::GenericVector< T >::Length().

◆ operator>>() [1/2]

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

Inverse fast Fourier transform. Performs the inverse FFT and stores the result in the specified vector of complex values.

The argument y must be the starting address of a contiguous block of at least Length() elements.

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 421 of file FFT1D.h.

◆ operator>>() [2/2]

template<typename T >
GenericFFT& pcl::GenericFFT< T >::operator>> ( complex_vector y) const
inline

Inverse fast Fourier transform. Performs the inverse FFT and stores the result in a vector of complex values.

The specified vector y must have at least Length() elements. 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 459 of file FFT1D.h.

References pcl::GenericVector< T >::Length().

◆ OptimizedLength()

template<typename T >
static int pcl::GenericFFT< 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 argument to the constructor of any FFT class for complex data transforms.

Definition at line 520 of file FFT1D.h.

Referenced by pcl::GenericFFT2D< T >::OptimizedLength(), and pcl::GenericRealFFT2D< T >::OptimizedLength().


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