ifft2#

Perform a 2D inverse FFT. Batching is supported for any tensor with a rank higher than 2.

IFFT kernel fusion is supported by cuFFTDx for complex-to-complex power-of-two square transforms that fit in a single CUDA block when -DMATX_EN_MATHDX=ON is enabled. Unsupported 2D IFFT sizes and real-valued inverse 2D FFTs use the existing cuFFT execution path.

Added in version 0.6.0.

template<typename OpA>
__MATX_INLINE__ auto matx::ifft2(const OpA &a, FFTNorm norm = FFTNorm::BACKWARD)#

Run a 2D IFFT with a cached plan

Creates a new FFT plan in the cache if none exists, and uses that to execute the 2D IFFT. Note that FFTs and IFFTs share the same plans if all dimensions match

Template Parameters:

OpA – Input operator or tensor type

Parameters:
  • a – Input operator

  • norm – Normalization to apply to IFFT

template<typename OpA>
__MATX_INLINE__ auto matx::ifft2(const OpA &a, const int32_t (&axis)[2], FFTNorm norm = FFTNorm::BACKWARD)#

Run a 2D IFFT with a cached plan

Creates a new IFFT plan in the cache if none exists, and uses that to execute the 2D FFT. Note that FFTs and IFFTs share the same plans if all dimensions match

Template Parameters:

OpA – Input operator or tensor data type

Parameters:
  • a – Input operator or tensor

  • axis – axes to perform ifft on

  • norm – Normalization to apply to IFFT

FFT Normalization#

The norm parameter specifies how the FFT and inverse FFT are scaled:

  • FFTNorm::BACKWARD: FFT is unscaled, inverse FFT is scaled by 1/N (default)

  • FFTNorm::FORWARD: FFT is scaled by 1/N, inverse FFT is unscaled

  • FFTNorm::ORTHO: Both FFT and inverse FFT are scaled by 1/sqrt(N)

Examples#

// Perform a 2D FFT from 3D tensor "in" into "out1". This is equivalent to performing the FFT
// on the last two dimension unpermuted.
(out1 = ifft2(in)).run(this->exec);
(out2 = ifft2(in, {1,2})).run(this->exec);
// Perform a 2D FFT from 3D tensor "in" into "out2" across dimensions 2, 0. This is equivalent
// to permuting the tensor before input and after output
(out1.Permute({1,2,0}) = ifft2(in.Permute({1,2,0}))).run(this->exec);
(out2 = ifft2(in, {2,0})).run(this->exec);