You are on page 1of 5

Discrete Hartley transform

A discrete Hartley transform (DHT) is a Fourierrelated transform of discrete, periodic data similar to the
discrete Fourier transform (DFT), with analogous applications in signal processing and related elds. Its main
distinction from the DFT is that it transforms real inputs
to real outputs, with no intrinsic involvement of complex
numbers. Just as the DFT is the discrete analogue of the
continuous Fourier transform, the DHT is the discrete
analogue of the continuous Hartley transform, introduced
by R. V. L. Hartley in 1942.

fore, the discrete Hartley transform is a linear operator. The matrix is invertible; the inverse transformation,
which allows one to recover the xn from the Hk, is simply
the DHT of Hk multiplied by 1/N. That is, the DHT is its
own inverse (involutory), up to an overall scale factor.

The DHT can be used to compute the DFT, and vice


versa. For real inputs xn, the DFT output Xk has a real
part (Hk + HN-k)/2 and an imaginary part (HN-k - Hk)/2.
Conversely, the DHT is equivalent to computing the DFT
of xn multiplied by 1+i, then taking the real part of the
Because there are fast algorithms for the DHT analogous result.
to the fast Fourier transform (FFT), the DHT was origi- As with the DFT, a cyclic convolution z = x*y of two
nally proposed by R. N. Bracewell in 1983 as a more ef- vectors x = (xn) and y = (yn) to produce a vector z =
cient computational tool in the common case where the (zn), all of length N, becomes a simple operation after
data are purely real. It was subsequently argued, how- the DHT. In particular, suppose that the vectors X, Y,
ever, that specialized FFT algorithms for real inputs or and Z denote the DHT of x, y, and z respectively. Then
outputs can ordinarily be found with slightly fewer oper- the elements of Z are given by:
ations than any corresponding algorithm for the DHT (see
below).

Zk
ZN k

Denition

= [Xk (Yk + YN k ) + XN k (Yk YN k )] /2


= [XN k (Yk + YN k ) Xk (Yk YN k )] /2

where we take all of the vectors to be periodic in N (XN


Formally, the discrete Hartley transform is a linear, in- = X0 , etcetera). Thus, just as the DFT transforms a convertible function H : Rn -> Rn (where R denotes the set volution into a pointwise multiplication of complex numof real numbers). The N real numbers x0 , ...., xN are bers (pairs of real and imaginary parts), the DHT transtransformed into the N real numbers H 0 , ..., HN ac- forms a convolution into a simple combination of pairs of
real frequency components. The inverse DHT then yields
cording to the formula
the desired vector z. In this way, a fast algorithm for the
DHT (see below) yields a fast algorithm for convolution.
)
(
)]
[
(
N
1
(Note that this is slightly more expensive than the corre
2
2
sponding
procedure for the DFT, not including the costs
Hk =
xn cos
nk + sin
nk
k = 0,
. . . , N 1
N
N
n=0
of the transforms below, because the pairwise operation
above requires 8 real-arithmetic operations compared to

The combination cos(z) + sin(z) = 2 cos(z 4 ) is the 6 of a complex multiplication. This count doesn't insometimes denoted cas(z), and should be contrasted with clude the division by 2, which can be absorbed e.g. into
the eiz = cos(z) i sin(z) that appears in the DFT the 1/N normalization of the inverse DHT.)
denition (where i is the imaginary unit).
As with the DFT, the overall scale factor in front of
the transform and the sign of the sine term are a mat- 3 Fast algorithms
ter of convention. Although these conventions occasionally vary between authors, they do not aect the essential
Just as for the DFT, evaluating the DHT denition diproperties of the transform.
rectly would require O(N 2 ) arithmetical operations (see
Big O notation). There are fast algorithms similar to the
FFT, however, that compute the same result in only O(N
2 Properties
log N) operations. Nearly every FFT algorithm, from
Cooley-Tukey to Prime-Factor to Winograd (Sorensen et
The transform can be interpreted as the multiplication of al., 1985) to Bruuns (Bini & Bozzo, 1993), has a direct
the vector (x0 , ...., xN) by an N-by-N matrix; there- analogue for the discrete Hartley transform. (However, a
1

4 MULTI-DIMENSIONAL DISCRETE HARTLEY TRANSFORM (MD-DHT)

few of the more exotic FFT algorithms, such as the QFT, with ki = 0, 1, . . . , Ni 1 and where cas(x) = cos(x)+
have not yet been investigated in the context of the DHT.) sin(x).
In particular, the DHT analogue of the Cooley-Tukey
algorithm is commonly known as the fast Hartley
transform (FHT) algorithm, and was rst described by
Bracewell in 1984. This FHT algorithm, at least when
applied to power-of-two sizes N, is the subject of the
United States patent number 4,646,256, issued in 1987
to Stanford University. Stanford placed this patent in the
public domain in 1994 (Bracewell, 1995).
As mentioned above, DHT algorithms are typically
slightly less ecient (in terms of the number of oatingpoint operations) than the corresponding DFT algorithm
(FFT) specialized for real inputs (or outputs). This was
rst argued by Sorensen et al. (1987) and Duhamel &
Vetterli (1987). The latter authors obtained what appears
to be the lowest published operation count for the DHT
of power-of-two sizes, employing a split-radix algorithm
(similar to the split-radix FFT) that breaks a DHT of
length N into a DHT of length N/2 and two real-input
DFTs (not DHTs) of length N/4. In this way, they argued
that a DHT of power-of-two length can be computed
with, at best, 2 more additions than the corresponding
number of arithmetic operations for the real-input DFT.
On present-day computers, performance is determined
more by cache and CPU pipeline considerations than by
strict operation counts, and a slight dierence in arithmetic cost is unlikely to be signicant. Since FHT and
real-input FFT algorithms have similar computational
structures, neither appears to have a substantial a priori
speed advantage (Popovic and Sevic, 1994). As a practical matter, highly optimized real-input FFT libraries are
available from many sources (e.g. from CPU vendors
such as Intel), whereas highly optimized DHT libraries
are less common.

Similar to the 1-D case, as a real and symmetric transform, the MD-DHT is simpler than the MD-DFT. For
one, the inverse DHT is identical to the forward transform, with the addition of a scaling factor;

and second, since the kernel is real, it avoids the computational complexity of complex numbers. Additionally,
the DFT is directly obtainable from the DHT by a simple
additive operation (Bracewell,1983).
The MD-DHT is widely used in areas like image and
optical signal processing. Specic applications include
computer vision, high-denition television, and teleconferencing, areas that process or analyze motion images
(Zeng,2000).

4.1 Fast Algorithms for the MD-DHT


As computing speed keeps increasing, bigger multidimensional problems become computationally feasible,
requiring the need for fast multidimensional algorithms.
Three such algorithms follow.

In pursuit of separability for eciency, we consider the


following transform (Bracewell,1983),
1 , k2 , ..., kr ) = N1 1 N2 1 Nr 1 x(n1 , n2 , ..., nr )cas( 2n1
X(k
n1 =0

n2 =0

nr =0

It was shown in Bortfeld (1995), that the two can be related by a few additions. For example, in 3-D,
1

1 , k2 , k3 ) + X(k1 , k2 , k3 ) +
On the other hand, the redundant computations in FFTs X(k1 , k2 , k3 ) = 2 [X(k

due to real inputs are more dicult to eliminate for large X(k
1 , k2 , k3 ) X(k1 , k2 , k3 )].
prime N, despite the existence of O(N log N) complex- For X
, row-column algorithms can then be implemented.
data algorithms for such cases, because the redundancies This technique is commonly used due to the simplicity
are hidden behind intricate permutations and/or phase ro- of such R-C algorithms, but they are not optimized for
tations in those algorithms. In contrast, a standard prime- general M-D spaces.
size FFT algorithm, Raders algorithm, can be directly
applied to the DHT of real data for roughly a factor of Other fast algorithms have been developed, such as radixtwo less computation than that of the equivalent complex 2,radix-4, and split radix. For example, Boussakta (2000)
FFT (Frigo and Johnson, 2005). On the other hand, a developed the 3-D vector radix,
non-DHT-based adaptation of Raders algorithm for real- X(k1 , k2 , ..., kr ) = N 1 N 1 N 1 x(n1 , n2 , n3 )cas( 2 (n1 k1 +
n1 =0
n2 =0
nr =0
N
input DFTs is also possible (Chu & Burrus, 1982).
n2 k2 + n3 k3 ))

= n1 :even n2 :even n3 :even + n1 :even n2 :even n3 :odd + n1 :e

4 Multi-Dimensional
Discrete + n1 :even n2 :odd n3 :odd + n1 :odd n2 :even n3 :even + n1 :odd
+ n1 :odd n2 :odd n3 :even + n1 :odd n2 :odd n3 :odd .

Hartley Transform (MD-DHT)

It was also presented in Boussakta (2000) that this


algorithm takes ( 74 )N 3 log2 N multiThe rD-DHT (MD-DHT with r dimensions) is given by 3D-vector radix 31
plications and ( 8 )N 3 log2 N additions compared to
N 1 N 1
N 1
2n1 k1
X(k1 , k2 , ..., kr ) = n11=0 n22=0 nrr=0 x(n1 , n2 ,3N
..., 3nlog
r )cas(
and ( 92 )N 3 log2 N + 3N 2
N1 +
2 N multiplications
2nr kr
+ Nr ),
additions from the row-column approach. The drawback

3
is that the implementation of these radix-type of algo- following,
(n+k)
rithms is hard to generalize for signals of arbitrary diN 2 M 2
2g
X4 (g1k , g2l ) = n=0 m=0 x(g1n , g2m )cas( 1N
+
mensions.
(m+l)
2g2
),
Number theoretic transforms have also been used for
M
solving the MD-DHT, since they perform extremely fast k = 0, 1, . . . , N 2
convolutions. In Boussakta (1988), it was shown how to
decompose the MD-DHT transform into a form consist- l = 0, 1, . . . , M 2 .
Which is now a circular convolution. With Y (k, l) =
ing of convolutions:
X4 (g1k , g2l ) , y(n, m) = x(g1n , g2m ) , and h(n, m) =
For the 2-D case (the 3-D case is also covered in the stated
2g n
2g m
cas( N 1 + M2 ) , we have
reference),
N 2 M 2
N 1 M 1
2ml
Y (k, l) =
X(k, l) = n=0 m=0 x(n, m)cas( 2nk
n=0
m=0 y(n, m)h(< k n >N , <
N + M ),
l

m
>
)
k = 0, 1, . . . , N 1 , l = 0, 1, . . . , M 1
M
can be decomposed into 1-D and 2-D circular convolu- Y (k, l) = F N T 1 {F N T [y(n, m)] F N T [h(n, m)]
tions as follows,
where denotes term by term multiplication. It was also

stated in (Boussakta, 1988) that this algorithm reduces

X
(k,
0)
1
the number of multiplications by a factor of 8-20 over
X(k, l) = X2 (0, l)

other DHT algorithms at a cost of a slight increase in the

X3 (k, l)
number of shift and add operations, which are assumed to
where
be simpler than multiplications. The drawback of this alN 1 M 1
2nk
X1 (k, 0) = n=0 ( m=0 x(n, m))cas( N ), k = gorithm is the constraint that each dimension of the transform has a primitive root.
0, 1, . . . , N 1
M 1 N 1
2ml
X2 (0, l) =
m=0 (
n=0 x(n, m))cas( M ), l =
1, 2, . . . , M 1
5 References
N 1 M 1
2ml
X3 (k, l) = n=0 m=0 x(n, m)cas( 2nk
N + M ),
k = 1, 2, . . . , N 1

R. N. Bracewell, Discrete Hartley transform, J.


Opt. Soc. Am. 73 (12), 18321835 (19083).

l = 1, 2, . . . , M 1.
Developing X3 further,

N 1

2nk
n=0 x(n, 0)cas( N )

X3 (k, l)
=
M 1
2ml
m=1 x(0, m)cas( M )
N 1 M 1
+ n=1 m=1 x(n, m)cas( 2nk
N +

2ml
M ).

R. N. Bracewell, The fast Hartley transform, Proc.


IEEE 72 (8), 10101018 (1984).
R. N. Bracewell, The Hartley Transform (Oxford
Univ. Press, New York, 1986).

At this point we present the Fermat number transform


(FNT). The tth Fermat number is given by Ft = 2b + 1
, with b = 2t . The well known Fermat numbers are
for t = 0, 1, 2, 3, 4, 5, 6 ( Ft is prime for 0 t 4
), (Boussakta, 1988). The fermat number transform is
given by
N 1 M 1
X(k, l) = n=0 m=0 x(n, m)1nk 2ml mod Ft

R. N. Bracewell, Computing with the Hartley


Transform, Computers in Physics 9 (4), 373379
(1995).

with k = 0, . . . , N 1, l = 0, . . . , M 1 . 1 and 2
are roots of unity of order N and M respectively (1N =
2M = 1 mod Ft ) .

H. V. Sorensen, D. L. Jones, C. S. Burrus, and M.


T. Heideman, On computing the discrete Hartley
transform, IEEE Trans. Acoust. Speech Sig. Processing ASSP-33 (4), 12311238 (1985).

Going back to the decomposition, the last term for


X3 (k, l) will be denoted as X4 (k, l) , then
N 1 M 1
2ml
X4 (k, l) = n=1 m=1 x(n, m)cas( 2nk
N + M ),
k = 1, 2, . . . , N 1
l = 1, 2, . . . , M 1.
If g1 and g2 are primitive roots of N and M (which are
guaranteed to exist if M and N are prime) then g1 and
g2 map (n, m) to (g1n mod N, g2m mod M ). So mapping n, m, k and l to g1n , g2m , g1k and g2l , we get the

R. V. L. Hartley, A more symmetrical Fourier analysis applied to transmission problems, Proc. IRE
30, 144150 (1942).

H. V. Sorensen, D. L. Jones, M. T. Heideman, and


C. S. Burrus, Real-valued fast Fourier transform algorithms, IEEE Trans. Acoust. Speech Sig. Processing ASSP-35 (6), 849863 (1987).
Pierre Duhamel and Martin Vetterli, Improved
Fourier and Hartley transform algorithms: application to cyclic convolution of real data, IEEE Trans.
Acoust. Speech Sig. Processing ASSP-35, 818824
(1987).

5
Mark A. O'Neill, Faster than Fast Fourier, Byte
13(4):293-300, (1988).
J. Hong and M. Vetterli and P. Duhamel, Baseeld
transforms with the convolution property, Proc.
IEEE 82 (3), 400-412 (1994).
D. A. Bini and E. Bozzo, Fast discrete transform
by means of eigenpolynomials, Computers & Mathematics (with Applications) 26 (9), 3552 (1993).
Miodrag Popovi and Dragutin evi, A new look
at the comparison of the fast Hartley and Fourier
transforms, IEEE Trans. Signal Processing 42 (8),
2178-2182 (1994).
Matteo Frigo and Steven G. Johnson, "The Design
and Implementation of FFTW3, Proc. IEEE 93 (2),
216231 (2005).
S. Chu and C. Burrus, A prime factor FTT [sic] algorithm using distributed arithmetic, IEEE Transactions on Acoustics, Speech, and Signal Processing
30 (2), 217227 (1982).
Thomas Bortfeld, Wofgang Dinter,"Calculation of
Multidimensional Hartley Transforms Using OneDimensional Fourier Transforms, IEEE Trans. on
Signal Processing, 43 (5), 1306-1310 (1995).
S. Boussakta, A.G.J. Holt, Fast Multidimensional
Discrete Hartley Transform using Fermat Number
Transform, IEEE Proc. 135 (6), 235-237 (1988).
S. Boussakta, O. Alshibami, Fast Algorithm for
the 3-D Discrete Hartley Transform, Proc. IEEE
ICASSP '00, 4, 2302-2305 (2000).
Yonghang Zeng, Guoan Bi, Abdul Rahim Leyman, Polynomial Transform Algorithms for Multidimensional Discrete Hartley Transform, IEEE Int.
Symp. on Circuits and Systems, V, 517-520 (2000).

REFERENCES

Text and image sources, contributors, and licenses

6.1

Text

Discrete Hartley transform Source: https://en.wikipedia.org/wiki/Discrete_Hartley_transform?oldid=694577583 Contributors: Michael


Hardy, Nixdorf, Cyp, Stevenj, Charles Matthews, Maximus Rex, Saltine, Robbot, Fredrik, MCBracewell, Lockeownzj00, Keenan Pepper,
Oleg Alexandrov, Woohookitty, Eras-mus, Fred Bradstadt, Mathbot, Bgwhite, Cojoco, SmackBot, Edgar181, Myasuda, Rolfyu, Thijs!bot,
WinBot, Robsavoie, Magioladitis, Robin S, STBot, Spinningspark, VVVBot, Addbot, PV=nRT, Heinzelmann, Luckas-bot, Miym, Staszek
Lem, Lorem Ip, ClueBot NG, Cobn and Anonymous: 23

6.2

Images

File:Img_DHT_prop2.png Source: https://upload.wikimedia.org/wikipedia/commons/a/a8/Img_DHT_prop2.png License: CC BY-SA


4.0 Contributors: Own work Original artist: Cobn

6.3

Content license

Creative Commons Attribution-Share Alike 3.0

You might also like