Reusable transforms

The generalised FFTLog transforms depend on the coefficient function u, on the logarithmic grid of input value, and on the parameters q and kr, but not on the data to be transformed. It is therefore possible to pre-compute a reusable transform that can be applied repeatedly to different input data.

fftl.build(u, r, *, q=0.0, kr=1.0, low_ringing=True)

Pre-compute a transform that can be applied to data.

Returns a callable transform with signature (ar, *, deriv=False). The logarithmic grid of the transform is available as the attribute k. See fftl.transform() for a description of the parameters.

Examples

>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>> from scipy.special import gamma
>>> import fftl
>>>
>>> def u_laplace(x):
...     # requires Re(x) = q > -1
...     return gamma(1 + x)
...
>>> r = np.logspace(-4, 4, 100)
>>>
>>> t = fftl.build(u_laplace, r, q=0.5)
>>>
>>> plt.loglog(t.k, t(np.tanh(r)))
>>> plt.loglog(t.k, t(np.sqrt(r)))
>>> plt.xlabel('$k$')
>>> plt.ylabel('$T[f](k)$')
>>> plt.show()
_images/build-1.png