pyfftlog icon indicating copy to clipboard operation
pyfftlog copied to clipboard

Confusion about how to accurately perform inverse Fourier transform

Open runburg opened this issue 3 years ago • 1 comments

I'm trying to implement FFTLog on a distribution I have that is smooth in log space. It's pictured in the plot below. I take the FT (in the left hand panel), then try to take the IFT to recover the original function but it is not working as anticipated. Can you help me understand how to properly perform the IFT?

FFTlog_trial

Working example:

logtmin = -15
logtmax = 5
n = 4000
mu = 0.5
q = 0
ft = 0
ftopt = 2
tdir = 1
dlogt = (logtmax - logtmin)/n
dlnr = dlogt*np.log(10.0)
ft, xsave = pfl.fhti(n, mu, dlnr, q, kropt=ftopt)

# original signal
fluxes = np.logspace(logtmin, logtmax, num=n)
a_t = np.sin(np.log(fluxes))

# FT
a_f = pfl.fftl(a_t.copy(), xsave, ft, tdir)

# IFT
a_tt = pfl.fftl(a_f.copy(), xsave, ft, -1)

runburg avatar Apr 09 '21 01:04 runburg