Exact Deconvolution Using Number-Theoretic Transforms: Comput. Math. Applic
Exact Deconvolution Using Number-Theoretic Transforms: Comput. Math. Applic
Exact Deconvolution Using Number-Theoretic Transforms: Comput. Math. Applic
00
Printed in Great Britain. All rights reserved Copyright © 1988 Pergamon Press pie
Communicated by E. Y. Rodin
Abstract--Using residue arithmetic and number-theoretic transforms, new algorithms of the one- and
two-dimensional deconvolution are described. These algorithms work without round-off errors and yield
the exact solution under natural conditions. By the same method, the exact value of the determinant of
a circulant integer matrix is computed, too.
1. D E C O N V O L U T I O N PROBLEMS
Let us denote by Z the ring o f integers, by [~ the set o f positive integers and by Q the field o f
rational numbers. Let n ~ [~, n > 2. For given n-dimensional integer vectors
a = [a(0) . . . . . a ( n - 1)]TeT/" and b = [ b ( 0 ) . . . . . b(n - 1)]Te Z ", b # o.'=[0 . . . . . 0] T, we want to
solve numerically without r o u n d - o f f errors the following special system o f n linear equations:
(circ a) x = b, (1)
where
F a(0) a(n -- 1) ... a(1)]
circa.-= / all) a!0) a<:2)/ E Z ~x~
La(n--1) a(n -- 2)
... a(O)J
is a nonsingular circulant matrix and x = [x(0) . . . . . x ( n - 1)]T e Q" is an u n k n o w n vector. We
r e m a r k that the one-dimensional deconvolution p r o b l e m (1) can be written as
a * x = b, (2)
Sampling an integer matrix X • 7/" ×" by rows, we obtain the n2-dimensional vector
row X.'=[x(0, 0) . . . . . x(0, n - 1) . . . . . x ( n - 1,0) . . . . . x ( n - l , n - l)]X • 7/"2.
N o t e that x = [ x ( 0 ) , . . . , x ( n 2 - 1)]T = row X if and only if x ( n i + j ) = x ( i , j ) , i , j = 0 . . . . . n - 1.
F o r A • 7/n ×", let
-I A._2 -.- A0
2. RESIDUE ARITHMETIC
I x "Ylm = I l x l , ~ ' l Y l m l m .
Further, if gcd(x, m ) = 1, then there exists a unique integer x ' w i t h / x x ' / m = 1, Ix'l-< (m - 1)/2.
This integer x ' is called m u l t i p l i c a t i v e i n v e r s e o f x ~ 7_ m o d u l o m and x ' is denoted by
/1/
The multiplicative inverse m o d u l o m can be c o m p u t e d via the extended Euclidean algorithm [1].
The symmetric residue o f an integer vector x = [x(0) . . . . . x ( n - 1)]T e Z" m o d u l o m is defined
by
/x/re'.= [Ix(O)~ . . . . . . Ix(n - 1)/m]r • 7/".
Analogously, we explain the symmetric residue o f an integer matrix m o d u l o m. F o r arbitrary
x = Ix(0) . . . . . x ( n - 1)]T• Z" and y = [y(0) . . . . . y ( n - 1)IX• Z ", we have
ix x/. =//x/./x/~/.,
/x _+vim = //X/m "~-/Y/m/m,
/x.v/~ m //X/ ./V/m/m ,
/X (~ Y/m=//X/m ®/Y/m/m,
where o signifies the Hadamard product
X o Y,= [x(i,j) y(i,j)]~i~o,
Me ~
i,j=0
T h e o r e m 2.1
U n d e r above assumptions, any x • Z with Ixl ~ (m - 1)/2 and with given symmetric residues x~,
i = 1. . . . . s can be expressed uniquely in the f o r m
with x t/) • Z, Ix°~l ~ ( m ~ - 1)/2, i = 1. . . . . s. By the Chinese Remainder Theorem, the residue-class
ring 7//m7/ and the direct p r o d u c t Z / m ~ Z x . . . x Z / m s Z are isomorphic. Hence, x • 7 / with
Ix l~< (m - 1)/2 is uniquely determined by its symmetric residues xi, i = 1. . . . . s.
N o w let x • 7/with Ix l~< (m - 1)/2 be given by its symmetric residues x;, i = 1. . . . . s. We have
to show that x ~° = [x~ x2. • .xi], i = 1 , . . . , s. We employ induction on s. The case s = 1 is trivial.
Assume that the assertion is true for s - 1. Setting
y "= [xl] + [xl x2] m~ + . . " + [xl ... Xs_2]ml... m~-3 + [xl . . . xs_ I]ml . . . m s - 2 ,
Z'=[Xl]+[XlX2]mI +'''+[Xl...X~_z]ml...m,_3+[xl...x,_2x,]ml...m,_2, (8)
we have by the induction hypothesis that
w:=y + (z - y ) m , _ l
m s
x = y + /[XI'''Xs-2Xs]--[XI'''Xs-I]/---- m , . .. m~_,.
m s - i m s
It is convenient to exhibit the m o d u l a r divided differences in the form o f a triangular array called
a m o d u l a r divided difference table. This will look for s = 4 as follows:
ml m2 m3 m4
[xt] [x2] [x3] [x41
[x, xd [x, xA [xlx,]
[Xl X 2 2 3 ] [Xl X 2 X 4 ]
[Xl X2X3X4]
In this way, we can reconstruct also integer vectors or integer matrices f r o m the corresponding
symmetric residues.
Corollary 2.2
Let m i ~ N, m i > 1, i = 1. . . . . s, be pairwise relatively prime, odd moduli. Further let
m = m l . . . m s-
(i) Then any x = [x(0) . . . . . x ( n - 1)]xe Z" with Ix(i)l ~< ( m - 1)/2, i = 0 . . . . . n - 1 , and with
given x~:=/X/m,, i = 1. . . . . S, can be represented uniquely in the form
3. N U M B E R - T H E O R E T I C TRANSFORMS
with
Yc(k),=
iffiO
x(i) e a'/ m~
k = O. . . . . n - 1,
y(i),= n
= x ( k ) e-U' / m, i = O . . . . . n --1.
F_ 1 = //n/ra
1 [/e --ik/m]~,k=0
n-lira ,
we get ~ - x = / F x / m and ~ - t x =/F-*X/m for all x ~ Z". In the case n = 2 '+ *, t ~ N, and e = 2, we
obtain the so-called Fermat number transform. By T h e o r e m 3.1, we can choose as possible moduli
m ~ • only divisors > 1 o f ~2, +*(2) = 22` + 1.
The N T T was introduced in [6] and [7] as a natural generalization o f the discrete Fourier
t r a n s f o r m ( D F T ) in order to p e r f o r m fast cyclic convolutions without round-off errors. The N T T
possesses properties resembling those o f the D F T [8, pp. 211-216], particularly the cyclic
convolution property
~'(x • y) = / ~ o ~/,. (10)
for all x, y ~ 7/".
Lemma 3.2
Let x e 7/". Then we have
/F(circ x) F-t/m = diag i , 01)
Met (circ x)/m = 2 (k)/m. 02)
Ik=O
Proof. Let x, y E Z". By (10) and x , y = ( c i r c x ) y , it follows that
3r(circ x) y = 3r(x * y) = / i o Y/re.
Setting z , = ~ , i.e. 3r-~z = / y / = , this yields
oar(circ x) ~ r - tz = / i o z/~ = / ( d i a g i ) z/m
762 G. DRAUSCHKEand M. TASCHE
for all z • Z". Then we obtain (11). Hence we have for the determinant of a circulant matrix
/ - I
Lemma 3.3
Let X • Z" ×". Then we have
/(F ® F) (circ X) (F- ' ® F - l)/,, = diag (row X), (15)
/n-I n 1
/det(circ X)/m =/,~I=o too :c(k, l)/m . (16)
Proof Let X, Y E 7/" ×". By (4) we see that row(X • Y) = (circ X) row Y. Using (13) and (14), we
have then
/(F ® F)(tire X) row Y/m = / ( F ® F) row (X * Y)/m = / r o w F(X * Y)F/m = / ( r o w X) o (row Y)/m.
Setting Z,=¢¢, this yields row Z = / ( F ® F ) row Y/,, by (13). Hence, we obtain by
/row Y/,, = / ( F -1 ® F -l) row Z/m the relation
/(F ® F)(circ X)(F -I ® F -I) row Z/m = / ( r o w X) o (row Z)/,. =/(diag(row X)) row Z/m
for all Z • Z" ×". Thus it follows (15). Calculating the determinants on both sides of (15), we get
the equation (16). This completes the proof. []
Exact deconvolution using number-theoretic transforms 763
x.'=A-Ib = 1 y (18)
with y = [y(0), . . . , y ( n - 1)IT.'= A~dJb. F o r A ~¢.-.- tfaadJti~,J/~,S=o;~ln-I~ 7in ×n, it follows again by Hada-
mard's inequality that
(~£, )(~-,)/2
max la~dJ(i,j)[ <~ a(k) 2
i,j \k =0
Consequently, we obtain that
n- I '~ i n - I \(n- I)/2
m aI x l,y ( i ) ~ c2,= C ~°'= . ~ ( j ) , ) t ~ o a ( k ) ') (19)
Finally, by (21) the unique solution of (1) and (2), respectively reads
1
x=2y~Q".
We s u m m a r i z e this deconvolution algorithm to c o m p u t e the exact solution x e Q" of (1) and (2),
respectively. U n d e r a b o v e mentioned assumptions, the algorithm o f one-dimensional deconvolution
can be expressed as follows:
1. Calculate ai, i = 1 , . . . , s .
2. Calculate di=/d/m,, i = 1. . . . . s by (22).
3. Determine d by (24). Prove that (21) is fulfilled.
4. Determine the H a d a m a r d inverses (~)' o f hi m o d u l o mi, i = 1. . . . . s, via the extended
Euclidean algorithm.
. C o m p u t e G~, i = 1. . . . . s.
6. C o m p u t e xi, i = 1. . . . . s by (26).
7. F o r m / x / , , , , i = 1. . . . . s by (27).
8. Calculate Yi = / d x / m , , i = l , . . . , s .
9. F o r m y by (28).
10. Set
1
x=~y.
N o t e that all operations o f steps 1, 2 and 4-8 can be implemented in parallel manner.
An essential assumption of this deconvolution algorithm is that the value of d is known. We have
seen that d can be calculated via the first three steps of our algorithm described in Section 4. By
the following Lemma, we can easily determine the sign of d.
,=~a(2i-1) >~ ; ~ i a ( 2 i ) .
If we want to calculate only the value of d, where the sign of d is known, via the first three steps
of the algorithm in Section 4, then it is sufficient to choose a finite number of NTTs with pairwise
relatively prime moduli rn~• I~, m~ > 1, i = 1. . . . . s, such that m~... m, I> el + 1 is satisfied instead
of (20).
6. A L G O R I T H M FOR T W O - D I M E N S I O N A L D E C O N V O L U T I O N
Now we extend the first algorithm for the one-dimensional deconvolution problem to the
two-dimensional case.
Let n • N, n > 2. For given integer matrices A, B E Z "×", we consider the two-dimensional
deconvolution problem (3) and (4), respectively. Assume that C..= circ A • 77"2×,2 is nonsingular, i.e.
d.'= det C ~ 0. By Hadamard's inequality, it holds
maxyl()i<
l ~c4=' (k~=' ~ Ib(k'l)l)~k~= o ~=oa(k,l) =)
0,=0 (35)
Now we choose a finite number of NTTs a~,, i = 1 . . . . ,s, of the length n with e ; • Z ,
2 ~< le, I ~< (m~- 1)/2, as primitive nth root of unity modulo an odd integer m~ > 1. Denote the
corresponding transformed matrix of W • Z"*" by "~/~= [~,~(k, I)]~5~=o,=/F~WF~/=,, i = 1. . . . . s.
766 G. DRAUSCHKE and M. TASCHE
Assume that mr, i = 1. . . . . s, are pairwise relatively prime and that m = m j . . . mr fulfils the
condition
max{c3, c4} ~< (m - 1)/2. (36)
Further, we suppose that
gcd(d, m ) = 1. (37)
By (16) we obtain that
drl=ldlm,=lHH,~,(k,l)/, i = 1 . . . . . s. (38)
l k = O /=0 ] mi
1 Q.
X=~YE ×".
Finally, we note that the second deconvolution algorithm described in Section 5 can be extended
in obvious m a n n e r to the two-dimensional case, too.
Exact deconvolution using number-theoretic transforms 767
7. E X A M P L E
100 00] [0 i]
-1 0 --1 -1 --1
A= 1 , B= 0 •
-1 0 -
We want to solve (3) without r o u n d - o f f errors. By (33) and (35) we estimate that Idl ~< 512 and
m a x l y ( i ) l ~< 2048.
i
Thus we have to choose m >/4097 by (36). Let ~'~ be the N T T o f the length 3 with el = 2 as
primitive third root o f unity m o d u l o m~ = 7. Then the corresponding integer matrices o f this N T T
and its inverse read as follows:
-3 2 -
Let ~a~"2 be the N T T o f the length 3 with e 2 = 3 as primitive third root o f unity m o d u l o m 2 = | 3.
Thus we have
F2 -- 3 - , F21 = / - 4 -4 /13"
--4 3 --
Further let ~3 be the N T T o f the length 3 with e3 = 8 as primitive third root o f unity m o d u l o
m3 = 73. Hence it holds
N o t e that m~, m2, m 3 are pairwise relatively prime and that m = ml m2m3 ---- 6643 > 4097. Then we
obtain the exact solution X ~ ~ a × 3 of (3) by following steps:
. ~,l = 2 - , A2 = 3 , A,3 = 8 - 3 •
- 2 - 2 - 21
. (.~,)'= -3
2
-3
-3
- , (-~2)' = [il !1
-- -4
6
(-i-3)' = -9
8
1
-9
7
2 •
. 1~1=
[°°!1
-3
-3
-2
3
- , B2 = [i s :il
--
--
--4
1
B3 --
L°
-3
-3
--
13
14
34
-41
-34
20
•
[ 0 13 -~).
. 51 = -1
-2
, 52 = -
:i]
-
-4
1
53 =
1-24
27
--2019 -- 14
768 G. DRAUSCHKEand M. TASCHE
. /X/7= ]o 1 !1
3
0
0
0
, /XI,3=
E i4 i] -2
5
, /X/73=
F 5
28
-30
2 - 32
26 .
.
YI = Ei2ij 0
0
-- , Y2 = L,2!I
--4
--5
1
4
-- , Y3 = [,423j
22
21
14
--35
-- 17 •
--24
. [Y1] = Yl,
1F
[Y, Y2] = [YI Y3] =
: 31
E! °:!1-5
2 , [Yl Y2Y3] = O, Y=Y3.
REFERENCES
I. J. A. Howell, Exact solution of linear equations using residue arithmetic. Algorithm 406. Commun. A C M 14, 180-184
(1971).
2. S. Cabay and T. P. L. Lam, Algorithm 522 ESOLVE, Congruence techniques for the exact solution of integer systems
of linear equations. A C M Trans. math. Software 3, 404-410 (1977).
3. N. S. Szab6 and R. I. Tanaka, Residue Arithmetic and Its Applications to Computer Technology. McGraw-Hill, New
York 0967).
4. J. A. Howell and R. T. Gregory, An algorithm for solving linear algebraic equations using residue arithmetic. I, II.
BIT 9, 200-224, 324-337 (1969).
5. R. Creutzburg and M. Tasche, Number-theoretic transforms of prescribed length. Math. Comput. 47, 693-701 0986).
6. P. J. Nicholson, Algebraic theory of finite Fourier transforms. J. Comput. System Sci. 5, 524-547 (1971).
7. J. M. Pollard, The fast Fourier transform in a finite field. Math. Comput. 25, 365-374 (1971).
8. H. J. Nussbaumer, Fast Fourier Transform and Convolution Algorithms. Springer, Berlin (1981).
9. M. Mother6, Precise deconvolution using the Fermat number transform. Comput. Math. Applic. 12A, 319-329 (1986).
10. P. J. Davis, Cireulant Matrices. Wiley, New York (1979).