And from an interface point of view: Isn’t nufft2 the adjoint of nufft2 (modulo conjugation). The NFFT is quite often used as an operator when solving linear systems of equations and there you usually want that pair. In my (internal) software on MRI reconstruction we overload A_mul_B! and Ac_mul_B! for this purpose.
Hi Tobias, there is some support for 2D nufft’s of types I-I and II-II, but the multi-dimensional support is not fully fleshed out. You are right, nufft1 and nufft2 are adjoints, modulo conjugation.
I’m interested in a performance comparison, too, and the first step is actually getting a release of this approach.
There are four levels to the 1D interface:
the functions nufft1/2/3(args...) plan & execute;
the functions plan_nufft1/2/3(args...) construct plans;
if p is an NUFFTPlan, then p*c applies the plan; and,
A_mul_B!(out, p, in) applies the plan to the in array in-place on the out array.
For a fair comparison, methods should be compared at the same tolerance ϵ.
Note that a hierarchical approach to the Chebyshev–Legendre transform accelerated the execution phase (of any previous methods in FastTransforms.jl) by a factor of ~20. With some effort, Dutt & Rokhlin’s hierarchical nonuniform FFT method could be implemented based on the HierarchicalMatrices.jl framework.
No, in this case I do not really see a need for that. It should be possible to have a single NFFT package that allows to switch different algorithms in its backend.
FastTransforms.jl is more high level and can then integrate the low level packages (where NFFT is just one example)
I think that’s what I meant: a package that wraps the different algorithms for the different transforms, with a consistent naming scheme and consistent way to specify algorithms.
Talking about a common interface maybe this package could be interesting: AbstractOperators.jl.
This offers a common interface that allows to easily combine linear and nonlinear transformations and use them in inverse problems (through the package StructuredOptimization).
In case you find this interesting feel free to contribute!
We present FINUFFT, an efficient parallel library for type 1 (nonuiform to uniform), type 2 (uniform to nonuniform), or type 3 (nonuniform to nonuniform) transforms, in dimensions 1, 2, or 3. It uses minimal RAM, requires no precomputation or plan steps, and has a simple interface to several languages. […] For types 1 and 2, rigorous error bounds asymptotic in the kernel width approach the fastest known exponential rate, namely that of the Kaiser–Bessel kernel. We benchmark against several popular CPU-based libraries, showing favorable speed and memory footprint, especially in three dimensions when high accuracy and/or clustered point distributions are desired.
The current implementation is ca. 10 times slower than Base.fft() for comparable rectangular grids. However significant optimization should be possible by preallocating and reusing temporary arrays.