Class Complex2D
java.lang.Object
ffx.numerics.fft.Complex2D
Compute the 2D FFT of complex, double precision input of arbitrary dimensions
via 1D Mixed Radix FFTs.
For interleaved data, the location of the input point [x, y] within the input array must be:
double real = input[x*nextX + y*nextY]
double imag = input[x*nextX + y*nextY + im]
where
nextX = 2
nextY = 2*nX
im = 1
For blocked data along x, the location of the input point [x, y] within the input array must be:
double real = input[x*nextX + y*nextY]
double imag = input[x*nextX + y*nextY + im]
where for BLOCKED_X
nextX = 1
nextY = 2*nX
im = nX
and for BLOCKED_XY
nextX = 1
nextY = nX
im = nX*nY
- Since:
- 1.0
- Author:
- Michal J. Schnieders
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionComplex2D(int nX, int nY) Create a new 2D Complex FFT for interleaved data.Complex2D(int nX, int nY, DataLayout2D layout, int imOffset) Create a new 2D Complex FFT. -
Method Summary
Modifier and TypeMethodDescriptionvoidfft(double[] input, int index) Compute the 2D FFT.Get the Data Layout.voidifft(double[] input, int index) Compute the 2D IFFT.static double[]initRandomData(int dim, ParallelTeam parallelTeam) Initialize a 2D data for testing purposes.static voidTest the Complex2D FFT.voidsetPackFFTs(boolean packFFTs) Set the 2D transform to pack FFTs into a contiguous array to compute all FFTs at once.voidsetUseSIMD(boolean useSIMD) Set the 2D transform to use SIMD instructions.
-
Constructor Details
-
Complex2D
public Complex2D(int nX, int nY) Create a new 2D Complex FFT for interleaved data.- Parameters:
nX- The number of points in the X dimension.nY- The number of points in the Y dimension.
-
Complex2D
Create a new 2D Complex FFT.- Parameters:
nX- The number of points in the X dimension.nY- The number of points in the Y dimension.layout- The data layout.imOffset- The offset between real and imaginary values.
-
-
Method Details
-
getLayout
-
setUseSIMD
public void setUseSIMD(boolean useSIMD) Set the 2D transform to use SIMD instructions.- Parameters:
useSIMD- True to use SIMD instructions.
-
setPackFFTs
public void setPackFFTs(boolean packFFTs) Set the 2D transform to pack FFTs into a contiguous array to compute all FFTs at once.- Parameters:
packFFTs- True to pack FFTs.
-
fft
public void fft(double[] input, int index) Compute the 2D FFT.- Parameters:
input- The input array must be of size 2 * nX * nY.index- The offset into the input array of the first element.
-
ifft
public void ifft(double[] input, int index) Compute the 2D IFFT.- Parameters:
input- The input array must be of size 2 * nX * nY.index- The offset into the input array of the first element.
-
main
-
initRandomData
Initialize a 2D data for testing purposes.- Parameters:
dim- The dimension of the 2D grid.- Returns:
- The 3D data.
- Since:
- 1.0
-