Previous definitions of a Discrete Hankel Transform (DHT) have focused on methods to approximate the continuous Hankel integral transform without regard for the properties of the DHT itself. Recently, the theory of a Discrete Hankel Transform was proposed that follows the same path as the Discrete Fourier/Continuous Fourier transform. This DHT possesses orthogonality properties which lead to invertibility and also possesses the standard set of discrete shift, modulation, multiplication and convolution rules. The proposed DHT can be used to approximate the continuous forward and inverse Hankel transform. This paper describes the matlab code developed for the numerical calculation of this DHT.
Hankel TransformdiscreteDFTDHTdiscrete transformThis research was financially supported by a Discovery Grant from the Natural Sciences and Engineering Research Council of Canada.(1) OverviewIntroduction
There have been many attempts to define a Discrete Hankel Transform (DHT) in the literature, however prior work has focused on proposing methods to approximate the calculation of the continuous Hankel integral, for example as given in [12]. This stands in stark contrast to the approach taken with the Fourier transform where the Discrete Fourier Transform (DFT) is a transform in its own right, with its own mathematical theory of the manipulated quantities. An additional feature of a carefully derived DFT is that it can be used to approximate the continuous Fourier transform, with relevant sampling and interpolation theories that can be used. Recently, a DHT was proposed as a complete and orthogonal transform that possesses its own mathematical theory, including the standard set of shift, modulation, multiplication and convolution rules [3]. In addition, this DHT can be used to approximate the continuous Hankel transform in the same manner that the Discrete Fourier transform is known to be able to approximate the continuous Fourier transform.
Overview of the Discrete Hankel TransformThe Continuous Hankel Transform
The forward Hankel transform of order n transforms a function f(r) in the spatial domain to a function F(ρ) in the spatial frequency domain and is given by [4, p. 5.6]
This discrete transform consists of taking an N – 1 vector f and a (N – 1) × (N – 1) square matrix of Hankel order n, Y^{nN}, to perform the matrix-vector multiplication and obtain the N – 1 DHT vector F. If the DHT as defined in (3) is used to approximate the CHT, then the vector f represents the sampled function to be transformed and the vector F represents the discrete function in the transformed (Hankel) domain. The Y^{nN} matrix in equation (3) is defined as having the m, k^{th} entry given by
where j_{nk} is the k^{th} zero of the Bessel function of the first kind of order n[3]. Properties of the DHT as defined in equation (3) are shown in [3].
Since the core of the tested discrete transform is the transformation matrix Y^{nN}, various properties have to be maintained. One of these properties is that the matrix Y^{nN} possesses orthogonality properties, where Y^{nN}Y^{nN} = I. In order to preserve the requisite properties of Y^{nN} and therefore of the DHT itself, the first Bessel zero used in computing the entries of the Y^{nN} matrix is the first non-zero value of the Bessel zero of order n. If the Y^{nN} matrix is not assembled following this rule, the matrix loses its orthogonality property and thus performing the discrete transform leads to improper results. If the DHT is used to approximate a CHT, then this restriction also applies to the discretization of the continuous function, as shall be discussed further below.
The inverse discrete Hankel transform f of the vector F is then given by
The discrete forward and inverse Hankel transforms as given in equations (3) and (5) have been shown to possess the standard set of shift, modulation, multiplication and convolution rules. In addition, this DHT can be used to approximate the continuous Hankel transform in the same manner that the Discrete Fourier transform is known to be able to approximate the continuous Fourier transform at certain discrete points.
Discrete Hankel Transform to approximate the Continuous Hankel Transform
Given a continuous function f(r) evaluated at the discrete points r_{nk} in the space domain (1 ≤ k ≤ N – 1), its nth order Hankel-transform function F(ρ) evaluated at the discrete points ρ_{nm} (1 ≤ m ≤ N – 1), can be approximately given by [3]
where α is a scaling factor to be discussed below, and F[m] = F(ρ_{nm}), f[k] = f(r_{nk}).
Conversely, given a continuous function F(ρ) evaluated at the discrete points ρ_{nm} in the frequency domain (1 ≤ m ≤ N – 1), its nth order inverse Hankel transform function f(r) evaluated at the discrete points r_{nk} (1 ≤ k ≤ N – 1), can be approximately given by
For both the forward and inverse transforms, α is a scaling factor which depends on the function properties and shall be discussed further below. The choice of discretization points r_{nk} and ρ_{nm} is also discussed below. The full theory of the discrete Hankel transform is given in [3].
Discretization Points
In order to properly use the discrete transform to approximate the continuous transform, a function has to be discretized at specific sampling points. For a finite spatial range [0, R] and a Hankel transform of order n, these sampling points are given in the space domain as
rnk=jnkjnNR for 1≤k≤N−1
\documentclass[10pt]{article}
\usepackage{wasysym}
\usepackage[substack]{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsbsy}
\usepackage[mathscr]{eucal}
\usepackage{mathrsfs}
\usepackage{pmc}
\usepackage[Euler]{upgreek}
\pagestyle{empty}
\oddsidemargin -1.0in
\begin{document}
\[
{r_{nk}} = \frac{{{j_{nk}}}}{{{j_{nN}}}}R{\rm{ for }}1 \le k \le N - 1
\]
\end{document}
For the finite frequency domain range [0, W_{ρ}] and a Hankel transform of order n, the sampling points are given by
ρnm=jnmjnNWρ for 1≤m≤N−1
\documentclass[10pt]{article}
\usepackage{wasysym}
\usepackage[substack]{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsbsy}
\usepackage[mathscr]{eucal}
\usepackage{mathrsfs}
\usepackage{pmc}
\usepackage[Euler]{upgreek}
\pagestyle{empty}
\oddsidemargin -1.0in
\begin{document}
\[
{\rho _{nm}} = \frac{{{j_{nm}}}}{{{j_{nN}}}}{W_\rho }{\rm{ for }}1 \le m \le N - 1
\]
\end{document}
It is important to note that as in the case of the computation of the transformation matrix Y^{nN}, the first Bessel zero j_{n}_{1} used in computing the discretization points is the first non-zero value.
The relationship Wρ=jnNR
\documentclass[10pt]{article}
\usepackage{wasysym}
\usepackage[substack]{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsbsy}
\usepackage[mathscr]{eucal}
\usepackage{mathrsfs}
\usepackage{pmc}
\usepackage[Euler]{upgreek}
\pagestyle{empty}
\oddsidemargin -1.0in
\begin{document}
\[
{W_\rho } = \frac{{{j_{nN}}}}{R}
\]
\end{document}
, derived in [3], holds between the ranges in space and frequency. Choosing N determines the dimension (size) of the DHT and determines j_{nN}. The determination of j_{nN} (via choosing N) determines the range in one domain once the range in the other domain is chosen. In fact, any two of R, W_{ρ}, j_{nN} can be chosen but the third must follow from W_{ρ}R = j_{nN}. A similar relationship applies when using the Discrete Fourier Transform, any two of the range in each domain and the size of the DFT can be chosen independently.
Scaling Factor
The scaling factor α necessary for using the DHT to approximate the CHT depends on whether the function is space-limited or band-limited. Since it might be hard to determine if a function is space or band limited, the concept of effective limit is introduced. Therefore, a function defined as being “effectively limited in space by R” means that if r > R, then as r → ∞, f(r) → 0. In other words, the function can be made as close to zero as desired by selecting an R that is large enough. The same idea can be applied to the spatial frequency domain, where the effective domain would be denoted by W_{ρ}. The conditions and corresponding scaling factors are listed in Table 1.
The detailed derivation of these scaling factors was shown in [3]. It can be observed that the scaling factors for the space-limited or frequency limited cases can be derived from each other via W_{ρ}R = J_{nN}.
Implementation and architecture
The software is based on the MATLAB programming language. The implementation of the discrete Hankel transform is decomposed into distinct functions. These functions consist of the various steps that have to be performed in order to properly execute the transform. These steps are as follows:
Calculations of N Bessel zeros of the Bessel function of order n
Generation of N sample points (if using the DHT to approximate the continuous transform)
Discretization of the function (if needed)
Creation of the Y^{nN} transformation matrix
Performing the matrix-function multiplication
The steps are the same regardless of if the function is in the space or frequency domain and are summarized in Figure 1.
Steps for evaluation of DHT.
Furthermore, the Y^{nN} transformation matrix is used for both the forward and inverse transform. Steps 2–3 only need to be performed if the function (vector) to be transformed is not already given as a set of discrete points. In the case of a continuous function in either the space or frequency domain, it is important to use the sampling points as proposed in equations (8), (9) and then to discretize the continuous function by evaluating at these points. Failing to do so results in the function not being properly transformed since there is a necessary relationship between the sampling points and the transformation matrix Y^{nN}. In order to perform the steps listed above, several Matlab functions have been developed. These functions are listed in Table 2.
Set of available functions.
Function Name
Calling Sequence
Description
besselzero
besselzero(n,k,kind)
Calculation of k Bessel zeros of the nth order Bessel function of kind – developed in [5]
freqSampler
freqSampler(R,zeros)
Creation of sample points in the frequency domain (eq. (9))
spaceSampler
spaceSampler(R,zeros)
Creation of sample points in the space domain (eq. (8))
YmatrixAssembly
YmatrixAssembly(n,N,zeros)
Creation of Y^{nN} matrix (eq. (4)) from the zeros
Additionally, the matlab script GuidetoDHT.m is included to illustrate the execution of the necessary computational steps.
Quality control
The software was tested by using the DHT to approximate the computation of both the continuous Hankel forward and inverse transforms and comparing the results with known (continuous) forward and inverse Hankel transform pairs. Different transform orders n were evaluated.
For the purpose of testing the accuracy of the DHT and IDHT, the dynamic error was used, defined as [6]
This error function compares the difference between the exact function values f(v) (evaluated from the continuous function) and the function values estimated via the discrete transform, f*(v), scaled with the maximum value of the discretely estimated samples. Equation (10) can be used to evaluate the computation of either forward or inverse Hankel transform via the DHT/IDHT and compared with known continuous Hankel relationships. The dynamic error uses the ratio of the absolute error to the maximum amplitude of the function on a log scale. Therefore, negative decibel errors imply an accurate discrete estimation of the true transform value. The transform was also tested for accuracy on itself. This is performed by consecutive forward and then inverse transformation in order to verify that the transforms themselves do not add errors. For this evaluation, the average absolute error 1N∑i=1N|fi−fi*|
\documentclass[10pt]{article}
\usepackage{wasysym}
\usepackage[substack]{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsbsy}
\usepackage[mathscr]{eucal}
\usepackage{mathrsfs}
\usepackage{pmc}
\usepackage[Euler]{upgreek}
\pagestyle{empty}
\oddsidemargin -1.0in
\begin{document}
\[
\frac{1}{N}\sum\limits_{i = 1}^N {\left| {{f_i} - {f_i}^*} \right|}
\]
\end{document}
was used.
The methodology of the testing is given in further detail in [7] and also in the theory paper, [3].
(2) AvailabilityOperating system
Windows XP and higher.
Programming language
Matlab
Additional system requirements
If using Matlab 7, minimum system requirements are 512MB of RAM (1024 MB recommended) and 460MB of hard disk space. System requirements for Matlab R2014 require 1024 MB (At least 2048 MB recommended) or RAM and 1 GB for MATLAB only, 3–4 GB for a typical installation. This code should run on older versions of Matlab although it was tested using Matlab R2014.
Dependencies
Matlab software by mathworks.
List of contributors
Ugo Chouinard, Natalie Baddour, Greg von Winckel
Software location
Archive (e.g. institutional repository, general repository) (required)
The Discrete Hankel Transform is applicable to many areas of scientific computation and potential reuse could be very high. Further details on applications can be found in [3].
Competing Interests
The authors have no competing interests to declare.
LeutennegerMWyattABaddourNChouinardUTheory and operational rules for the discrete Hankel transformDebnathLBhattaDvon WinckelGBessel Function Zeros – File Exchange – MATLAB Central[Online]. Available at: http://www.mathworks.com/matlabcentral/fileexchange/6794-bessel-function-zeros. [Accessed: 06-Jun-2015]Guizar-SicairosMGutiérrez-VegaJ CComputation of quasi-discrete Hankel transforms of integer order for propagating optical wave fieldsChouinardU