Skip to main content

Module fftlog

Module fftlog 

Source
Expand description

The fast Hankel transform by Hamilton’s FFTLog (SciPy’s fft.fht, fft.ifht and fft.fhtoffset), and FFTs of Hermitian-symmetric signals (fft.hfft, fft.ihfft).

The Hankel transform A(k) = ∫₀^∞ a(r) J_μ(kr) k dr of a function sampled at logarithmically spaced points becomes a convolution in ln r, which FFTLog evaluates with two real FFTs and a multiplication by the Mellin transform of the Bessel kernel, a ratio of gamma functions.

See the book entry Real QZ, reordering and Hankel transforms.

Functions§

fht
The fast Hankel transform (SciPy’s fht) of a, sampled at r_j = r_c exp((j − j_c) dln), j_c = (n − 1)/2: approximately A(k_j) = ∫₀^∞ a(r) J_μ(k_j r) k_j dr at k_j = exp(offset)/r_c · exp((j − j_c) dln). With bias = q the input is multiplied by (r/r_c)^{−q} and the output by (k/k_c)^{−q}, which can reduce ringing. FFTLog computes it exactly for the periodic, log-spaced interpolant of a: an rFFT, multiplication by u_m = 2^{q} Γ((μ+1+q+iy_m)/2)/Γ((μ+1−q−iy_m)/2) · e^{i y_m (ln 2 − offset)}, an inverse rFFT and a reversal.
fhtoffset
The offset closest to initial that satisfies Hamilton’s low-ringing condition for the given spacing, order and bias (SciPy’s fhtoffset).
hfft
The FFT of a signal with Hermitian symmetry, given by its first half (SciPy’s hfft): a real spectrum of length n (default 2(m − 1) for m inputs), n · irfft(conj(x), n).
ifht
The inverse fast Hankel transform (SciPy’s ifht), undoing fht with the same parameters.
ihfft
The inverse of hfft (SciPy’s ihfft): the first n/2 + 1 bins of the Hermitian signal whose FFT is the real x, conj(rfft(x))/n.
ln_gamma_complex
ln Γ(z) for complex z away from the poles: the recurrence Γ(z) = Γ(z + N)/(z(z+1)…) moves the argument to |z| ≥ 15, where Stirling’s series with eight terms is accurate to rounding. (The imaginary part is determined only modulo 2π, which is all FFTLog needs.)