C interface for Fast Fourier Transform. More...

afError af_fft_S (dim3 dim_O, cfloat *d_O, dim3 dim_I, const float *d_I, unsigned batch, int dim, int direction)
 Single precision, One dimensional fft along dimension. More...
 
afError af_fft_C (dim3 dim_O, cfloat *d_O, dim3 dim_I, const cfloat *d_I, unsigned batch, int dim, int direction)
 Complex, Single precision, One dimensional fft along dimension. More...
 
afError af_fft_D (dim3 dim_O, cdouble *d_O, dim3 dim_I, const double *d_I, unsigned batch, int dim, int direction)
 Double precision, One dimensional fft along dimension. More...
 
afError af_fft_Z (dim3 dim_O, cdouble *d_O, dim3 dim_I, const cdouble *d_I, unsigned batch, int dim, int direction)
 Complex, Double precision, One dimensional fft along dimension. More...
 
afError af_fft2_S (unsigned xo, unsigned yo, cfloat *d_O, unsigned xi, unsigned yi, const float *d_I, unsigned batch, int direction)
 Single precision, two dimensional fft. More...
 
afError af_fft2_C (unsigned xo, unsigned yo, cfloat *d_O, unsigned xi, unsigned yi, const cfloat *d_I, unsigned batch, int direction)
 Complex, Single precision, two dimensional fft. More...
 
afError af_fft2_D (unsigned xo, unsigned yo, cdouble *d_O, unsigned xi, unsigned yi, const double *d_I, unsigned batch, int direction)
 Double precision, two dimensional fft. More...
 
afError af_fft2_Z (unsigned xo, unsigned yo, cdouble *d_O, unsigned xi, unsigned yi, const cdouble *d_I, unsigned batch, int direction)
 Complex, Double precision, two dimensional fft. More...
 
afError af_fft3_S (dim3 dims_O, cfloat *d_O, dim3 dims_I, const float *d_I, unsigned batch, int direction)
 Single precision, multi-dimensional fft. More...
 
afError af_fft3_C (dim3 dims_O, cfloat *d_O, dim3 dims_I, const cfloat *d_I, unsigned batch, int direction)
 Complex, Single precision, multi-dimensional fft. More...
 
afError af_fft3_D (dim3 dims_O, cdouble *d_O, dim3 dims_I, const double *d_I, unsigned batch, int direction)
 Double precision, multi-dimensional fft. More...
 
afError af_fft3_Z (dim3 dims_O, cdouble *d_O, dim3 dims_I, const cdouble *d_I, unsigned batch, int direction)
 Complex, Double precision, multi-dimensional fft. More...
 

Detailed Description

C interface for Fast Fourier Transform.

The Fast Fourier Transform (FFT) is an efficient algorithm to compute the discrete Fourier transform (DFT) of a signal or array. This is most commonly used to convert data in the time (or space) domain to the frequency domain, Then, the inverse FFT (iFFT) is used to return the data to the original domain.

There are numerous algorithms to compute the FFT of an array, and the specifics of the algorithm depend on the target hardware. Most algorithms, however, use a Cooley-Tukey scheme in a divide-and-conquer approach.

ArrayFire supports up to three-dimensional FFTs. Typically, these multi-dimensional FFTs are implemented using 1D FFTs combined with transpose operations.

array a = randu(4,4);
// a =
// 0.7402 0.9251 0.4702 0.7140
// 0.9210 0.4464 0.5132 0.3585
// 0.0390 0.6673 0.7762 0.6814
// 0.9690 0.1099 0.2948 0.2920
array f = fft(a);
// f =
// 2.6692 + 0.0000i 2.1487 + 0.0000i 2.0544 + 0.0000i 2.0459 + 0.0000i
// 0.7012 + 0.0480i 0.2578 - 0.3364i -0.3060 - 0.2184i 0.0326 - 0.0665i
// -1.1107 + 0.0000i 1.0362 + 0.0000i 0.4384 + 0.0000i 0.7449 + 0.0000i
// 0.7012 - 0.0480i 0.2578 + 0.3364i -0.3060 + 0.2184i 0.0326 + 0.0665i
array i = ifft(f);
// i =
// 0.7402 + 0.0000i 0.9251 + 0.0000i 0.4702 + 0.0000i 0.7140 + 0.0000i
// 0.9210 + 0.0000i 0.4464 - 0.0000i 0.5132 - 0.0000i 0.3585 - 0.0000i
// 0.0390 + 0.0000i 0.6673 + 0.0000i 0.7762 + 0.0000i 0.6814 + 0.0000i
// 0.9690 - 0.0000i 0.1099 + 0.0000i 0.2948 + 0.0000i 0.2920 + 0.0000i

Function Documentation

afError af_fft_S ( dim3  dim_O,
cfloat d_O,
dim3  dim_I,
const float *  d_I,
unsigned  batch,
int  dim,
int  direction 
)

Single precision, One dimensional fft along dimension.

Parameters
[in]dim_ODimensions of the output array
[out]d_OOutput array (always complex)
[in]dim_IDimensions of the input array
[in]d_IInput array
[in]batchNumber of input tiles
[in]dimDimension along which result is computed (0 along column, 1 along row)
[in]directionDirection of transform: -1 for forward, 1 for backward (inverse)
afError af_fft_C ( dim3  dim_O,
cfloat d_O,
dim3  dim_I,
const cfloat d_I,
unsigned  batch,
int  dim,
int  direction 
)

Complex, Single precision, One dimensional fft along dimension.

afError af_fft_D ( dim3  dim_O,
cdouble d_O,
dim3  dim_I,
const double *  d_I,
unsigned  batch,
int  dim,
int  direction 
)

Double precision, One dimensional fft along dimension.

afError af_fft_Z ( dim3  dim_O,
cdouble d_O,
dim3  dim_I,
const cdouble d_I,
unsigned  batch,
int  dim,
int  direction 
)

Complex, Double precision, One dimensional fft along dimension.

afError af_fft2_S ( unsigned  xo,
unsigned  yo,
cfloat d_O,
unsigned  xi,
unsigned  yi,
const float *  d_I,
unsigned  batch,
int  direction 
)

Single precision, two dimensional fft.

Parameters
[in]xonumber of rows in the output
[in]yonumber of columns in the output
[out]d_OOutput array (always complex)
[in]xinumber of rows in the input
[in]yinumber of columns in the output
[in]d_IInput array
[in]batchNumber of input tiles
[in]directionDirection of transform: -1 for forward, 1 for backward (inverse)
afError af_fft2_C ( unsigned  xo,
unsigned  yo,
cfloat d_O,
unsigned  xi,
unsigned  yi,
const cfloat d_I,
unsigned  batch,
int  direction 
)

Complex, Single precision, two dimensional fft.

afError af_fft2_D ( unsigned  xo,
unsigned  yo,
cdouble d_O,
unsigned  xi,
unsigned  yi,
const double *  d_I,
unsigned  batch,
int  direction 
)

Double precision, two dimensional fft.

afError af_fft2_Z ( unsigned  xo,
unsigned  yo,
cdouble d_O,
unsigned  xi,
unsigned  yi,
const cdouble d_I,
unsigned  batch,
int  direction 
)

Complex, Double precision, two dimensional fft.

afError af_fft3_S ( dim3  dims_O,
cfloat d_O,
dim3  dims_I,
const float *  d_I,
unsigned  batch,
int  direction 
)

Single precision, multi-dimensional fft.

Parameters
[in]dims_ODimensions of the output array
[out]d_OOutput array (always complex)
[in]dims_IDimensions of the input array
[in]d_IInput array
[in]batchNumber of input tiles
[in]directionDirection of transform: -1 for forward, 1 for backward (inverse)
afError af_fft3_C ( dim3  dims_O,
cfloat d_O,
dim3  dims_I,
const cfloat d_I,
unsigned  batch,
int  direction 
)

Complex, Single precision, multi-dimensional fft.

afError af_fft3_D ( dim3  dims_O,
cdouble d_O,
dim3  dims_I,
const double *  d_I,
unsigned  batch,
int  direction 
)

Double precision, multi-dimensional fft.

afError af_fft3_Z ( dim3  dims_O,
cdouble d_O,
dim3  dims_I,
const cdouble d_I,
unsigned  batch,
int  direction 
)

Complex, Double precision, multi-dimensional fft.