Rotacional
Rotacional

Reputation: 13

Vectorize NFFT python

I am using the nfft package for non-equispaced Fast Fourier Transform in python. My question is really simple actually : is there a way to vectorize the function of the package ?

For example, I defined the following function

from nfft import nfft_adjoint
import torch
import numpy as np
def NFFT(x_points, f_noneq, N):
    """Function that performes the non-equidistant fast fourier transform"""
    normalized_x = normalize(x_points) #just a function to normalize input data 
    f_python = nfft_adjoint(normalized_x.numpy(), f_noneq.numpy(), N = N) #here we perform the NFFT
    return torch.tensor(f_python)

However, the inputs for the function nfft_adjoint is only 1D. In torch or numpy, we can specify the dimension i which to perform the FFT. I was looking to implement this technique in my NFFT function.

Upvotes: 0

Views: 39

Answers (0)

Related Questions