Polyomial Multiplicatio ad Fast Fourier Trasform Com S 477/577 Notes Ya-Bi Jia Sep 19, 2017 I this lecture we will describe the famous algorithm of fast Fourier trasform FFT, which has revolutioized digital sigal processig ad i may ways chaged our life It was listed by the Sciece magazie as oe of the te greatest algorithms i the 20th cetury Here we will lear FFT i the cotext of polyomial multiplicatio, ad later o ito the semester reveal its coectio to Fourier trasform Suppose we are give two polyomials: Their product is defied by where px = a 0 +a 1 x+ +a 1 x 1, qx = b 0 +b 1 x+ +b 1 x 1 px qx = c 0 +c 1 x+ c 2 2 x 2 2 c i = max{0,i 1} k mi{i, 1} a k b i k I computig the product polyomial, every a i is multiplied with every b j, for 0 i,j 1 So there are at most 2 multiplicatios, give that some of the coefficiets may be zero Obtaiig every c i ivolves oe fewer additios tha multiplicatios Sothere are at most 2 2+1additios ivolved I short, the umber of arithmetic operatios is O 2 This is hardly efficiet But ca we obtai the product more efficietly? The aswer is yes, by the use of a well-kow method called fast Fourier trasform, or simply, FFT 1 Discrete Fourier Trasform Let us start with itroducig the discrete Fourier trasform DFT problem Deote by ω a th complex root of 1, that is, ω = e i2π, where i 2 = 1 DFT is the mappig betwee two vectors: a 0 â 0 a 1 a = â = â 1 a 1 â 1 1
such that 1 â j = a k ω jk, k=0 It ca also be writte as a matrix equatio: 1 1 1 1 1 ω ω 2 ω 1 1 ω 1 ω 2 1 ω 12 j = 0,, 1 a 0 a 1 a 1 The matrix above is a Vadermode matrix ad deoted by V Essetially, DFT evaluates the polyomial px = a 0 +a 1 x+ +a 1 x 1 = â 0 â 1 â 1 at poits ω 0,ω1,,ω 1 ; i other words, â k = pω k for 0 k 1 From ow o we assume that is a power of 2 If ot, we ca always add i higher order terms with zero coefficiets a = a +1 = = a 2 log 2 1 = 0 The powers of ω are illustrated i the complex plae i the followig figure yi ω /4+1 i ω /4 1 ω /2 1 ω 1 ω /2+1 1 ω 1 x ω 3/4 1 i ω 3/4+1 The fast Fourier trasform algorithm cleverly makes use of the followig properties about ω : ω = 1, ω +k = ω k, ω 2 = 1, ω 2 +k = ω k 2
It uses a divide-ad-coquer strategy More specifically, it divides px ito two polyomials p 0 x ad p 1 x, both of degree 2 1; amely, Hece p 0 x = a 0 +a 2 x+ +a 2 x 2 1, p 1 x = a 1 +a 3 x+ +a 1 x 2 1 I this way the problem of evaluatig px at ω 0,,ω 1 1 evaluatig p 0 x ad p 1 x at ω 0 2, ω 1 2,, ω 1 2, 2 combiig the resultig accordig to 1 px = p 0 x 2 +xp 1 x 2 1 breaks dow ito two steps: Note that the list ω 02, ω 12,, ω 1 2 cosists of oly 2 complex roots of uity, ie, ω,ω 0,,ω 2 2 So the subproblems of evaluatig p 0 x ad p 1 x have exactly the same form as the origial problem of evaluatig px, oly at half the size This decompositio forms the basis for the recursive FFT algorithm preseted below Recursive-DFTa, 1 if = 1 2 the retur a 3 w e i2π 4 w 1 5 a [0] a 0,a 2,,a 2 6 a [1] a 1,a 3,,a 1 7 â [0] Recursive-DFTa [0], 2 8 â [1] Recursive-DFTa [1], 2 9 for k = 0 to 2 1 do 10 â k â [0] k +ωâ[1] k 11 â k+ â[0] 2 k ωâ[1] k 12 ω ωω 13 retur â 0,â 1,,â 1 To verify the correctess, we here uderstad lie 11 i the procedure Recursive-DFT: â k+ 2 = â[0] k ωâ[1] k At the kth iteratio of the for loop of lies 9 12, ω = ω k We have â k+ 2 = â [0] k ωk â [1] k = â [0] = p 0 = p 0 = p k +ωk+ 2 â [1] k ω 2k ω 2k+ ω k+ 2 +ω k+ 2 p 1 ω 2k +ω k+ 2 p 1, from 1 ω 2k+ 3
Let T be the ruig time of Recursive-DFT Steps 1 6 take time Θ Steps 7 ad 8 each takes time T 2 Steps 9 13 take time Θ So we ed up with the recurrece T = 2T +Θ, 2 which has the solutio T = Θlog 2 2 Iverse DFT Suppose we eed to compute the iverse Fourier trasform give by a = V 1 â Namely, we would like to determie the coefficiets of the polyomial px = a 0 + +a 1 x 1 give its values at ω,,ω 0 1 Ca we do it with the same efficiecy, that is, i time Θlog? The aswer is yes To see why, ote that the Vadermode matrix V has iverse 1 1 1 1 V 1 = 1 1 ω 1 ω 2 ω 1 1 ω 1 ω 2 1 ω 12 To verify the above, make use of the equatio 1 j=0 ωk j = 0 for o-egative iteger k ot divisible by Based o the above observatio, we ca still apply Recursive-DFT by replacig a with â, â with a, ω with ω 1 that is, ω 1, ad scalig the result by 1 3 Fast Multiplicatio of Two Polyomials Let us ow go back to the two polyomials at the begiig: Their product px = a 0 +a 1 x+ +a 1 x 1, qx = b 0 +b 1 x+ +b 1 x 1 p qx = px qx = c 0 +c 1 x+ c 2 2 x 2 2 ca be computed by combiig FFT with iterpolatio The computatio takes time Θ log ad cosists of the followig three steps: 1 Evaluatepxadqxat2poitsω 0 2,,ω2 1 2 usigdftthissteptakestimeθlog 4
2 Obtai the values of pxqx at these 2 poits through poitwise multiplicatio This step takes time Θ p qω 0 2 = pω 0 2 qω 0 2, p qω 1 2 = pω1 2 qω1 2, p qω 2 1 2 = pω 2 1 2 qω 2 1 2 3 Iterpolate the polyomial p q at the product values usig iverse DFT to obtai coefficiets c 0,c 1,,c 2 2 This last step requires time Θlog We ca also use FFT to compute the covolutio of two vectors a = a 0,,a 1 ad b = b 0,,b 1, which is defied as a vector c = c 0,,c 1 where j c j = a k b j k, k=0 j = 0,, 1 The ruig time is agai Θlog 4 History of FFT Moder FFT is widely credited to the paper [2] by Cooley ad Tukey But the algorithm had bee discovered idepedetly by a few idividuals i the past Oly the appearace of digital computers ad the wide applicatio of sigal processig made people realize the importace of fast computatio of large Fourier series A icomplete list of pioeers icludes Gauss 1805 the earliest kow origi of the FFT algorithm Ruge ad Köig 1924 the doublig algorithm Daielso ad Laczos 1942 divide-ad-coquer o DFTs Rudick 1960s the first computer program implemetatio with O log time Refereces [1] T H Corme et al Itroductio to Algorithms McGraw-Hill, Ic, 2d editio, 2001 [2] J W Cooley ad J W Tukey A algorithm for the machie calculatio of complex Fourier series Mathematics of Computatio, 1990:297-301, 1965 5