tfft.nufft
tfft.nufft¶
- nufft(source, points, grid_shape=None, transform_type='type_2', fft_direction='forward', tol=1e-06, options=None)¶
Computes the non-uniform discrete Fourier transform via NUFFT.
Evaluates the type-1 or type-2 non-uniform discrete Fourier transform (NUDFT) via the non-uniform fast Fourier transform (NUFFT) algorithm. Supports 1D, 2D and 3D transforms.
- Parameters
source – A
tf.Tensor
of typecomplex64
orcomplex128
. The source grid, for type-2 transforms, or the source point set, for type-1 transforms. Iftransform_type
is"type_2"
,source
must have shape[...] + grid_shape
, wheregrid_shape
is the shape of the grid and...
is any number of batch dimensions.grid_shape
must have rank 1, 2 or 3. Iftransform_type
is"type_1"
,source
must have shape[..., M]
, whereM
is the number of non-uniform points and...
is any number of batch dimensions.points – A
tf.Tensor
of typefloat32
orfloat64
.float64
. The target non-uniform point coordinates, for type-2 transforms, or the source non-uniform point coordinates, for type-1 transforms. Must have shape[..., M, N]
, whereM
is the number of non-uniform points,N
is the rank of the grid and...
is any number of batch dimensions, which must be broadcastable with the batch dimensions ofsource
.N
must be 1, 2 or 3 and must be equal to the rank ofgrid_shape
. The non-uniform coordinates must be in units of radians/pixel, i.e., in the range[-pi, pi]
.grid_shape – A 1D
tf.Tensor
of typeint32
orint64
. The shape of the output grid. This argument is required for type-1 transforms and ignored for type-2 transforms.transform_type – An optional
str
from"type_1"
,"type_2"
. The type of the transform. A"type_2"
transform evaluates the DFT on a set of arbitrary points given points on a grid (uniform to non-uniform). A"type_1"
transform evaluates the DFT on grid points given a set of arbitrary points (non-uniform to uniform).fft_direction – An optional
str
from"forward"
,"backward"
. Defines the sign of the exponent in the formula of the Fourier transform. A"forward"
transform has negative sign and a"backward"
transform has positive sign.tol – An optional
float
. The desired relative precision. Should be in the range[1e-06, 1e-01]
forcomplex64
types and[1e-14, 1e-01]
forcomplex128
types. The computation may take longer for smaller values oftol
. Defaults to1e-06
.options – A
tfft.Options
structure specifying advanced options. These options may affect the internal details of the computation, but do not change the result (beyond the precision specified bytol
). You might be able to optimize performance or memory usage by tweaking these options. Seetfft.Options
for details.
- Returns
A
tf.Tensor
of the same type assource
. The target point set, for type-2 transforms, or the target grid, for type-1 transforms. Iftransform_type
is"type_2"
, the output has shape[..., M]
, where the batch shape...
is the result of broadcasting the batch shapes ofsource
andpoints
. Iftransform_type
is"type_1"
, the output has shape[...] + grid_shape
, where the batch shape...
is the result of broadcasting the batch shapes ofsource
andpoints
.
References
Barnett, A.H., Magland, J. and Klinteberg, L. af (2019), A parallel nonuniform fast Fourier transform library based on an “exponential of semicircle” kernel. SIAM J. Sci. Comput., 41(5): C479-C504. https://doi.org/10.1137/18M120885X
Shih Y., Wright G., Anden J., Blaschke J. and Barnett A.H. (2021), cuFINUFFT: a load-balanced GPU library for general-purpose nonuniform FFTs. 2021 IEEE International Parallel and Distributed Processing Symposium Workshops (IPDPSW), 688-697 https://doi.org/10.1109/IPDPSW52791.2021.00105