ludvigak / FINUFFT.jl

Julia interface to the nonuniform FFT library FINUFFT
Other
33 stars 9 forks source link

on recovering FFTW result? #30

Closed vavrines closed 3 years ago

vavrines commented 3 years ago

Hi @ludvigak I'm just starting learning to use this package, so this could be a noob question. The first step I'm taking is to recover a uniform dft.

For example, in FFTW.jl and FastTransforms.jl, I do the following

using FFTW, FastTransforms
f = [-2.0, 1.52, 0.93] # a random vector
f1 = fft(f)
x = [i/3 for i=0:2] # uniform frequency
f2 = nufft2(f .+ 0.0im, x, 1e-10)

The result f2 is equal to f1.

In FINUFFT.jl, I tried the follwing,

using FINUFFT
nufft1d1(x, f .+ 0.0im, -1, 1e-10, 3)

But the result isn't the same as f1. Did I need to do anything else to use it the right way?

vavrines commented 3 years ago

Just figured out the default settings of coordinates are different in the two packages. So the hand-written nufft1d3 works.

nufft1d3(2pi * x, f .+ 0im, -1, 1e-10, [0., 1., 2.])

Thanks again for this great package!