11
Chapter 8 An In-Place Radix-2 DIT FFT for Input in Bit-Reversed Order This chapter is a sequel of Chapter 7, so readers are assumed to be familiar with applying the in-place DIT FFT to naturally ordered input as shown in Figures 7.27.5. Recall that x in1···i1i0 was assumed to be contained in a[i n1 ··· i 1 i 0 ] when the in- place DIT FFT algorithm was expressed in terms of the binary addresses of array a in Chapter 7. Accordingly, the following algorithm is correct regardless of where x k is located. Algorithm 8.1 The radix-2 DIT FFT algorithm in terms of binary subscripts. begin k := n 1 Assume problem size N =2 n while k 0 do Combine two subproblems Apply Cooley-Tukey butterfly computation to “combine” all pairs of elements of x whose binary subscripts differ in bit i k k := k 1 end while end Now, if the input data are in bit-reversed order, the same computation must be performed on the same elements although they are stored in bit-reversed array loca- tions. The application of the in-place DIT RN FFT to bit-reversed input of size N =8 is depicted in Figures 8.18.4. As expected, the bit-reversed input is overwritten by naturally ordered output. © 2000 by CRC Press LLC

0270_PDF_C08.pdf

Embed Size (px)

Citation preview

  • Chapter 8

    An In-Place Radix-2 DIT FFT

    for Input in Bit-Reversed

    Order

    This chapter is a sequel of Chapter 7, so readers are assumed to be familiar withapplying the in-place DIT FFT to naturally ordered input as shown in Figures 7.27.5.

    Recall that xin1i1i0 was assumed to be contained in a[in1 i1i0] when the in-place DIT FFT algorithm was expressed in terms of the binary addresses of array ain Chapter 7. Accordingly, the following algorithm is correct regardless of where xk islocated.

    Algorithm 8.1 The radix-2 DIT FFT algorithm in terms of binary subscripts.

    begink := n 1 Assume problem size N = 2nwhile k 0 do Combine two subproblems

    Apply Cooley-Tukey buttery computation

    to combine all pairs of elements of x whose

    binary subscripts dier in bit ikk := k 1

    end whileend

    Now, if the input data are in bit-reversed order, the same computation must beperformed on the same elements although they are stored in bit-reversed array loca-tions. The application of the in-place DITRN FFT to bit-reversed input of size N = 8is depicted in Figures 8.18.4. As expected, the bit-reversed input is overwritten bynaturally ordered output.

    2000 by CRC Press LLC

  • Figure 8.1 The rst division step of the DITRN FFT.

    2000 by CRC Press LLC

    Figure 8.2. Figure 8.3.

    Figure 8.4.

  • Figure 8.2 Solve one half-size subproblem by in-place DITRN FFT.

    2000 by CRC Press LLC

  • Figure 8.3 Solve one half-size subproblem by in-place DITRN FFT.

    2000 by CRC Press LLC

  • Figure 8.4 Solve the entire problem by in-place DITRN FFT.

    2000 by CRC Press LLC

    Figure 8.2. Figure 8.3.

  • 8.1 Developing the Iterative In-Place DITRN FFT

    To facilitate the development of an iterative algorithm, the buttery computation stepsdepicted in Figures 8.28.4 are summarized in Table 8.1, where all buttery pairs areidentied by the addresses of a[J ] and a[J + Distance].

    Comparing Table 8.1 to Table 7.1, it is clear that because xi2i1i0 is contained ina[i0i1i2], elements x0i1i0 and x1i1i0 , which form pairs during the rst stage of butterycomputation, are found in a[i0i10] and a[i0i11], and so on. Consequently, the value ofDistance starts from 1, and it doubles in each of the following stages. This observa-tion immediately leads to the following algorithm in terms of the binary addresses ofelements in array a.

    Algorithm 8.2 The in-place DITRN FFT algorithm in terms of binary addresses:

    begin := 0 Assume problem size N = 2n

    while n 1 do Combine two subproblemsApply Cooley-Tukey buttery computation

    to combine all pairs of array elements whose

    binary addresses dier in the th bit from the right

    := + 1end while

    end

    Accordingly, the shorthand notation developed for the DIFRN FFT, which trans-forms bit-reversed input, applies here. That is, for N = 8, the three DIT butterycomputation steps are also represented by the sequence

    i2i1i0 i0i1i2 i0

    i12

    i012

    Table 8.1 Decimal and binary addresses for a [ J ] and a

    Butterfly Computation

    Stage 1

    Current HulfSize

    HalfSize = N/23 = 1 (Distance = 1)

    Decimal aIJ + Distance1

    ~~

    Binary J + Distance

    a[O] 000

    a[2] 010 011

    Stage 2

    Stage 3

    HalfSize = N/22 = 2 (Distance = 2)

    HalfSize = N/2 = 4 (Distance = 22 = 4)

    d51 I 101

    4 2 1 431 461 471 4 4 1

    4 5 1

    461 471

    d71 I 111 010 011 110 111 100 101 110 111

    2000 by CRC Press LLC

  • Once again, the bit-reversed ordering of the input is reected by beginning the sequencewith permuting xi2i1i0 from the assumed location a[i2i1i0] to a[i0i1i2].

    However, the corresponding twiddle factors are dierent from the DIFRN FFT, asexplained in the next section.

    8.1.1 Identifying the twiddle factors in the DITRN FFT

    Observe that in Table 8.1, each buttery step combines pairs of subproblems of HalfSizebeginning with HalfSize = 1 and twiddle factor 0N = 1. Following the denition ofthe Cooley-Tukey buttery in Figure 7.1, the second buttery step combines pairs ofsubproblems of HalfSize = 2, and the corresponding twiddle factors are 04 = 0N =1, and 14 = N/4N , and so on. For N = 8, the twiddle factors corresponding to allcombination steps are identied in Table 8.2.

    Table 8.2 Relating twiddle factors to binary addresses of the pair of a[J ] and a[J +Distance].

    Cooley-Tukey Butterfly

    Stage i o i l i z (Distance = 1)

    T

    T Stage iOi172

    (Distance = 2)

    T Stage io 71 7 2

    (Distance = 4)

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

    a[o] = a [ ~ ] + w;a[l] a[l] = a[o] - w;a[l] a[2] = a[2] + w;a[3] a[3] = a[2] - w;a[3] a[4] = a[4] + w;a[5] a[5] = a[4] - wO,a[5] a[6] = a[6] + w;a[7] a[7] = a[6] - w$a[7] a [ ~ ] = a[o] + wO,a[~] a [ ~ ] = U[O] - wO,a[2] a[4] = a[4] + w;a[6] a[6] = a[4] - w;a[6]

    a[3] = a[3] - w$a[3] a[5] = a[5] + wga[7] a[7] = a[5] - w$a[7] a[o] = a [ ~ ] + wO,a[4] a[4] = a[O] - w;a[4] a[1] = a[l] + wta[5] a[5] = a[1] - wha[5] a[2] = a[2] + w$a[6] a[6] = a[4] - &a[6] a[3] = a[3] + &a[7] a[7] = a[3] - w$a[7]

    a[l] = a[l] + w&[l]

    Butterfly Groups

    Group 0 (4 Pairs)

    Group 0

    (2 Pairs)

    Group 1 (2 pairs)

    Group 0

    (1 Pair)

    (1 Pair)

    (1 Pair)

    (1 P 4

    Group 1

    Group 2

    Group 3

    A Binary Address Based Notation

    2000 by CRC Press LLC

  • For easy comparison with Table 7.3 for the DITNR FFT the corresponding twid-dle factors and its shorthand notations are summarized in Table 8.3. Note that al-though the input data are in bit-reversed order, it is assumed that the pre-computedtwiddle factors are stored in natural order in the array w. That is, w[] = N , = 0, 1, . . . , N/2 1. Therefore, w[i1i2] = i1i2N is used in Table 8.3.

    Fable 8.3 Iden

    Butterfly Computation

    T Stage io 7 1 72

    ifying twiddle

    Current HalfSize

    Halfsize = 1

    HalfSize = 2

    HalfSize = 4

    xtors (N = 8) Decimal

    f w [ Jtwiddle]

    fw[O] = *w:

    fw[O] = *w: fw[2 ] = fw&

    f w [ O ] = *w; f w [ l ] = *u; fw[2] = f # L f w [ 3 ] = f w k

    lr DITRN FFT.

    Binary Jtwiddle w.r.t

    modified x i 2 ; , jn

    00

    is0 = 00 is0 = 10

    i l i 2 = 00 i l i 2 = 01 i l i 2 = 10 i l i 2 = 11

    Shorthand Notation w.r.t.

    I

    2000 by CRC Press LLC

  • 8.1.2 The pseudo-code program for the DITRN FFT

    In contrast to the DIFRN FFT pseudo-code program given by Algorithm 4.2, the com-plete DITRN version is given below as Algorithm 8.3. As mentioned in the last section,the twiddle factors are stored in natural order, i.e., w[] = N , = 0, 1, . . . , N/2 1.

    Algorithm 8.3 The iterative radix-2 DITRN FFT algorithm in pseudo-code.

    beginPairsInGroup := N/2 Begin with N/2 butteries in one groupNumOfGroups := 1 Same twiddle factor is employed in a groupDistance := 1while NumOfGroups < N do

    GapToNextPair := 2 NumOfGroupsGapToLastPair := GapToNextPair (PairsInGroup 1)for K := 0 to NumOfGroups 1 do Modify one group at a time

    J := K Address of the rst pairJLast := K + GapToLastPair Address of the last pairJtwiddle := K PairsInGroupW := w[Jtwiddle] Assume w[] = Nwhile J JLast do Modify all pairs in the same group

    Temp := W a[J + Distance]a[J + Distance] := a[J ] Tempa[J ] := a[J ] + TempJ := J + GapToNextPair Process next pair in the group

    end whileend forPairsInGroup := PairsInGroup/2NumOfGroups := NumOfGroups 2Distance := Distance 2

    end whileend

    2000 by CRC Press LLC

  • 8.2 Shorthand Notation and a N = 32 Example

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

    i2i1i0 i0i1i2 i0

    i12

    i012

    together with the corresponding twiddle factors

    0N = 1, i20N , i1i2N .For N = 32, the entire Figure 8.5 can be replaced by the sequence

    i4i3i2i1i0 i0i1i2i3i4 i0i1i2

    i34 i0i1

    i234 i0

    i1234

    with the understanding that on input, a[i0i1i2i3i4] contains the bit-reversed xi4i3i2i1i0 ,and on output, a[i0i1i2i3i4] contains Xi0i1i2i3i4 . Refer to Figure 8.5 for the decimalsubscripts of all 32 bit-reversed input elements in a[i0i1i2i3i4].

    The corresponding twiddle factors are

    0N = 1, i4000N , i3i400N , i2i3i40N , i1i2i3i4N ,and w[i1i2i3i4] = i1i2i3i4N is assumed in Algorithm 8.3.

    2000 by CRC Press LLC

  • Figure 8.5 Butteries of the in-place DITRN FFT algorithm.

    2000 by CRC Press LLC

    INSIDE the FFT BLACK BOX: Serial and Parallel Fast Fourier Transform AlgorithmsTable of ContentsPart II: Sequential FFT AlgorithmsChapter 8: An In-Place Radix-2 DIT FFT for Input in Bit-Reversed Order8.1 Developing the Iterative In-Place DIT RN FFT8.1.1 Identifying the twiddle factors in the DIT RN FFT8.1.2 The pseudo-code program for the DIT RN FFT

    8.2 Shorthand Notation and a N =32 Example