-
Notifications
You must be signed in to change notification settings - Fork 9
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
Wigner FFT + IFFT is not the identity for 'DH' sampling and low bandwidths #242
Comments
Adding on this: Similarly, doing the following also passes the assertion: rng = np.random.default_rng(83459)
flmn = s2fft.utils.signal_generator.generate_flmn(rng, L, L, reality=True)
f_so3 = s2fft.transforms.wigner.inverse_jax(flmn, L, L, sampling=sampling)
flmn = s2fft.transforms.wigner.forward_jax(f_so3, L, L, sampling=sampling, reality=True)
f_so3_back = s2fft.transforms.wigner.inverse_jax(flmn, L, L, sampling=sampling)
assert jnp.allclose(f_so3, f_so3_back, atol=1e-8), ("Wigner forward + inverse transform is not "
"the identity") But for an arbitrary (smooth) signal generated on |
Hey @PhilippMisofCH so one of the assumptions of spherical harmonic (and by extension Wigner) transforms is that the underlying signals are band-limited (see e.g. section IV.A of this paper). For signals that are not band-limited the truncation of the summation in equation 9 doesn't hold with equality. GenerallyWhen you generate a random signal in pixel space it isn't necessarily band-limited, and therefore the (on its face reasonable) assumption that forward followed by inverse should return the original signal doesn't hold. SpecificallyThe checkerboard example you use here is a bit of a trick problem I think.
f_so3 = jnp.sin(f_grid[0]) * jnp.cos(f_grid[1]) * jnp.sin(f_grid[2])
# Apply once to bandlimit the signal.
flmn = s2fft.transforms.wigner.forward_jax(f_so3, L, N, sampling=sampling, reality=True)
f_so3 = s2fft.transforms.wigner.inverse_jax(flmn, L, N, sampling=sampling)
# Apply to bandlimited signal to get error.
flmn = s2fft.transforms.wigner.forward_jax(f_so3, L, N, sampling=sampling, reality=True)
f_so3_back = s2fft.transforms.wigner.inverse_jax(flmn, L, N, sampling=sampling) you will find machine precision (or at least that's what I find on my side). SidenoteAs you mention, if you increase |
First of all, thanks again for this nice library. While working with it, I've noticed some unexpected results in my project, which eventually boil down to the fact that applying the inverse Wigner FFT on the Wigner FFT does not yield the original input, not even at low bandwidth ($S^2$ transforms seems to work as expected.
L=8
) anddh
sampling (This is actually one of the only cases that I've tested thoroughly). In contrast, an equivalent setup for theSo I wondered if this is indeed a problem, or it is to be expected.
I've also attached a small example where I test this out:
The first assertion passes, but the second one fails.
I've also looked around at other reported issues and found e.g.
N
than I'm testing hereIt would be great if you could tell me if I misunderstood something or if this is indeed a bug / numerical issue. Thanks in advance!
The text was updated successfully, but these errors were encountered: