Package ffx.numerics.fft
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 = nX
im = nX
and for BLOCKED_XY
nextX = 1
nextY = nX*nY
im = nX*nY
- Since:
- 1.0
- Author:
- Michal J. Schnieders
- See Also:
-
Constructor Summary
ConstructorDescriptionComplex2D
(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 TypeMethodDescriptionvoid
fft
(double[] input, int index) Compute the 2D FFT.Get the Data Layout.void
ifft
(double[] input, int index) Compute the 2D IFFT.void
setPackFFTs
(boolean packFFTs) Set the 2D transform to pack FFTs into a contiguous array to compute all FFTs at once.void
setUseSIMD
(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
Get the Data Layout.- Returns:
- The layout.
-
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.
-