Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusion about how to accurately perform inverse Fourier transform #14

Open
runburg opened this issue Apr 9, 2021 · 1 comment
Open

Comments

@runburg
Copy link

runburg commented Apr 9, 2021

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)
@prisae
Copy link
Owner

prisae commented Apr 9, 2021

Hi @runburg,

FFTLog needs sometimes a bit playing around and testing for good parameters, to make it work. Question: Did you have a look at the original documentation of FFTLog from Hamilton? I am referring in particular to the section 11. Troubleshooting, https://jila.colorado.edu/~ajsh/FFTLog/#trouble

Also, there is an example in the gallery using a sine: https://pyfftlog.readthedocs.io/en/latest/examples/contrib/sinetransform.html

Let me know if this does not solve your problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants