API reference

The transform functions below are reexported from AbstractFastHartleyTransforms. CPU-specific planner keywords include use_r2r; see Plans and buffers and Transform conventions. Backend availability is described in Backends and support.

AbstractFastHartleyTransforms.fht — Function
fht(A [, dims])

Performs a multidimensional Fast Hartley Transform (FHT) of the array A. The optional dims argument specifies an iterable subset of dimensions (e.g. an integer, range, tuple, or array) to transform along. Most efficient if the size of A along the transformed dimensions is a product of small primes; see Base.nextprod. See also plan_fht() for even greater efficiency.

A one-dimensional FHT computes the one-dimensional discrete Hartley transform (DHT) as defined by

\[\operatorname{DHT}(A)[k] = \sum_{n=1}^{\operatorname{length}(A)} \operatorname{cas} \left( \frac{2\pi(n-1)(k-1)}{\operatorname{length}(A)} \right) A[n],\]

where $\operatorname{cas}$ is the cosine-and-sine function, or alternatively called Hartley kernel, defined by

\[\operatorname{cas}(x) = \cos(x) + \sin(x).\]

For transformed axes dims, the phase is the sum of the per-axis phases inside one Hartley kernel. This differs from the separable product of one-dimensional DHTs. The optional FFTW backend setting use_r2r=true retains that separable convention. The inverse is scaled by the product of the lengths of the transformed axes.

source
AbstractFastHartleyTransforms.ifht — Function
ifht(A [, dims])

Multidimensional inverse FHT.

A one-dimensional inverse FHT computes the one-dimensional inverse DHT (IDHT) defined as

\[\operatorname{IDHT}(A)[k] = \frac{1}{\operatorname{length}(A)} \operatorname{DHT}(A)[k]\]

A multidimensional inverse divides the corresponding forward transform by the product of the lengths of the transformed axes, excluding untransformed batch axes.

source
AbstractFastHartleyTransforms.plan_fht — Function
plan_fht(A [, dims]; flags=FFTW.ESTIMATE, timelimit=Inf)

Pre-plan an optimized FHT along given dimensions (dims) of arrays matching the shape and type of A. (The first two arguments have the same meaning as for fht.) Returns an object P which represents the linear operator computed by the FHT, and which contains all of the information needed to compute fht(A, dims) quickly.

source
Base.size — Method
size(p::DHTPlan, [dim])

Return the size of the input of a plan p, optionally at a specified dimension dim.

source

Plans also implement size, ndims, length, eltype, fftdims, multiplication, inversion, and three-argument LinearAlgebra.mul!. Not every FFT plan operation is part of this interface: for example, do not assume five-argument mul! or a generic adjoint(plan) implementation. The mathematical adjoint is explained in Transform conventions.