Skip to the content.

Specification of the Implemented NFFT Functions and Classes

Back to: Main Page, Overview of the NFFT

We describe all attributes of the basic classes and functions from the NFFT-related objects.

NFFT and NDFT

simple_torch_NFFT.NFFT

The simple_torch_NFFT.NFFT object is a torch.nn.Module. It can be created by

from simple_torch_NFFT import NFFT

nfft = NFFT(N, m=4, n=None, sigma=2.0, window=None, device="cuda" if torch.cuda.is_available() else "cpu", double_precision=False, no_compile=False, grad_via_adjoint=True)

with required argument:

and optional arguments:

The forward method is given by

f = nfft(x, f_hat) # coincides with nfft.forward(x, f_hat)

with requried arguments

and output

Finally, the NFFT object has a method

f_hat = nfft.adjoint(x, f)

with required arguments x and f and output f_hat which have the same shapes as for the forward method. Note that (in contrast to the equispaced Fourier transform), the adjoint NFFT is in general not the inverse of the NFFT.

simple_torch_NFFT.NDFT

For test reasons we also implemented a non-equispaced DFT. We did not tune this implementations (so it is probably not computationally efficient). An NDFT object can be created by

from simple_torch_NFFT import NFFT

ndft = NDFT(N)

with required argument:

It has the forward and adjoint methods

f = ndft(x, f_hat) # coincides with ndft.forward(x, f_hat)
f_hat = ndft.adjoint(x, f)

with the same arguments as the NFFT object.

Window Functions

We implemented two different window functions, namely simple_torch_NFFT.KaiserBesselWindow and simple_torch_NFFT.GaussWindow. The implementation of these window functions is adapted from the NFFT.jl library. The window function is specified in the NFFT function by passing the constructor. It takes the arguments

from simple_torch_NFFT import KaiserBesselWindow
window = KaiserBesselWindow(n, N, m, sigma, device="cuda" if torch.cuda.is_available() else "cpu")

where the arguments are the same as for the NFFT object. Since the constructor is not thought to be called in user-code it does not set default values (this is done in the NFFT constructor).

After the object is initialized it must have an attribute window.ft with the Fourier coefficients of the window function.