107 static int OptimizedLength(
int,
fcomplex* );
108 static int OptimizedLength(
int,
dcomplex* );
109 static int OptimizedLength(
int,
float* );
110 static int OptimizedLength(
int,
double* );
112 static void* Create(
int,
fcomplex* );
113 static void* Create(
int,
dcomplex* );
114 static void* Create(
int,
float* );
115 static void* Create(
int,
double* );
117 static void* CreateInv(
int,
fcomplex* );
118 static void* CreateInv(
int,
dcomplex* );
119 static void* CreateInv(
int,
float* );
120 static void* CreateInv(
int,
double* );
126 static void Transform(
void*,
fcomplex*,
const float* );
127 static void Transform(
void*,
dcomplex*,
const double* );
128 static void Transform(
void*,
float*,
const fcomplex* );
129 static void Transform(
void*,
double*,
const dcomplex* );
143 #define PCL_FFT_FORWARD -1
150 #define PCL_FFT_BACKWARD +1
163 template <
typename T>
289 if ( m_handle !=
nullptr )
290 this->
Destroy( m_handle ), m_handle =
nullptr;
291 if ( m_handleInv !=
nullptr )
292 this->
Destroy( m_handleInv ), m_handleInv =
nullptr;
302 mutable void* m_handle =
nullptr;
303 mutable void* m_handleInv =
nullptr;
309 #define m_handle this->m_handle
310 #define m_handleInv this->m_handleInv
311 #define m_dft this->m_dft
312 #define m_length this->Length()
328 template <
typename T>
401 if ( m_dft.IsEmpty() )
403 if ( m_handle ==
nullptr )
404 m_handle = this->Create( m_length,
static_cast<complex*
>(
nullptr ) );
405 this->Transform( m_handle, *m_dft, x );
423 if ( m_dft.IsEmpty() )
424 throw Error(
"Invalid out-of-place inverse FFT: No FFT has been performed." );
425 if ( m_handleInv ==
nullptr )
426 m_handleInv = this->CreateInv( m_length,
static_cast<complex*
>(
nullptr ) );
427 this->Transform( m_handleInv, y, *m_dft );
441 PCL_PRECONDITION( x.
Length() >= m_length )
442 if ( x.
Length() < m_length )
443 throw Error(
"Invalid FFT input vector length." );
461 if ( y.
Length() < m_length )
462 throw Error(
"Invalid FFT output vector length." );
500 if ( m_handleInv ==
nullptr )
501 m_handleInv = this->CreateInv( m_length,
static_cast<complex*
>(
nullptr ) );
502 this->Transform( m_handleInv, y, x );
506 if ( m_handle ==
nullptr )
507 m_handle = this->Create( m_length,
static_cast<complex*
>(
nullptr ) );
508 this->Transform( m_handle, y, x );
522 return FFT1DBase::OptimizedLength( n,
static_cast<complex*
>(
nullptr ) );
542 template <
typename T>
599 PCL_PRECONDITION( (length & 1) == 0 )
620 if ( m_dft.IsEmpty() )
622 if ( m_handle ==
nullptr )
623 m_handle = this->Create( m_length,
static_cast<scalar*
>(
nullptr ) );
624 this->Transform( m_handle, *m_dft, x );
642 if ( m_dft.IsEmpty() )
643 throw Error(
"Invalid out-of-place inverse FFT: No FFT has been performed." );
644 if ( m_handleInv ==
nullptr )
645 m_handleInv = this->CreateInv( m_length,
static_cast<scalar*
>(
nullptr ) );
646 this->Transform( m_handleInv, y, *m_dft );
660 if ( x.
Length() < m_length )
661 throw Error(
"Invalid FFT input vector length." );
679 if ( y.
Length() < m_length )
680 throw Error(
"Invalid FFT output vector length." );
706 if ( m_handle ==
nullptr )
707 m_handle = this->Create( m_length,
static_cast<scalar*
>(
nullptr ) );
708 this->Transform( m_handle, y, x );
737 if ( m_handleInv ==
nullptr )
738 m_handleInv = this->CreateInv( m_length,
static_cast<scalar*
>(
nullptr ) );
739 this->Transform( m_handleInv, y, x );
752 return FFT1DBase::OptimizedLength( n,
static_cast<scalar*
>(
nullptr ) );
765 #ifndef __PCL_NO_FFT1D_INSTANTIATE
778 using FFFT = GenericFFT<float>;
787 using DFFT = GenericFFT<double>;
796 using FRealFFT = GenericRealFFT<float>;
805 using DRealFFT = GenericRealFFT<double>;
Abstract base class of all fast Fourier transform classes.
Fast Fourier transform of 64-bit floating point complex data.
Fast Fourier transform of 64-bit floating point real data.
A simple exception with an associated error message.
Fast Fourier transform of 32-bit floating point complex data.
Fast Fourier transform of 32-bit floating point complex data.
Fast Fourier transform of 32-bit floating point real data.
Generic fast Fourier transform of complex data.
GenericFFT & operator()(complex *y, const complex *x, int dir=PCL_FFT_FORWARD) const
static int OptimizedLength(int n)
Generic fast Fourier transform of real data.
static int OptimizedLength(int n)
GenericRealFFT(int length)
GenericRealFFT & operator()(complex *y, const scalar *x) const
GenericRealFFT & operator()(scalar *y, const complex *x) const
~GenericRealFFT() override
int Length() const noexcept
Fast Fourier transform of 32-bit floating point real data.
A complex number whose components are 64-bit floating point real numbers.
A complex number whose components are 32-bit floating point real numbers.
Array< T, A > & operator<<(Array< T, A > &x, const V &v)
Complex< T1 > operator*(const Complex< T1 > &c1, const Complex< T2 > &c2) noexcept
Console & operator>>(Console &o, char &c)
#define PCL_FFT_BACKWARD
Indicates an inverse Fourier transform.
#define PCL_FFT_FORWARD
Indicates a Fourier transform.