Discrete Fourier Transform Functions#

oneMKL provides a DPC++ interface to d-dimensional (dZ>0) Discrete Fourier Transforms (DFTs).

Definitions#

Let wk1,k2,,kdm be the entry of multi-index (k1,k2,,kd)Zd in the m-th sequence of a set w of M d-dimensional periodic discrete sequences of period(s) (or “length(s)”) n1×n2××nd (MZ>0, m{0,1,,M1} and nZ>0,{1,,d}).

For every m{0,1,,M1}, the DFT of sequence wm is the d-dimensional n1×n2××nd periodic discrete sequence zm whose entries are defined as

(1)#zk1,k2,,kdm=σjd=0nd1j2=0n21j1=0n11wj1,j2,,jdmexp[δ2πı(=1djkn)] (k1,,kd)Zd

where ı2=1 and σ is a scale factor. In (1), δ determines one of the two “directions” of the DFT: δ=1 defines the “forward DFT” while δ=+1 defines the “backward DFT”.

The domain of input (resp. output) discrete sequences for a forward (resp. backward) DFT is referred to as “forward domain”. Conversely, the domain of output (resp. input) discrete sequences for forward (resp. backward) DFT is referred to as “backward domain”.

oneMKL supports single-precision (fp32) and double-precision (fp64) floating-point arithmetic for the calculation of DFTs, using two types of forward domains:

  • the set of complex d-dimensional periodic sequences, referred to as “complex forward domain”;

  • the set of real d-dimensional periodic sequences, referred to as “real forward domain”.

Similarly, we refer to DFTs of complex (resp. real) forward domain as “complex DFTs” (resp. “real DFTs”). Regardless of the type of forward domain, the backward domain’s data sequences are always complex.

The calculation of the same DFT for several, i.e., M>1, data sets of the same type of forward domain, using the same precision is referred to as a “batched DFT”.

Finite range of indices#

In general, given the periodicity of the discrete data considered in any DFT, ranges of indices (k1,,kd)Zd such that 0k<n,{1,,d} suffice to determine any relevant d-dimensional sequence unambiguously (for any valid m). In case of real DFTs, the data sequences in backward domain can be fully determined from a smaller range of indices. Indeed, if all entries of w are real in (1), then the entries of z are complex and, for any valid m, (zk1,k2,,kdm)=zn1k1,n2k2,,ndkdm (k1,k2,,kd)Zd where λ represents the conjugate of complex number λ. This conjugate symmetry relation makes roughly half the data redundant in backward domain: in case of real DFTs, the data sequences in backward domain can be fully determined even if one of the d indices k is limited to the range 0kn2. In oneMKL, the index kd, i.e., the last dimension’s index, is restricted as such for capturing an elementary set of non-redundant entries of data sequences belonging to the backward domain of real DFTs.

Elementary range of indices#

In other words, oneMKL expects and produces a set of M d-dimensional finite data sequences ()k1,k2,,kdm with integer indices m and k ({1,,d}) in the elementary range

  • 0m<M;

  • 0kj<nj, j{1,,d1}, if d>1;

  • 0kd<nd, except for backward domain’s data sequences of real DFTs;

  • 0kdnd2, for backward domain’s data sequences of real DFTs.

Additional constraints for data in backward domain of real DFTs#

Finally, note that the conjugate symmetry relation further constrains some of the entries (or pairs thereof) in the backward domain’s data sequences for real DFTs. Specifically, for any of the M sequences,

  • the imaginary part must be 0 for any entry of multi-index (k1,k2,,kd) such that k(nk)(modn),{1,,d}, e.g., entry of multi-index (0,0,,0);

  • pairs of entries of multi-indices (k1,k2,,kd) and (j1,j2,,jd) such that k(nj)(modn),{1,,d} must be complex conjugates of one another, e.g., entries of multi-indices (1,0,,0) and (n11,0,,0) must be complex conjugates (note that this case falls back to the above constraint if n1=2).

Note

The behavior of oneMKL is undefined for real backward DFT if the input data does not satisfy those constraints. oneMKL considers it the user’s responsibility to guarantee that these constraints are satisfied by the input data for real backward DFTs.