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

Fix Fourier itransform with even number of points #1

Open
dlfivefifty opened this issue Apr 19, 2019 · 1 comment
Open

Fix Fourier itransform with even number of points #1

dlfivefifty opened this issue Apr 19, 2019 · 1 comment

Comments

@dlfivefifty
Copy link
Member

julia> f = Fun(Fourier(), randn(5));

julia> f.(points(f))  values(f)
true

julia> f = Fun(Fourier(), randn(6));

julia> f.(points(f))  values(f)
false
@jishnub
Copy link
Member

jishnub commented Apr 19, 2023

This is a bit tricky, as an even number of coefficients requires the highest-order term to be a sin, whereas in a real DFT, one requires all sin terms to be matched by a cos term, with potentially an extra Nyquist cos term without a matching sin. In this case, either we evaluate the inverse transform as f.(points(f)) if ncoefficients(f) is even, or we pad a dummy zero cos coefficient and require the number of points to be odd. In the latter case, we may use FFTs for the inverse transform, so this is the approach that I prefer.

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