The discrete Hankel transform acts on a vector of sampled data, where the samples are assumed to have been taken at points related to the zeros of a Bessel function of fixed order; compare this to the case of the discrete Fourier transform, where samples are taken at points related to the zeroes of the sine or cosine function.

Starting with its definition, the Hankel transform (or Bessel transform) of
order *\nu* of a function *f* with *\nu > -1/2* is defined as
(see Johnson, 1987 and Lemoine, 1994)

F_\nu(u) = \int_0^\infty f(t) J_\nu(u t) t dt

If the integral exists, *F_\nu* is called the Hankel transformation
of *f*. The reverse transform is given by

f(t) = \int_0^\infty F_\nu(u) J_\nu(u t) u du ,

where *\int_0^\infty f(t) t^{1/2} dt* must exist and be
absolutely convergent, and where *f(t)* satisfies Dirichlet’s
conditions (of limited total fluctuations) in the interval
*[0,\infty]*.

Now the discrete Hankel transform works on a discrete function
*f*, which is sampled on points *n=1...M* located at
positions *t_n=(j_{\nu,n}/j_{\nu,M}) X* in real space and
at *u_n=j_{\nu,n}/X* in reciprocal space. Here,
*j_{\nu,m}* are the m-th zeros of the Bessel function
*J_\nu(x)* arranged in ascending order. Moreover, the
discrete functions are assumed to be band limited, so
*f(t_n)=0* and *F(u_n)=0* for *n>M*. Accordingly,
the function *f* is defined on the interval *[0,X]*.

Following the work of Johnson, 1987 and Lemoine, 1994, the discrete Hankel transform is given by

F_\nu(u_m) = (2 X^2 / j_(\nu,M)^2) \sum_{k=1}^{M-1} f(j_(\nu,k) X/j_(\nu,M)) (J_\nu(j_(\nu,m) j_(\nu,k) / j_(\nu,M)) / J_(\nu+1)(j_(\nu,k))^2).

It is this discrete expression which defines the discrete Hankel
transform calculated by GSL. In GSL, forward and backward transforms
are defined equally and calculate *F_\nu(u_m)*.
Following Johnson, the backward transform reads

f(t_k) = (2 / X^2) \sum_{m=1}^{M-1} F(j_(\nu,m)/X) (J_\nu(j_(\nu,m) j_(\nu,k) / j_(\nu,M)) / J_(\nu+1)(j_(\nu,m))^2).

Obviously, using the forward transform instead of the backward transform gives an
additional factor *X^4/j_{\nu,M}^2=t_m^2/u_m^2*.

The kernel in the summation above defines the matrix of the
*\nu*-Hankel transform of size *M-1*. The coefficients of
this matrix, being dependent on *\nu* and *M*, must be
precomputed and stored; the `gsl_dht`

object encapsulates this
data. The allocation function `gsl_dht_alloc`

returns a
`gsl_dht`

object which must be properly initialized with
`gsl_dht_init`

before it can be used to perform transforms on data
sample vectors, for fixed *\nu* and *M*, using the
`gsl_dht_apply`

function. The implementation allows to define the
length *X* of the fundamental interval, for convenience, while
discrete Hankel transforms are often defined on the unit interval
instead of *[0,X]*.

Notice that by assumption *f(t)* vanishes at the endpoints
of the interval, consistent with the inversion formula
and the sampling formula given above. Therefore, this transform
corresponds to an orthogonal expansion in eigenfunctions
of the Dirichlet problem for the Bessel differential equation.