public class FftComplex
extends java.lang.Object
When input and output arrays are the same array, transforms are performed in-place. For example, an input array cx[2*nfft] of nfft complex numbers may be the same as an output array cy[2*nfft] of nfft complex numbers. By "the same array", we mean that cx==cy.
Transforms may be performed for any dimension of a multi-dimensional array. For example, we may transform the 1st dimension of an input array cx[n2][2*nfft] of n2*nfft complex numbers to an output array cy[n2][2*nfft] of n2*nfft complex numbers. Or, we may transform the 2nd dimension of an input array cx[nfft][2*n1] of nfft*n1 complex numbers to an output array cy[nfft][2*n1] of nfft*n1 complex numbers. In either case, the input array cx and the output array cy may be the same array, such that the transform may be performed in-place.
Constructor and Description |
---|
FftComplex(int nfft)
Constructs a new FFT, with specified length.
|
Modifier and Type | Method and Description |
---|---|
void |
complexToComplex(int sign,
float[] cx,
float[] cy)
Computes a complex-to-complex fast Fourier transform.
|
void |
complexToComplex1(int sign,
int n2,
float[][] cx,
float[][] cy)
Computes a complex-to-complex dimension-1 fast Fourier transform.
|
void |
complexToComplex1(int sign,
int n2,
int n3,
float[][][] cx,
float[][][] cy)
Computes a complex-to-complex dimension-1 fast Fourier transform.
|
void |
complexToComplex2(int sign,
int n1,
float[][] cx,
float[][] cy)
Computes a complex-to-complex dimension-2 fast Fourier transform.
|
void |
complexToComplex2(int sign,
int n1,
int n3,
float[][][] cx,
float[][][] cy)
Computes a complex-to-complex dimension-2 fast Fourier transform.
|
void |
complexToComplex3(int sign,
int n1,
int n2,
float[][][] cx,
float[][][] cy)
Computes a complex-to-complex dimension-3 fast Fourier transform.
|
int |
getNfft()
Gets the FFT length for this FFT.
|
static int |
nfftFast(int n)
Returns an FFT length optimized for speed.
|
static int |
nfftSmall(int n)
Returns an FFT length optimized for memory.
|
void |
scale(int n1,
float[] cx)
Scales n1 complex numbers in the specified array by 1/nfft.
|
void |
scale(int n1,
int n2,
float[][] cx)
Scales n1*n2 complex numbers in the specified array by 1/nfft.
|
void |
scale(int n1,
int n2,
int n3,
float[][][] cx)
Scales n1*n2*n3 complex numbers in the specified array by 1/nfft.
|
public FftComplex(int nfft)
nfftSmall(int)
and nfftFast(int)
.nfft
- the FFT length, which must be valid.public static int nfftSmall(int n)
n
- the lower bound on FFT length.java.lang.IllegalArgumentException
- if the specified length n exceeds
the maximum length supported by this implementation. Currently, the
maximum length is 720,720.public static int nfftFast(int n)
n
- the lower bound on FFT length.java.lang.IllegalArgumentException
- if the specified length n exceeds
the maximum length supported by this implementation. Currently, the
maximum length is 720,720.public int getNfft()
public void complexToComplex(int sign, float[] cx, float[] cy)
sign
- the sign (1 or -1) of the exponent used in the FFT.cx
- the input array.cy
- the output array.public void complexToComplex1(int sign, int n2, float[][] cx, float[][] cy)
sign
- the sign (1 or -1) of the exponent used in the FFT.n2
- the 2nd dimension of arrays.cx
- the input array.cy
- the output array.public void complexToComplex2(int sign, int n1, float[][] cx, float[][] cy)
sign
- the sign (1 or -1) of the exponent used in the FFT.n1
- the 1st dimension of arrays.cx
- the input array.cy
- the output array.public void complexToComplex1(int sign, int n2, int n3, float[][][] cx, float[][][] cy)
sign
- the sign (1 or -1) of the exponent used in the FFT.n2
- the 2nd dimension of arrays.n3
- the 3rd dimension of arrays.cx
- the input array.cy
- the output array.public void complexToComplex2(int sign, int n1, int n3, float[][][] cx, float[][][] cy)
sign
- the sign (1 or -1) of the exponent used in the FFT.n1
- the 1st dimension of arrays.n3
- the 3rd dimension of arrays.cx
- the input array.cy
- the output array.public void complexToComplex3(int sign, int n1, int n2, float[][][] cx, float[][][] cy)
sign
- the sign (1 or -1) of the exponent used in the FFT.n1
- the 1st dimension of arrays.n2
- the 2nd dimension of arrays.cx
- the input array.cy
- the output array.public void scale(int n1, float[] cx)
n1
- 1st (only) dimension of the array cx.cx
- the input/output array[2*n1].public void scale(int n1, int n2, float[][] cx)
n1
- the 1st dimension of the array cx.n2
- the 2nd dimension of the array cx.cx
- the input/output array[n2][2*n1].public void scale(int n1, int n2, int n3, float[][][] cx)
n1
- the 1st dimension of the array cx.n2
- the 2nd dimension of the array cx.n3
- the 3rd dimension of the array cx.cx
- the input/output array[n3][n2][2*n1].