Finite Fourier Series: C Can Be Identified V
Finite Fourier Series: C Can Be Identified V
Akos Magyar
Basics.
Let ZN denote the set of residue classes (mod N ), which can be identied with the set {1, . . . , N }. Addition (mod N ) makes ZN a commutative group, which is also cyclic, as 1 generates it, with 0 being the identity element. The set FN of complex valued functions: f : ZN C can be identied with the n- dimensional complex Euclidean space by assigning the vector: vf = (f (1), . . . , f (n)) to the function f . We recall some basic facts about this space which remains true for the innite dimensional function spaces as well, to be discussed later. Denition 1.0.1 The inner product of the functions f, g FN is dened to be
N
(f, g) =
n=1
f (n)g(n)
(1)
(where z sands for the complex conjugate of z). This has the usual properties Proposition 1.0.1 If f, g, h FN and , are complex numbers then i) (f, g) = (g, f ) ii) (f, f ) 0 and (f, f ) = 0 if and only if f = 0. i3) (f + g, h) = (f, h) + (g, h). The proof is immediate from the denition. Note that (f, f ) = N |f (n)|2 n=1 is the square of the length of the complex vector vf = (f (1), . . . , f (N )). Thus we dene the l2 - norm of the function f by Denition 1.0.2 For f FN let f
2
= (f, f )1/2
Next we give a proof of the cauchy-Schwartz inequality which generalize to other function spaces too. 1
Proposition 1.0.2 If f, g FN then one has |(f, g)|2 (f, f )(g, g) (2)
Proof. One can assume g = 0 and hence (g, g) > 0. We use that (f + tg, f + tg) 0 for all complex numbers t. Writing out this product one gets (f, f ) + 2Re t(g, f ) + |t|2 (g, g) 0 (3)
Taking the derivative formally with respect to t (forgetting about the real part and the absolute value), and setting it to zero, suggests to evaluate this expression at the spacial value: t = (f,g) . This gives (g,g) (f, f ) |(f, g)|2 0 (g, g) (4)
which we wanted to prove. 2. The l2 - norm has the usual properties Proposition 1.0.3 For f, g, FN and C one has i) f
2
= || f
ii) (triangle inequality) f + g 2 | f 2 + | g 2 where equality holds if and only if f = g or g = f for some complex number . Here i) is obvious and ii) is obtained by evaluating f +g and applying the Cauchy-Schwartz inequality.
2 2
= (f +g, f +g)
Next, we introduce a special basis for the space FN consisting of the so-called characters of the group ZN . For 1 m N , let em : ZN C be mn 2i dened by em (n) = e2i N . Also let = e N denote the n-th root of unity, and note that em (n) = mn . From the denition it is immediate Proposition 1.0.4 i) em (0) = 1 and |em (n)| = 1 for all m and n ii) em (k + l) = em (k) em (l) i3) The functions em (1 m N ) form an orthogonal basis of the space FN , more precisely one has (em , en ) = N 0 if m = n otherwise 2 (5)
Proof. Parts i) and ii) are obvious from the denition and so is part i3) when m = n. Note, that if m = n then mn = 1, and the inner product is the geometric series:
N
(em , en ) =
k=1
(mn)k =
(mn)N 1 =0 mn 1
(6)
It follows that the functions em are linearly independent, indeed if N m=1 m em = 0 then taking the inner product of this sum with en one gets N n = 0. They form a basis since the space FN has dimension N . 2 Note that if the 0 denotes the Delta function, that is 0 (0) = 1 and 0 (m) = 0 if m = 0, then (5) can be written in the more compact form: (en , em ) = 0 (n m). Denition 1.0.3 The Fourier transform f , of the function f : ZN C is dened by f (n) = (f, en ) =
N k=1
f (k)e
2i nk N
=
k=1
f (k) nk
(7)
Of fundamental importance are the following: Theorem 1.0.1 Let f, g FN . Then one has i) Fourier inversion formula f (n) = 1 N f (m) mn
m
(8)
1 N
f (m)(m) g
m
(9)
1 N
|f (n)|2
m
(10)
Proof. All three formulae follows from (6). Indeed, substituting the denition of f (m) in (8), one gets: 1 N =
k
f (k) mk mn =
m k k
f (k)
m
1 m(nk) N
f (k) 0 (n k) = f (n)
The same way the right side of (9) becomes 1 N f (n)g(k) m(nk) =
m n,k n,k
f (n)g(k) 0 (n k) =
n
f (n)g(n)
The expansion (8) of a function f is called its Fourier series, using = this takes the usual form: f (n) =
m
2i mn f (m)e N
(11)
2i mn
This is a nite trigonometric sum, indeed e N = cos( 2i mn )+i sin( 2i mn ) N N moreover if f (m) = am + ibm then both the real and the imaginary part of the sum in (14) takes the form:
N 1
f (n) = c0 +
m=1
cm cos(
2i mn 2i mn ) + dm sin( ) N N
(12)
One of the reasons that the Fourier transform: F : f f has wide range of applications is that it has many algebraic properties. Among them is the fact that it takes convolutions into pointwise multiplication. Denition 1.0.4 Let f, g FN . The convolution f g is dened by f g(n) =
k
f (k)g(n k)
(13)
The summation, as always in this section is taken over elements of ZN , unless specied otherwise. Note that f g = g f as can be seen by making the substitution: k := n k in the sum. 4
Proposition 1.0.5 One has f g(m) = f (m)(m) g Proof. The left side of (14) is of the form f (k)g(n k) km (nk)m =
n k k
(14)
f (k) km
n
g(n) nm =
= f (m)(m) g 2 In fact wed also need a twisted version of this fact, let us dene the twisted convolution of the functions f and g by (which has nothing to do with the twisted convolution arising in the Heisenberg group): f g(n) =
k
f (k)g(k n)
(15)
The similarly to (14) one has Proposition 1.0.6 One has f g(m) = f (m)(m) g (16)
If N is a natural number, then let FN denote the Fourier transform of functions dened on ZN , that is:
N 1
FN f (m) =
n=0
2i
nm f (n)N
(17)
where N = e N is the N -th root of unity. If N is large an important practical problem arises which is to compute the Fourier transform using as few elementary operations (such as multiplications and additions) as possible. If M (N ) denotes the minimum number of multiplications needed to compute FN f of any function f : ZN C, then a naive count tells us that M (N ) N 2 . Our aim is to discuss the following 5
Theorem 2.0.2 (Cooley-Tukey 1965) Let N = 2k be a power of two. Then the Fourier transform FN f of any function f : ZN C can be computed by performing at most: M (N ) N (log2 N 1) multiplications. The algorithm behind the above theorem is the so-called Fast Fourier Transform (FFT), and has turned out to be extremely useful in applications, such as in signal processing. It has been implicitly used by many mathematicians, arguably even by Gauss in 1805! It is based on the following Lemma 2.0.1 One has M (2N ) 2M (N ) + 2N . Proof. For f : {0, 1, . . . , 2N 1} C lets denote its restrictions to even and odd numbers by: fe , fo : {0, 1, . . . , N 1} C where fe (n) = f (2n) , fo (n) = f (2n + 1)
2 Also since 2N = N one has by denition if 0 m < N : N 1 N 1 (2n+1)m
F2N f (m) =
n=0 N 1 n=0
2nm f (2n)2N
+
n=0
f (2n + 1)2N
(18)
nm m fe (n)N + 2N
N 1 n=0
while for N m < 2N by writing m = N + m one gets exactly the N same way (using 2N = 1)
m F2N f (m ) = FN fe (m) 2N FN fo (m)
(19)
Now to compute FN fe and FN fo , one needs 2M (N ) multiplications and m then 2N additional multiplications are needed to compute 2N and the m products 2N FN fo (m). This proves the lemma. 2 Proof of Theorem 1.5 Let N = 2k and proceed by induction on k. For k = 1 one has: F2 f (0) = f (0) + f (1) and F2 f (1) = f (0) f (1) so M (2) = 0 For the induction step k k + 1 one has by the above lemma: M (2k+1 ) 2M (2k ) + 2k+1 6
M (2k ) M (2k+1 ) +1k1+1=k 2k+1 2K and this is what we wanted to show. 2 Next we discuss a cheap way of multiplying polynomials of large degree and also large numbers using the FFT. Let p(x) = P an xn and q(x) = Q bm xm be polynomials of degrees n=0 m=0 P and Q. Then their product r(x) = p(x)q(x) is of the form: r(x) = R k k=0 ck x with R = P + Q and for 0 k R one has ck =
n
an bkn
where 0 n P and 0 k n Q
(20)
Again a by naive count, to compute the coecients ck one would rst compute all the products an bm using (P + 1)(Q + 1) multiplications. The idea is that formula (20) looks like the convolutions of functions on ZN dened in (13) which is transformed into point-wise multiplication by the Fourier transform. Let N be a power of 2 such that: P + Q < N 2(P + Q) and dene the functions: f, g : ZN C by: f (n) = and similarly g(m) = bm if 0 n Q 0 if Q < n N 1 an if 0 n P 0 if P < n N 1
ck = f g(k) =
n=0
f (n)g(k n)
Note that the dierence k n is computed in ZN that is (mod N), so if k < n then k n := N (n k). Using the fact that: f g(m) = f (m)(m) one g computes the convolution f g by applying the FFT twice to get f and g , then using N multiplications one gets f g and by one more application of the FFT gives f g. Thus we have Corollary 2.0.1 The product polynomial r(x) = p(x)q(x) can be computed by using no more than M 3N log2 N 2N multiplications, where N 2(P + Q). (21)