You are on page 1of 11

Chapter 7

An In-Place Radix-2 DIT FFT


for Input in Natural Order
The NR, RN, and NN algorithms implementing DIF (decimation-in-frequency) FFT
were presented in Chapters 4, 5, and 6. Corresponding to them, there are also three
variants of the DIT (decimation-in-time) FFT, and they are developed in this and the
following two chapters.
The three DIT FFT algorithms will be presented using the notation developed
in the previous chapters. Accordingly, they are referred to as DITNR , DITRN , and
DITNN FFT algorithms. The DITNR and DITRN algorithms implement in-place DIT
FFT on naturally ordered and bit-reversed input data, whereas the DITNN algorithm
allows repeated permutation of the intermediate results and can thus produce naturally
ordered output from naturally ordered input.
Since both DIF FFT and DIT FFT implement the same Discrete Fourier Transform,
one may argue intuitively that the nal result which overwrites an input element xk
must remain unchanged in either implementation, and that the many results obtained
previously in Chapters 4, 5, and 6 for the three DIF FFT algorithms should apply to
the corresponding DIT FFT. However, to make this chapter self-contained, it is useful
to develop these iterative DIT FFT algorithms from its recursive denition, and this
approach is adopted here.
Since the concepts introduced before for the DIF FFT will not be repeated, it is
recommended that Chapters 4, 5, and 6 be studied before Chapter 7.

7.1

Understanding the Recursive DIT FFT and its


In-Place Implementation

Recall that the recursive radix-2 DIT FFT algorithm was derived in Chapter 3, in
which the Cooley-Tukey buttery in Figure 7.1 represents the last combination step in
computing the transform
1


N
2

(7.1)

Xr =

k=0

2000 by CRC Press LLC

1


N
2

r(2k)

x2k N

+ N

k=0

r(2k)

x2k+1 N

r = 0, 1, . . . , N 1.

Figure 7.1 The Cooley-Tukey buttery.

(n1)

Assuming N = 2n , Yr
subproblems dened by

1


(n1)

and Zr

N
2

(7.2)

Yr(n1)

in Figure 7.1 are solutions to the two half-size

1


N
2

r(2k)

x2k N

k=0

(n1)

yk

rk
N , r = 0, 1, . . . , N/2 1

k=0

and
1


N
2

(7.3)

Zr(n1)

x2k+1 N

k=0
(n1)

1


N
2

r(2k)

k=0
(n1)

(n1)

zk

rk
N , r = 0, 1, . . . , N/2 1.
2

Note that yk
x2k and zk
x2k+1 , k = 0, 1, . . . , 2n1 1, identify input
elements to the two subproblems of size 2n1 as depicted in Figure 7.2 for N = 8.
Since each subproblem is to be solved by the same DIT FFT algorithm recursively,
two subproblems of size N = 2n2 are dened by the even and odd elements from
(n1)
(n2)
(n1)
(n2)
(n1)
yk
, namely, yk
y2k , and zk
y2k+1 as depicted in Figure 7.3; the
other two subproblems of size N = 2n2 are dened by the even and odd elements
(n1)
(n2)
(n1)
(n2)
(n1)
, namely, yk
z2k , and zk
z2k+1 as depicted in Figure 7.4.
from zk
The subdivision steps continue until the subproblem size becomes one, and solution to
(0)
(0)
(0)
(0)
each subproblem is simply itself; i.e., Y0 = y0 and Z0 = z0 .
Therefore, the DIT FFT algorithm begins its computation by combining all pairs
(0)
(0)
of (properly identied) y0 and z0 to form solutions to subproblems of size two, and
so on. For N = 8, the three combination steps are depicted in Figures 7.3, 7.4, and
7.5. As expected, the in-place DIT FFT overwrites the naturally ordered input by
bit-reversed output after the last combination step in Figure 7.5.

2000 by CRC Press LLC

Figure 7.2 The rst division step of in-place DITNR FFT.

Figure 7.4.

Figure 7.3.

Figure 7.5.

2000 by CRC Press LLC

Figure 7.3 Solve one half-size subproblem by in-place DITNR FFT.

2000 by CRC Press LLC

Figure 7.4 Solve the second half-size subproblem by in-place DITNR FFT.

2000 by CRC Press LLC

Figure 7.5 Solv e the entire

Figure 7.3.

7.2

problem by in-place

FFT.
NR DIT

Figure 7.4.

Developing the Iterative In-Place DIT FFT

Since the input data are in natural order, array element a[m] is assumed to contain xm
in the development of the pseudo-code program in this section. For easy comparison
with the DIFNR FFT specied in Table 4.2, the buttery computation steps depicted
in Figures 7.3 7.5 are summarized in Table 7.1, where all buttery pairs are identied
by the addresses of a[J] and a[J + Distance].

2000 by CRC Press LLC

Table 7.1 Decimal and binary addresses for a[J] and a[J +Distance] in Figures 7.37.5.
Buttery

Current

Decimal

Computation

HalfSize

Stage 1

HalfSize = N/23 = 1
2

(Distance = 2 = 4)

Stage 2

Stage 3

Binary

Decimal

Binary

a[J]

a[J + Distance]

J + Distance

a[0]

000

a[4]

100

a[2]

010

a[6]

110

a[1]

001

a[5]

101

a[3]

011

a[7]

111

HalfSize = N/22 = 2

a[0]

000

a[2]

010

(Distance = 2)

a[4]

100

a[6]

110

a[1]

001

a[3]

011

a[5]

101

a[7]

111

HalfSize = N/2 = 4

a[0]

000

a[1]

001

(Distance = 1)

a[2]

010

a[3]

011

a[4]

100

a[5]

101

a[6]

110

a[7]

111

Observe that the distance between a[J] and a[J + Distance] is a power of 2, so
the binary number property 5 (page 34) applies here as before. That is, the addresses
a[J] and a[J + Distance], denoted as binary numbers in1 i1 i0 , dier only in bit ik
when Distance = 2k and the algorithm can be expressed in terms of binary addresses
as shown below.
Algorithm 7.1 The radix-2 DIT FFT algorithm in terms of binary addresses:
begin
k := n 1
Assume problem size N = 2n
while k 0 do
Combine two subproblems
Apply Cooley-Tukey buttery computation
to combine all pairs of array elements whose
binary addresses dier in bit ik
k := k 1
end while
end
Accordingly, the shorthand notation developed for the DIFNR FFT applies here.
That is, for N = 8, the three DIT buttery computation steps are also represented by
the sequence


i2 i1 i0

2 i1 i0

2 1 i0

However, the corresponding twiddle factors are now dierent, and they are identied
in the next section.

2000 by CRC Press LLC

7.2.1

Identifying the twiddle factors in the DIT FFT

Observe that in Table 7.1, each buttery step combines pairs of subproblems of HalfSize
0
beginning with HalfSize = 1 and twiddle factor N
= 1. Following the denition of
the Cooley-Tukey buttery in Figure 7.1, the second buttery step combines pairs of
0
subproblems of HalfSize = 2, and the corresponding twiddle factors are 40 = N
=
N/4
1
1, and 4 = N , and so on. For N = 8, the twiddle factors corresponding to all
combination steps are identied in Table 7.2.
Table 7.2 Relating twiddle factors to binary addresses of the pair a[J] and a[J +
Distance] (N = 8).
Cooley-Tukey

Actual Modication

Buttery

A Binary Address

Buttery

of a[J] & a[J + Distance]

Groups

Based Notation

a[0] = a[0] + N a[4]

Group 0

0
a[0i1 i0 ] = a[0i1 i0 ] + N
a[1i1 i0 ]

0
a[4] = a[0] N
a[4]

(4 Pairs)

0
a[1i1 i0 ] = a[0i1 i0 ] N
a[1i1 i0 ]

0
a[0] = a[0] + N
a[2]

Group 0

i2 0
a[i2 0i0 ] = a[i2 0i0 ] + N
a[i2 1i0 ]

a[2] = a[0] N a[2]

(2 pairs)

i2 0
a[i2 1i0 ] = a[i2 0i0 ] N
a[i2 1i0 ]

Stage


i2 i1 i0

(Distance = 4)

a[1] = a[1] + N a[5]


0
a[5] = a[1] N
a[5]
0
a[2] = a[2] + N
a[6]
0
a[6] = a[2] N
a[6]
0
a[3] = a[3] + N
a[7]

Stage


2 i1 i0

(Distance = 2)

0
a[7] = a[3] N
a[7]

0
a[1] = a[1] + N
a[3]
0
a[3] = a[1] N
a[3]
2
a[4] = a[4] + N
a[6]

Group 1

2
a[6] = a[4] N
a[6]

(2 pairs)

2
a[5] = a[5] + N
a[7]

Stage


2 1 i0

(Distance = 1)

2
a[7] = a[5] N
a[7]
0
a[0] = a[0] + N
a[1]

Group 0

i1 i2
a[i2 i1 0] = a[i2 i1 0] + N
a[i2 i1 1]

0
a[1] = a[0] N
a[1]

(1 pair)

i1 i2
a[i2 i1 1] = a[i2 i1 0] N
a[i2 i1 1]

a[2] = a[2] + N a[3]

2000 by CRC Press LLC

Group 1

a[3] = a[2] N a[3]

(1 pair)

1
a[4] = a[4] + N
a[5]

Group 2

1
a[5] = a[4] N
a[5]

(1 pair)

3
a[6] = a[6] + N
a[7]

Group 3

3
a[7] = a[6] N
a[7]

(1 pair)

For easy comparison with Table 4.3 for the DIFNR FFT, the corresponding twiddle
factors and their shorthand notation are summarized in Table 7.3. In order not to
invoke a bit-reversing subroutine in the program, it is assumed that the pre-computed
twiddle factors are stored in bit-reversed order although the input data are in natural
i1 i2
order. Therefore, w[i2 i1 ] = N
is used in Table 7.3.

Butterfly

Current

Computation

Halfsize

Stage i z i l i o
T

Stage r z i l i o

-I-,

Stage r z r 1 i o

Decimal

Binary

fw[Jtwiddle]

Jtwiddle w.r.t
modified zi2ilin

Halfsize = 1

*w[O] = *w;

00

HalfSize = 2

f w [ O ]= * w ;
f w [ l ] = *w&

oiz = 00

fw[O] = *w;

i2il

Halfsize = 4

Notation w.r.t.
modified
*w;

zililio

= fl

Oiz = 01
= 00

i*il = 01

* w [ l ] = fw:
*w[2] = * w h
f w [ 3 ]= fw$

7.2.2

Shorthand

i z i l = 10
iZil

= 11

The pseudo-code program for the DITNR FFT algorithm

In contrast to the DIF FFT pseudo-code program given by Algorithm 4.2, the complete
DIT FFT version is given below as Algorithm 7.2. For simplicity, the twiddle factors
are assumed to have been stored in the array w in bit-reversed order. For example,
i1 i2
for N = 8, the N/2 = 4 pre-computed twiddle factors are stored as w[i2 i1 ] = N
;
for N = 32, the N/2 = 16 pre-computed twiddle factors are stored as w[i4 i3 i2 i1 ] =
i 1 i 2 i3 i4
N
.

7.3

Shorthand Notation and a N = 32 Example

As derived in the previous section, the buttery computation steps in Figures 7.37.5
(for N = 8) are fully specied by the sequence


i2 i1 i0

2 i1 i0

2 1 i0

together with the corresponding twiddle factors

N0 = 1, Ni2 0 , Ni1 i2 .
For N = 32, the entire Figure 7.6 can be replaced by the sequence


i4 i3 i2 i1 i0

2000 by CRC Press LLC

4 i3 i2 i1 i0

4 3 i2 i1 i0

4 3 2 i1 i0

4 3 2 1 i0

Algorithm 7.2 The iterative radix-2 DIT FFT algorithm in pseudo-code.


begin
PairsInGroup := N/2
Begin with N/2 butteries in one group
NumOfGroups := 1
Same twiddle factor is employed in a group
Distance := N/2
while NumOfGroups < N do
for K := 0 to NumOfGroups 1 do
Combine pairs in each group
JFirst := 2 K PairsInGroup
JLast := JFirst + PairsInGroup 1
Jtwiddle := K
Access consecutive w[m]

W := w[Jtwiddle]
Assume w[m] = N
, m bit-reverses 
for J := JFirst to JLast do
Temp := W a[J + Distance]
a[J + Distance] := a[J] Temp
a[J] := a[J] + Temp
end for
end for
PairsInGroup := PairsInGroup/2
NumOfGroups := NumOfGroups 2
Distance := Distance/2
end while
end

with the understanding that on input, a[i4 i3 i2 i1 i0 ] contains xi4 i3 i2 i1 i0 , and on output,
a[i4 i3 i2 i1 i0 ] contains the bit-reversed Xi0 i1 i2 i3 i4 . Refer to Figure 7.6 for the decimal
subscripts of all 32 bit-reversed output elements Xi0 i1 i2 i3 i4 .
The corresponding twiddle factors are

N0 = 1, Ni4 000 , Ni3 i4 00 , Ni2 i3 i4 0 , Ni1 i2 i3 i4 .


As identied in Table 7.3 and assumed in Algorithm 7.2, these twiddle factors are
pre-computed and stored in w in bit-reversed order. Hence, for N = 32, w[i4 i3 i2 i1 ] =
i 1 i 2 i3 i4
0
i4 000
i3 i4 00
N
, which implies w[0] = N
, w[000i4 ] = N
, w[00i4 i3 ] = N
, and w[0i4 i3 i2 ]
i2 i3 i4 0
= N
.

2000 by CRC Press LLC

Figure 7.6 Butteries of the in-place DITNR FFT algorithm.

2000 by CRC Press LLC

You might also like