Walsh Hadamard

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

40 Walsh-Hadamard Transformation of a Convolution Radioengineering

J. KOTULIAKOVÁ, M. ZAJAC, A. UŠÁKOVÁ Vol. 11, No. 3, September 2002

WALSH – HADAMARD
TRANSFORMATION OF A CONVOLUTION
DEFINITION 1. Let Nk = 2k, k = 0, 1, 2… A (column)
Anna UŠÁKOVÁ, Jana KOTULIAKOVÁ vector z = x * y ∈ RNk × 1 is called a dyadic convolution of
Dept. of Telecommunication x, y ∈ RNk × 1 if its n-th entry is
Michal ZAJAC N k −1
1
Dept. of Mathematics
Slovak University of Technology
z (n) =
Nk
∑ x(d ) y (n ⊕ d ) ,
d =0
n = 0,1,K N k − 1.

Ilkovičova 3, 812 19 Bratislava


Slovak Republic x ∈ R N k +1 ×1

can be identified with a pair x0, x1 ∈ RNk × 1 :

Abstract [
x = x0T x1T ] T
(1)

A convolution is mathematical operation used in where


signal processing, in the homomorphous signal pro-
cessing and digital image processing (e.g. image inter- x0 = [x (0), x (1),K, x ( N k − 1)] T ,
polation). In regard of computational complexity of the
convolution in the time domain, it used to calculate in x1 = [x ( N k ), x ( N k + 1),K , x ( N k +1 − 1)] T .
the other domain. Exp. x(n) * h(n) → X(Ω) ⋅ H(Ω),
Using this identification we obtain for the convolution
resp. X(Ω) ⋅ H(Ω), shows that a convolution in the time
domain corresponds to multiplication in the Z domain, z = x ∗ y, x, y ∈ R N k +1×1
respectively frequency domain. This paper shows utili-
zation of Walsh-Hadamard orthogonal k +1
1 2 −1
transformations for convolution. z (n) = k +1 ∑ x(d ) y (n ⊕ d ) (2)
2 d =0

1⎧ 1 2k −1
1 2k +1 −1 ⎫
Keywords = ⎨ k
2 ⎩2
∑ x(d ) y (n ⊕ d ) + k
2
∑ x(d ) y (n ⊕ d )⎬ .
d =0 d = 2k ⎭
Convolution, Walsh-Hadamard transformation,
dyadic convolution If 0 ≤ n < 2k (i.e. for coordinates of z0), we obtain in the
first sum of (2) n ⊕ d < 2k, and in the second sum n ⊕ d =
= 2k + [n ⊕ (d - 2k)], consequently
1. Introduction
1
It is well known that for many orthogonal transforma-
z0 = [x0 ∗ y0 + x1 ∗ y1 ].
2
tions, the image of the convolution of a pair of functions is
equal to the product of their transforms. In order to obtain Similarly one can see that z1 = 0.5 [x0 * y1 + x1 * y0], i.e.
an analogous rule for Walsh–Hadamard transformation, the
convolution should be replaced by the dyadic convolution. ⎡ x0 ⎤ ⎡ y0 ⎤ 1 ⎡ x0 ∗ y0 + x1 ∗ y1 ⎤
⎢ x ⎥ ∗ ⎢ y ⎥ = 2 ⎢x ∗ y + x ∗ y ⎥ . (3)
Recall that if ⎣ 1⎦ ⎣ 1⎦ ⎣ 0 1 1 0⎦
∞ ∞
Recall that Hadamard matrices are defined inductively by
m = ∑ mi 2 i n = ∑ ni 2 i .
i =0 i =0
⎡1 1 ⎤ ⎡H k H 2k ⎤
H 1 = [1], H 2 = ⎢ ,K, H 2k +1 = ⎢ 2 (4)
are binary expansions of non-negative integers m, n then ⎥
⎣1 − 1⎦ ⎣ H 2k − H 2k ⎥⎦
their dyadic sum is
k
∞ ×1
and the Walsh-Hadamard transformation x ∈ R 2 is
m ⊕ n = ∑ mi − n i ⋅ 2 . i

i =0
1
Xh = H kx. (5)
m×n
R denotes the space of all m×n matrices with real 2k 2
entries.
Radioengineering Walsh-Hadamard Transformation of a Convolution 41
Vol. 11, No. 3, September 2002 J. KOTULIAKOVÁ, M. ZAJAC, A. UŠÁKOVÁ

THEOREM 1. Let k be a non-negative integer, Nk = 2k 2. Interpolation Using Walsh (or


and x, y ∈ RNk × 1. Then
Sequence) Ordered WHT
z = x ∗ y ⇒ Z h ( n) = X h (n)Yh (n) , n = 0, 1,…2k-1,
For the evaluation of the interpolation of the N1×N2
i.e. Zh is coordinate wise multiplication of Xh and Yh. image I, we can even use the (WHT)w, where we use the
following routine that also applies dyadic convolution of
PROOF. The theorem can be proved by mathematical in- the image and filter in (WHT)w domain:
duction:
1. The assertion is obvious for k = 0. 1. In the spatial domain, the image I, that we want to inter-
polate, is alternately added with zeros to get image I’,
2. Suppose that the theorem holds for k ≥ 0. We prove that i.e.
it holds also for k+1. Using the relations (3) – (5) we
obtain for arbitrary ⎡ I 0,0 I 0,1 I 0, 2 L I 0, N −1 ⎤
⎢ I I1,1 I1, 2 L I1, N −1 ⎥⎥
⎡x ⎤ ⎡y ⎤ ⎢ 1,0 (8)
x = ⎢ 0⎥, y = ⎢ 0⎥, x0 , x1 , y0 , y1 ∈ R N k ×1
I = ⎢ I 2,0 I 2,1 I 2, 2 L I 2, N −1 ⎥ ⇒
⎣ x1 ⎦ ⎣ y1 ⎦ ⎢ ⎥
⎢ M M M O M ⎥
⎢ I N −1,0 I N −1,1 I N −1, 2 L I N −1, N −1 ⎥⎦

1 1 ⎡H k H 2k ⎤ ⎡ x0 ⎤
X h = k +1 H 2k +1 x = k +1 ⎢ 2
2 2 ⎣ H 2k − H 2k ⎥⎦ ⎢⎣ x1 ⎥⎦ ⎡ I 0,0 0 I 0,1 0 L I 0, N −1 0 ⎤
⎢ 0 I1, 0 0 I1,1 L 0 I1, N −1 ⎥⎥
and a similar relation holds for y. Consequently ⎢
⎢ I 2,0 0 I 2,1 0 L I 2, N −1 0 ⎥
⎢ ⎥.
1 ⎡ X + X 1h ⎤ and 1 ⎡Y + Y ⎤ I'= ⎢ 0 I 3, 0 0 I 3,1 L 0 I 3, N −1 ⎥
X h = ⎢ 0h ⎥ Yh = ⎢ 0 h 1h ⎥ . (6)
2 ⎣ X 0 h − X 1h ⎦ 2 ⎣Y0 h − Y1h ⎦ ⎢ M M M M O M M ⎥
⎢ ⎥
⎢ I N −2, 0 0 I N −2,1 0 L I N −2, N −1 0 ⎥
Using (6) and the assumption that the theorem holds for k, ⎢ 0
⎣ I N −1, 0 0 I N −1,1 L 0 I N −1, N −1 ⎥⎦
we obtain for
1 ⎡ x0 ∗ y0 + x1 ∗ y1 ⎤ 2. We compute the (WHT)w spectrum of the image I’ –
z = x∗ y =
2 ⎢⎣ x0 ∗ y1 + x1 ∗ y0 ⎥⎦ WI’(k1, k2).
3. We use the filter type 3 or 4 – their transfer functions
the following: are defined for N = 8 as follows:
1 Type 3:
Zh = H k +1 z
2 k +1 2
⎡1 1 1 1 1 1 1 0⎤
1 1 ⎡ H 2k H 2k ⎤ ⎡ x0 ∗ y0 + x1 ∗ y1 ⎤ ⎢1 1 1 1 1 1 0 0⎥⎥
= ⎢ ⎢
4 2 k ⎣ H 2k − H 2k ⎥⎦ ⎢⎣ x0 ∗ y1 + x1 ∗ y0 ⎥⎦ ⎢1 1 1 1 1 0 0 0⎥
⎢ ⎥ (9)
1 1 1 1 0 0 0 0⎥
1 ⎡ X Y + X 1hY1h + X 0 hY1h + X 1hY0 h ⎤ H 3 (k1, k 2) = ⎢
= ⎢ 0h 0h ⎢1 1 1 1 0 0 0 0⎥
4 ⎣ X 0 hY0 h + X 1hY1h − X 0 hY1h − X 1hY0 h ⎥⎦ ⎢ ⎥
⎢1 1 1 0 0 0 0 0⎥
⎢1 1 0 0 0 0 0 0⎥
1 ⎡( X 0 h + X 1h )(Y0 h + Y1h )⎤ ⎢ ⎥
= = X hYh . (7) ⎣⎢1 0 0 0 0 0 0 0⎦⎥
4 ⎢⎣( X 0 h − X 1h )(Y0 h − Y1h )⎥⎦
Type 4: (10)
This finishes the proof.
⎡ 1 1 1 1 1 1 1 0 . 5⎤
REMARK. Theorem 1 holds for another order of Walsh ⎢1 1 1 1 1 1 0 . 5 0 ⎥
functions since the corresponding transform of x ∈ RNk × 1 ⎢ ⎥
⎢1 1 1 1 1 0.5 0 0⎥
can be obtain from its Hadamard transform Xh by a fixed ⎢ ⎥
permutation of components of Xh. ⎢ 1 1 1 1 0.5 0 0 0⎥
H 4 (k1, k 2) =
⎢1 1 1 0.5 0 0 0 0⎥
⎢ ⎥
⎢1 1 0. 5 0 0 0 0 0⎥
⎢ 1 0. 5 0 0 0 0 0 0⎥
⎢ ⎥
⎢⎣0.5 0 0 0 0 0 0 0 ⎥⎦
42 Walsh-Hadamard Transformation of a Convolution Radioengineering
J. KOTULIAKOVÁ, M. ZAJAC, A. UŠÁKOVÁ Vol. 11, No. 3, September 2002

i.e., multiply element by element (WHT)w’s of I’ with N fast Fourier transform coefficients Fx(k), k = 0, 1…N-1 is
transfer function of the filter N ⋅ log2N complex multiplies and adds. On the other side,
N2 additions and subtractions are required to compute the
Y(k1,k2) = WI’(k1,k2) ⋅ H(k1,k2). (11) (WHT)w coefficients Wx(k), where k = 0, 1… N-1. A fast
4. The reconstructed image is given by the equation algorithm (FWHT)w yields the Wx(k), k = 0, 1… N-1, in
N ⋅ log2N additions and subtractions. In frequency domain
y(n1,n2) = 2 ⋅ (UN1)T ⋅ Y(k1,k2) ⋅ UN2 (12) (FFT), we required complex multiplications element by
element, in comparison with (WHT)w, where we do only
where UN1 is the base of 1-D (WHT)w. real multiplications element by element.

References
[1] AHMED, N., RAO, K. R. Orthogonal Transforms for Digital
Signal Processing. Berlin: Springer-Verlag, 1975.

[2] ELLIOT, D. F., RAO, K. R. Fast Transforms, Algorithms,


Analyses, Applications. Orlando: Academic Press, 1982.

[3] Grant project No. 1/7625/20 of the Ministry of Education of the


a) b)
Slovak Republic

About authors...
Jana KOTULIAKOVÁ (Doc, Ing, CSc) was born (1939)
in Levoča, graduated in 1962 in Faculty of Electrical Engi-
neering of the Slovak University of Technology in Brati-
slava. Since 1964 she has been working at the Dept. of
Telecommunications. She received the CSc (PhD) degree
in 1980. In 1988 she received the Doc (associate professor)
c) d)
degree. Her research interests include digital signal proces-
sing, digital filtering.

Michal ZAJAC (Doc, RNDr, CSc) was born in 1951 in


Bratislava, in 1975 graduated in Mathematics from the
Comenius University in Bratislava. He received the CSc
(PhD) degree in 1983 from the Institute of Mathematics of
the Czechoslovak Academy of Sciences, Prague. In period
1975-1991 he was with the Mathematical Institute of Slo-
vak Academy of Sciences, Bratislava. Since 1991 he has
e)
been working at the Department of Mathematics, Faculty
of Electrical Engineering and Information Technology of
the Slovak University of Technology in Bratislava. In 1994
Fig. 1 Image LENA 256×256 a) original, b) under sampled, 1. he received the Doc (associate professor) degree from the
order and alternately added with zeros, c) interpolated 2D- Comenius University. His research interests include linear
DFT, d) interpolated (WHT)w+ filter 3, e) interpolated algebra and functional analysis, and their applications in
(WHT)w+ filter 4 engineering.

Anna UŠÁKOVÁ (Ing) was born (1977) in Trnava, gra-


duated in January 2001 in the Faculty of Electrical
3. Conclusion Engineering and Information Technology of the Slovak
University of Technology in Bratislava. She is
For comparison, I mention the computational comple- postgraduate student at the Dept. of Telecommunications
xity of using the fast Fourier transform and using Walsh – FEI STU in Bratislava. Her research interests include
Hadamard transform. Computational complexity for a orthogonal transformations, digital image processing.

You might also like