next up previous
Next: Bibliography Up: Efficient implementation Previous: Efficient implementation

Towards an iterative algorithm for the DTF

We first change the intermediate polynomials. Let n = 2r mathend000# be a power of 2 mathend000#, let $ \omega$ $ \in$ R mathend000# be a primitive n mathend000#-th root of unity and A(x) = $ \Sigma_{{{0 \, \leq \, i \, < \, n}}}^{{}}$ ai xi mathend000#. We define

A[0](x) = a0 + a2x + a4x2 + ... + an-2xn/2-1
A[1](x) = a1 + a3x + a5x2 + ... + an-1xn/2-1
(55)

such that we have

A(x)  =  A[0](x2) + x A[1](x2). (56)

Hence evaluating A mathend000# at 1,$ \omega$,$ \omega^{{2}}_{{}}$,...,$ \omega^{{{n-1}}}_{{}}$ mathend000# is reduced to evaluate A[0] mathend000# and A[1] mathend000# at 1,$ \omega^{{2}}_{{}}$,$ \omega^{{4}}_{{}}$,...,$ \omega^{{{2n-2}}}_{{}}$ mathend000#. But this second sequence of powers of $ \omega$ mathend000# consists of two identical sequences of length n/2 mathend000#. Indeed, for every integer k mathend000# we have

($\displaystyle \omega^{{{k+ n/2}}}_{{}}$)2  =  ($\displaystyle \omega^{{{k}}}_{{}}$)2 (57)

Since $ \omega^{{{k}}}_{{}}$(1 - $ \omega^{{{n/2}}}_{{}}$) $ \neq$ 0 mathend000# holds, we obtain

$\displaystyle \omega^{{{k+ n/2}}}_{{}}$  =   - $\displaystyle \omega^{{{k}}}_{{}}$ (58)

Hence we only need to evaluate A[0] mathend000# and A[1] mathend000# at

1,$\displaystyle \omega^{{2}}_{{}}$,$\displaystyle \omega^{{4}}_{{}}$,...,$\displaystyle \omega^{{{n-2}}}_{{}}$. (59)

This provides us directly with the values of A mathend000# at

1,$\displaystyle \omega$,$\displaystyle \omega^{{2}}_{{}}$,...,$\displaystyle \omega^{{{n/2-1}}}_{{}}$ (60)

and the values of A mathend000# at

$\displaystyle \omega^{{{n/2}}}_{{}}$,$\displaystyle \omega^{{{n/2+1}}}_{{}}$,...,$\displaystyle \omega^{{{n-1}}}_{{}}$ (61)

by using the fact these numbers are respectively equal to

-1, - $\displaystyle \omega$, - $\displaystyle \omega^{{2}}_{{}}$,..., - $\displaystyle \omega^{{{n/2-1}}}_{{}}$. (62)

To summarize, for 0 $ \leq$ i $ \leq$ n/2 - 1 mathend000# we have

A($\displaystyle \omega^{{i}}_{{}}$) = A[0]($\displaystyle \omega^{{{2i}}}_{{}}$) + $\displaystyle \omega^{{i}}_{{}}$ A[1]($\displaystyle \omega^{{{2i}}}_{{}}$)
A($\displaystyle \omega^{{{i+ n/2}}}_{{}}$) = A[0]($\displaystyle \omega^{{{2i}}}_{{}}$) - $\displaystyle \omega^{{i}}_{{}}$ A[1]($\displaystyle \omega^{{{2i}}}_{{}}$)
(63)

Algorithm 3  

\fbox{
\begin{minipage}{10 cm}
\begin{description}
\item[{\bf Input:}] $n = 2^r$...
...n/2}$\ := $y_k^{[0]} - t$\ \\
\> {\bf return} $y$
\end{tabbing}\end{minipage}} mathend000#

The validity of Algorithm 3 follows from the two following observations. Observe that the recursive calls of DFT(n, A,$ \Omega$) mathend000# defines an ordering of the coefficients of A mathend000# shown on Figure 2 for n = 8 mathend000#. Let us call this ordering the DFT ordering of A mathend000#.

Observe that if the input array A mathend000# is sorted w.r.t. this DFT ordering, one can describe easily the recursive calls with a binary tree. If this tree is traversed bottom-up, from left to right, we are led to an iterative algorithm working in place! For instance, for n = 8 mathend000#, assuming that the input array A mathend000# is

| a0 | a4 | a2 | a6 | a1 | a5 | a3 | a7 |    

We obtain the desired result in A mathend000# using the following straigth-line program
  1. a mathend000# := a0 mathend000#
  2. b mathend000# := a1 mathend000#
  3. a0 mathend000# := a + b mathend000#
  4. a1 mathend000# := a - b mathend000#
  5. a mathend000# := a2 mathend000#
  6. b mathend000# := a3 mathend000#
  7. a2 mathend000# := a + b mathend000#
  8. a3 mathend000# := a - b mathend000#
  9. a mathend000# := a4 mathend000#
  10. b mathend000# := a5 mathend000#
  11. a4 mathend000# := a + b mathend000#
  12. a5 mathend000# := a - b mathend000#
  13. a mathend000# := a6 mathend000#
  14. b mathend000# := a7 mathend000#
  15. a6 mathend000# := a + b mathend000#
  16. a7 mathend000# := a - b mathend000#
  17. a mathend000# := a0 mathend000#
  18. b mathend000# := a1 mathend000#
  19. c mathend000# := a2 mathend000#
  20. d mathend000# := a3 mathend000#
  21. a0 mathend000# := a + c mathend000#
  22. a2 mathend000# := a - c mathend000#
  23. a1 mathend000# := b + $ \omega$d mathend000#
  24. a3 mathend000# := b - $ \omega$d mathend000#
  25. a mathend000# := a4 mathend000#
  26. b mathend000# := a5 mathend000#
  27. c mathend000# := a6 mathend000#
  28. d mathend000# := a7 mathend000#
  29. a0 mathend000# := a + c mathend000#
  30. a2 mathend000# := a - c mathend000#
  31. a1 mathend000# := b + $ \omega$d mathend000#
  32. a3 mathend000# := b - $ \omega$d mathend000#
  33. a mathend000# := a0 mathend000#
  34. b mathend000# := a1 mathend000#
  35. c mathend000# := a2 mathend000#
  36. d mathend000# := a3 mathend000#
  37. e mathend000# := a4 mathend000#
  38. f mathend000# := a5 mathend000#
  39. g mathend000# := a6 mathend000#
  40. h mathend000# := a7 mathend000#
  41. a0 mathend000# := a + e mathend000#
  42. a1 mathend000# := b + $ \omega$f mathend000#
  43. a2 mathend000# := c + $ \omega^{{2}}_{{}}$f mathend000#
  44. a3 mathend000# := d + $ \omega^{{3}}_{{}}$h mathend000#
  45. a4 mathend000# := a + e mathend000#
  46. a5 mathend000# := b - $ \omega$f mathend000#
  47. a6 mathend000# := c - $ \omega^{{2}}_{{}}$f mathend000#
  48. a7 mathend000# := d - $ \omega^{{3}}_{{}}$h mathend000#

Figure 2: Recursive calls for n = 8 mathend000#.
\begin{figure}\htmlimage
\centering
\includegraphics[scale=.5]{fft8.eps}\end{figure}

Algorithm 4  

\fbox{
\begin{minipage}{12 cm}
\begin{description}
\item[{\bf Input:}] $n = 2^r$...
...k + j + m/2]$\ := $u - t$\ \\
\> {\bf return} $A$
\end{tabbing}\end{minipage}} mathend000#

Remark 8   To get the DFT ordering for A mathend000#, that is [a0, a4, a2, a6, a1, a5, a3, a7] mathend000#, observe that this ordering changes

000, 001, 010, 011, 100, 101, 011, 111 (64)

to

000, 100, 010, 110, 001, 101, 110, 111 (65)

Remark 9   The ring $ \mbox{${\mathbb Z}$}$ mathend000# does not have any interesting roots of unity. In order to take advantage of the FFT-based multiplication one could use a modular approach as follows.


next up previous
Next: Bibliography Up: Efficient implementation Previous: Efficient implementation
Marc Moreno Maza
2007-01-10