Scale the Kaiser-Bessel window to unit peak. - #246
Draft
jenskeiner wants to merge 1 commit into
Draft
Conversation
Accuracy report2254 unchanged · 103 improved · 3 regressed
|
jenskeiner
force-pushed
the
feature/kaiser-bessel-window
branch
from
August 26, 2026 08:42
336181e to
6d9b950
Compare
jenskeiner
marked this pull request as ready for review
August 26, 2026 09:58
jenskeiner
marked this pull request as draft
August 26, 2026 11:01
Contributor
Author
|
Leaving as draft until benchmarks show no regressions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is to improve the numerical properties of Kaiser-Bessel window function evaluations.
In contrast to other windows, the peak of the Kaiser-Bessel window function as used in the code grows with
m. For example, in frequency spacePHI_HUT(n,k,d)isI0(m·b)fork = 0, whereb = π(2 − 1/σ)andσis the oversampling factor, typically somewhere between 2 and 4. This grows quickly withmand applies per dimension. The time domainPHI(n,x,d)has similar properties wherex = 0. Ford = 3andm >= 8, this overflows in single precision, making the transform unusable.Since the NFFT algorithm decomposes into CONV ∘ FFT ∘ DECONV, where the DECONV step divides by
PHI_HUTand CONV multiplies byPHI, a scaling by1 / I0(m·b)of bothPHI_HUTandPHIkeeps the result identical, but removes the undesired scaling.It is important to never evaluate
I0(m·b)directly, but to use the representationexp(−L)withL = log I0(m·b). The exponent-Lcan then be directly integrated into the existing calculations that use exponentials already.The scaling approach itself adds to another issue since the calculation relies on taking the difference of exponents of nearly equal magnitude in three different places. Done naively, this destroys accuracy. Cancellations are avoided by rewriting the respective results into a form without the problematic subtractions.
For a more detailed explanation, see kaiser-bessel-window-numerics.html.