A note on fast cyclic convolution

14 

Loading....

Loading....

Loading....

Loading....

Loading....

Full text

(1)

Carnegie Mellon University

Research Showcase @ CMU

Computer Science Department

School of Computer Science

1970

A note on fast cyclic convolution

Y Zalcstein

Carnegie Mellon University

Follow this and additional works at:

http://repository.cmu.edu/compsci

This Technical Report is brought to you for free and open access by the School of Computer Science at Research Showcase @ CMU. It has been accepted for inclusion in Computer Science Department by an authorized administrator of Research Showcase @ CMU. For more information, please contactresearch-showcase@andrew.cmu.edu.

(2)

NOTICE WARNING CONCERNING COPYRIGHT RESTRICTIONS: The copyright law of the United States (title 17, U.S. Code) governs the making of photocopies or other reproductions of copyrighted material. Any copying of this document without permission of its author may be prohibited by law.

(3)

A NOTE ON FAST CYCLIC CONVOLUTION by

Y. Zalcstein

Computer Science Department Carnegie-Mellon University

Pittsburgh, Pennsylvania December 8, 1970

This work was supported by the Advanced Research Projects Agency of the Office of the Secretary of Defense (F44620-70-C-0107) and is monitored by the Air Force Office of Scientific Research. This document has been approved for public release and sale; its distribution is unlimited.

(4)

ABSTRACT

This note presents a new algorithm for computing the cyclic convolu-tion of two vectors over a commutative ring. The algorithm requires

n(nj+l) •.. ( n ^ + l ) ^ ^ multiplications for the convolution of two n-vectors, where n = n^...n^ is a factorization of n into factors which are pairwise relatively prime.

INDEX TERMS

(5)

Let ^ = (X ( ), xr ...,xn p and ^y = < y0 , yr • • •»yn-1* b e t W O

n-vectors and let jgf'j^ be the convolution of jc^andj^ which is an k

n-vector whose k-th component is ( x *fy) i , » E x y ., k=0, I,..., n-1. A V V K- i~0 K —1.

Convolution occurs in many applications. Computationally, it is more

convenient to use the cyclic convolutionjt*g, defined by

n-1 n-1 n-1 n-1

( E Xiyn- i ' S xiy1-i>---> S x±y <-±>-~> E

x^-l-P

i-0 1 n 1 laO 1 1 i=0 1 J 1 i=0 1 n 1 1

(addition of subscripts modulo n ) . For example, the finite Fourier

transform can only be applied to a cyclic convolution (see Ref. [1]).

Any convolution can be reduced to a cyclic convolution by adjoining

a sufficient number of zeros to the vectors x and y. Computing

A A A

2

directly requires n multiplications. Using the fast Fourier

transform (see [1], [2], [3], [4]), can be computed with

n[31og n + 1] complex multiplications. The Fourier transform (and

a fortiori the fast Fourier transform) does not exist in rings that

do not contain a "sufficient11 number of primitive roots of unity (see

Nicholson [3]). The purpose of this note is to point out a method for 2

computing x*y using less than n multiplications that works over an

AAV

arbitrary commutative ring. In particular, a ring which occurs often

in applications and in which Fourier transforms do not exist is the

ring of integers modulo m for m composite.

Let R be a commutative ring. A circulant or cyclic matrix over R is a matrix of the form:

(6)

-2-x^ • • • X 1 XA. • . n-1 0 ••• X n-1 V 2 i.e., (A(^)

ij Xj ^ (subtraction modulo n ) , i,j = 0,1,...n-1,

where x = (xn,x1,...,x ,) is an n-vector. The convolution x*y is

easily seen to be the first row of A ( J X } . A( ^ (matrix multiplication).

The product of two circulants is a circulant. Thus k(x^.A(^ is determined by its first row which is Jfc^ty) •

LEMMA 1. The product ^ A ^ can be computed using n(n+l)/2 multiplications.

PROOF. For all i and j , there exists k such that j=k-i (mod n ) ; thus n-1

for ijfj, both x y. and x.y, appear in £ x.y, Applying the identity

Xiyj + Xjyi " Xiyi + Xjyj " ( xi"xj><yi~yj>»

after computing the n products x±y±* • • • o n l y n(n-l)/2

more multiplications are needed to compute x.A(y), giving a total of n(n+l)/2 multiplications.

REMARK 1. The standard algorithm for computing ^ A ^ ) requires n(n-l) additions. It is easy to see that the method of lemma 1 requires j n(n-l) additions and subtractions. Thus a saving of n(n-l)/2 multiplications

3

(7)

-3-REMARK 2. By imposing restrictions on the ring R, one can obtain refine-ments of lemma 1. For example, if the characteristic of R is not divisible by 2, the product of two 2x2 circulants can be computed with 2 multiplica-tions (and 6 additions/subtractions) by

x

o

y

o

+ x

i

y

i

=

^ V ^ i ^ o

4

^

+ (x

o~

x

i

)(y

o~

y

i

)]

V i + V o V ^ W ^ P -

(x

o"

x

i

)(y

o"

y

i

)]

-DEFINITION. Let n = ^ . . . n ^ be a factorization of n. An (n^,...,n^) super-circulant matrix is defined inductively as follows: for k=l it is

just an nXn circulant. An (n^,...,n^) super-circulant S is a block matrix whose blocks follow a circulant pattern :

B0 BV ~ Bn^-1

\-l

V "

\-2

B, B„ B

0 J such that each B^ is an (n^,...,n^ ^) super-circulant.

SUPER-CIRCULANT LEMMA (Nicholson and Zalcstein [5]). If n • ^ . . . n ^ with ni »nj relatively prime for i^j ((n^,n.) = 1), then there is a

permutation matrix P such that for any nXn circulant matrix A, p'^AP is an (n^,...,n^) super-circulant.

PROOF. The proof uses the idea of "coordinatizing11 the dimension n, in

(8)

-4-For 0 ^ j ^ n-1, and for p - l,2,...,k, let j be the smallest positive integer congruent to j mod n^. Since the np? s a r e relatively

prime, in pairs, it follows from the Chinese remainder theorem ([6], p. 97) that the map j -> (j^jg*• • • >j^) i s one-to-one. Thus it is easy to see

that the map j -* + 32ni + J 3nin2 + ••• + J knln2# * # nk - l i s o n e"t o"o n e

and, indeed, a permutation of the set {0,1,•..,n-l}. This permutation gives the desired permutation matrix P, as we will now prove.

For m > 0, let be the mXm permutation matrix 0 1 0 . 0 0 1 . * • * 1 0 . 0 . 0 1 0 representing the cyclic permutation

(0 1 2...(m-l)) on {0,1,... ,m-l}.

Recall the definition of the Kronecker product of two matrices (Ref. [7]): If A is an m>flm matrix, the Kronecker or tensor product A(g)B is the mnXmn matrix

anB . . .

(9)

-5-The Kronecker product is associative. Also, it is easy to see that the Kronecker product of permutation matrices is a permutation matrix.

Furthermore, the permutation represented by 0 ® Q ® • • • ® <L

^1 n2 ^Hc

can be described in "coordinatized" form as follows: it maps

h + hni + ••• + jkni \-i i n t o ^ i + 1^ 0 + 2 + 1)ni +- - *+ ^ k+ 1 ) nl • • • \ - l,

where 1j p+^f means addition modulo n^. It is then straightforward to

verify that

-i..

_ .

( 2 )

P QnP = Q ^ ® . . . ®

Let AJ^x^ be an nxn circulant. Then n-1

Z

j 0

X j O ^ , where Qn = In, the nxn identity matrix.

j=0

Thus, applying (2), we get n-1

j=o

n-1 (3) J-0 n-1

V

jl jk (4)

Line (3) follows from the matrix identity (A ® B) . (C (g) D) = (A.C) ® (B.D), while line (4) follows from the identity oJ: = I for all p. If C is

P P i an n ^ ^ circulant for i = l,2,...k, then (g) ... ® is an

(10)

-6-(n^,...,n^) super-circulant. Finally, a linear combination of (n^,..#n^)

super-circulants is an (n^, . . . , 1 ^ ) super-circulant. Thus P *A £ K) P is an (n^,...,n^) super-circulant and the lemma is proved.

(A more conceptual proof appears in [5].)

As a consequence of the super-circulant lemma we obtain the following-; SPEED-UP LEMMA. Suppose there is a function f: N N, where N is the set of positive integers such that for any commutative ring R, the pro-duct of two nXn circulants can be computed with f(n) multiplications. Then, if n = n^...n^, with the n± s relatively prime in pairs, the

product of two nxn circulants can be computed with f (n^) .. .f (n^) multiplications.

PROOF. By the super-circulant lemma it suffices to consider multiplica-tion of two (n^,...,n^) super-circulants. The proof is by inducmultiplica-tion on k. The assertion is trivially true for k=l. Assume that it is true for k and let si»S2 ^e t W O ^nl ' * ' *, nk, nk + l ^ super-circulants. Let

Rf c be the set of all (n^,...,]^) super-circulants over R*. It is

easy to see that R^ is a commutative ring, under matrix addition and multiplication. Sj^ and can be considered n ^+ 1 X n^+^ circulants

over R ^ Thus S^S2 can be computed using f ( n^ p multiplications

in Rfc. Further, by the induction hypothesis each multiplication in R^

requires f(n^)...f(r^) scalar multiplications. Thus the total number of scalar multiplications required is f ( n ^ ... f (n^) f ( n ^ ^ ) . This proves the lemma.

(11)

-7-By lemma 1, we can take f(n) • n(n+l)/2; thus we get the following: PROPOSITION. Let n * n^..!^ with (n^n^) » 1 for i^j. Then

the product of two nxn circulants and thus the convolution of two n-vectors / k

can be computed using n(n^+l) •.. (n^+l)/2 scalar multiplications. REMARK. It is easy to see that the factorization minimizing the number of multiplications by our method is the complete factorization of n into prime-power factors.

(12)

-8-REFERENCES

[1] W. M. Gentleman and G. Sande,lfFast Fourier Transforms for Fun and

Profit,"Proc. 1966 Fall Joint Computer Conference, AFIPS, v. 29, 563-578.

[2] J. W. Cooley, P. A. W. Lewis and P. D. Welch, "The Fast Fourier Transform and Its Applications," IEEE Trans. Education, E-12, 27-34, March,1969.

[3] P. J. Nicholson, Algebraic Theory of the Finite Fourier Transform, Ph.D. thesis, Department of Operations Research, Stanford University, March, 1969.

[4] R. R. Stoner, A Flexible Fast Fourier Transform Algorithm, Army Electronics Command, Fort Huachuca, Arizona, report ECOM-6046 (CFSTI AD 696 431) August, 1969.

[5] P. J. Nicholson and Y. Zalcstein, Super-circulant Matrices and the Fast Fourier Transform, to appear.

[6] J. Landin, An Introduction to Algebraic Structures, Allyn and Bacon, Boston, 1969.

[7] R. Bellman, Introduction to Matrix Analysis, McGraw-Hill, New York, 1960.

(13)

D O C U M E N T C O N T R O L D A T A • R 8

(Security classification of title, body of abstract and indexing annotation must be er

. D

itered when the overall report Is classified)

1. ORIGINATING ACTIVITY (Corporate author) Department of Computer Science Carnegie-Melion University Pittsburgh, Pennsylvania 15213

2 « . R E P O R T S E C U R I T Y C L A S S I F I C A T I O N

UNCLASSIFIED

1. ORIGINATING ACTIVITY (Corporate author) Department of Computer Science Carnegie-Melion University Pittsburgh, Pennsylvania 15213

2 b . G R O U P

3. R E P O R T TITLE

A NOTE ON FAST CYCLIC CONVOLUTION

4. D E S C R I P T I V E NOTES (Type of report and inclusive dates) Scientific Interim

5- Au T H O R ( S ) (First name, middle initial, last name)

Y. Zalcstein 6. REPOR T DATE December 1970 7 a . T O T A L N O . O F P A G E S 7 b . N O . O F R E F S 8 7 8a. C O N T R A C T OR G R A N T N O . F44620-70-C-0107 b. PROJ EC T NO. A0827-5 " 61101D d. 9 a . O R I G I N A T O R ' S R E P O R T N U M B E R ( S ) 8a. C O N T R A C T OR G R A N T N O . F44620-70-C-0107 b. PROJ EC T NO. A0827-5 " 61101D d.

9 b . O T H E R R E P O R T N O ( S ) (Any other numbers that may be assigned

this report)

10. DISTRIBUTION S T A T E M E N T

This document has been approved for public release and sale; its distribution is unlimited.

11. S U P P L E M E N T A R Y NOTES TECH, OTHER

1 2 . S P O N S O R I N G M I L I T A R Y A C T I V I T Y

Air Force Office of Scientific Research

1400 Wilson Boulevard (SRMA) Arlington, Virginia 22209

13. A B S T R A C T

This note presents a new algorithm for computing the cyclic convolution of two vectors over a commutative ring. The algorithm requires n (n i+1)...(nk+1)/2

multiplications for the convolution of two n-vectors, where n = n^...n^ is a factorization of n into factors which are pairwise relatively prime.

D D , F r U 4 7 3

(14)

Security Classification 1 4 . K E Y W O R D S L I N K A L I N K O L I N K C 1 4 . K E Y W O R D S R O L E W T R O L E W T R O . L E W T Security Classification

Figure

Updating...

Related subjects :