b. fast algorithms for discrete fourier transform of... · 2020. 5. 19. · b.1. introduction the...

22
B. Fast Algorithms for Discrete Fourier Transform B.1. Introduction (9.0, 9.1) B.2. Radix-2 Decimation-in-Time FFT (9.3, 9.5) B.3. Radix-2 Decimation-in-Frequency FFT (9.4, 9.5) B.4. FFT for a More General N (9.5) B.5. FFT for a Real Sequence B.6. Inverse Fast Fourier Transform (9.1)

Upload: others

Post on 07-Oct-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: B. Fast Algorithms for Discrete Fourier Transform of... · 2020. 5. 19. · B.1. Introduction The discrete Fourier transform (DFT) can be computed by a class of fast algorithms called

B. Fast Algorithms for Discrete Fourier

Transform

B.1. Introduction (9.0, 9.1)

B.2. Radix-2 Decimation-in-Time FFT (9.3, 9.5)

B.3. Radix-2 Decimation-in-Frequency FFT (9.4, 9.5)

B.4. FFT for a More General N (9.5)

B.5. FFT for a Real Sequence

B.6. Inverse Fast Fourier Transform (9.1)

Page 2: B. Fast Algorithms for Discrete Fourier Transform of... · 2020. 5. 19. · B.1. Introduction The discrete Fourier transform (DFT) can be computed by a class of fast algorithms called

B.1. Introduction

The discrete Fourier transform (DFT) can be computed by a class

of fast algorithms called the fast Fourier transform (FFT). The basic

principle of the FFT is to decompose the DFT into shorter DFTs and

butterfly operations, which are computationally more efficient. The

FFT algorithms apply when the length of the sequence is a composite

integer initially or after zero padding.

B.2. Radix-2 Decimation-in-Time FFT

B.2.1. Principle

Let us assume that x(n) is a finite-length sequence over 0nN1,

where N=2m (m2) initially or after zero-padding. The DFT of x(n) is

defined as

1.Nk0 ,knN

2jexp)n(x)k(X

1N

0n

(B.1)

Page 3: B. Fast Algorithms for Discrete Fourier Transform of... · 2020. 5. 19. · B.1. Introduction The discrete Fourier transform (DFT) can be computed by a class of fast algorithms called

x(n) is separated into two sequences. One consists of even-numbered

samples, and the other consists of odd-numbered samples. Thus,

.1Nk0

,kr2/N

2jexp)1r2(xk

N

2jexp

kr2/N

2jexp)r2(x)k(X

12/N

0r

12/N

0r

(B.2)

X(k) is halved. The first half is

.12/Nk0

,kr2/N

2jexp)1r2(xk

N

2jexp

kr2/N

2jexp)r2(x)k(X

12/N

0r

12/N

0r

(B.3)

Page 4: B. Fast Algorithms for Discrete Fourier Transform of... · 2020. 5. 19. · B.1. Introduction The discrete Fourier transform (DFT) can be computed by a class of fast algorithms called

1.N/2k0

,kr2/N

2jexp)1r2(xk

N

2jexp

kr2/N

2jexp)r2(x)2/Nk(X

12/N

0r

12/N

0r

(B.5)

The second half is

,1NkN/2

,kr2/N

2jexp)1r2(xk

N

2jexp

kr2/N

2jexp)r2(x)k(X

12/N

0r

12/N

0r

(B.4)

which is also written as

The radix-2 decimation-in-time FFT is based on (B.3) and (B.5).

Page 5: B. Fast Algorithms for Discrete Fourier Transform of... · 2020. 5. 19. · B.1. Introduction The discrete Fourier transform (DFT) can be computed by a class of fast algorithms called

According to (B.3) and (B.5), the DFT can be computed using the

following algorithm (figure B.1): (1) Compute the DFT of x(2r) and

the DFT of x(2r+1), where 0rN/21. (2) Multiply the second DFT

by exp(j2k/N), where 0kN/21. (3) Find the DFT of x(n).

The above decomposition is continued until each DFT has only 1

point. The 1-point DFTs contain no operation and do not have to be

carried out.

The number of complex multiplications required in this algorithm

is N(log2N)/2. This number is less than N2, the number of complex

multiplications required in the direct DFT. The following table gives

a few typical cases.

N 512 1024 2048

N2 262144 1048576 4194304

N(log2N)/2 2304 5120 11264

Page 6: B. Fast Algorithms for Discrete Fourier Transform of... · 2020. 5. 19. · B.1. Introduction The discrete Fourier transform (DFT) can be computed by a class of fast algorithms called

DFT

(N/2)

Figure B.1. Radix-2 Decimation-in-Time FFT.

x(0)

x(2)

x(N2)

DFT

(N/2)…

exp[j2(N/21)/N]

exp[j20/N]

exp[j21/N]

x(1)

x(3)

x(N1)

X(0)

X(1)

X(N/21)

X(N/2)

X(N/2+1)

X(N1)

Page 7: B. Fast Algorithms for Discrete Fourier Transform of... · 2020. 5. 19. · B.1. Introduction The discrete Fourier transform (DFT) can be computed by a class of fast algorithms called

B.2.2. Several Details

This algorithm consists of two steps: the sequence reordering and

the butterfly operations.

The time-domain sequence is reordered in a bit-reversed way. The

sample at position bm1bm2…b0 (binary index) is transferred to

position b0b1…bm1 (binary index). The above table gives the case of

N=8.

x(n) x(0) x(1) x(2) x(3) x(4) x(5) x(6) x(7)

Old

Position

000

0

001

1

010

2

011

3

100

4

101

5

110

6

111

7

New

Position

000

0

100

4

010

2

110

6

001

1

101

5

011

3

111

7

Page 8: B. Fast Algorithms for Discrete Fourier Transform of... · 2020. 5. 19. · B.1. Introduction The discrete Fourier transform (DFT) can be computed by a class of fast algorithms called

The butterfly operations are implemented using three nested loops

or recursively. They are done in place. That is, in each stage of the

computation, the output sequence and the input sequence can use the

same memory space.

A few variations of this algorithm can be obtained by changing the

scheme of reordering.

B.3. Radix-2 Decimation-in-Frequency FFT

B.3.1. Principle

Let us assume that x(n) is a finite-length sequence over 0nN1,

where N=2m (m2) initially or after zero-padding. The DFT of x(n) is

defined as

1.Nk0 ,knN

2jexp)n(x)k(X

1N

0n

(B.6)

X(k) is separated into two sequences. One consists of even-numbered

Page 9: B. Fast Algorithms for Discrete Fourier Transform of... · 2020. 5. 19. · B.1. Introduction The discrete Fourier transform (DFT) can be computed by a class of fast algorithms called

1N/2r0 ,rn2/N

2jexp)n(x)r2(X

1N

0n

(B.7)

1./2Nr0

,rn2/N

2jexpn

N

2jexp)n(x)1r2(X

1N

0n

(B.8)

x(n) is halved. (B.7) becomes

1,N/2r0 ,rn2/N

2jexp)n(x

rn2/N

2jexp)n(x)r2(X

1N

2/Nn

12/N

0n

(B.9)

and

samples, and the other consists of odd-numbered samples. Thus,

which is also written as

Page 10: B. Fast Algorithms for Discrete Fourier Transform of... · 2020. 5. 19. · B.1. Introduction The discrete Fourier transform (DFT) can be computed by a class of fast algorithms called

1N/2r0 ,rn2/N

2jexp)2/Nn(x

rn2/N

2jexp)n(x)r2(X

12/N

0n

12/N

0n

(B.10)

and further

1.N/2r0

,rn2/N

2jexp)2/Nn(x)n(x)r2(X

12/N

0n

(B.11)

(B.8) becomes

1,N/2r0 ,rn2/N

2jexpn

N

2jexp)n(x

rn2/N

2jexpn

N

2jexp)n(x)1r2(X

1N

2/Nn

12/N

0n

(B.12)

Page 11: B. Fast Algorithms for Discrete Fourier Transform of... · 2020. 5. 19. · B.1. Introduction The discrete Fourier transform (DFT) can be computed by a class of fast algorithms called

which is also written as

1N/2r0

,rn2/N

2jexpn

N

2jexp)2/Nn(x

rn2/N

2jexpn

N

2jexp)n(x)1r2(X

12/N

0n

12/N

0n

(B.13)

and further

(B.14)

The radix-2 decimation-in-frequency FFT is developed according to

(B.11) and (B.14).

1.N/2r0 ,rn2/N

2jexp

nN

2jexp)2/Nn(x)n(x)1r2(X

12/N

0n

Page 12: B. Fast Algorithms for Discrete Fourier Transform of... · 2020. 5. 19. · B.1. Introduction The discrete Fourier transform (DFT) can be computed by a class of fast algorithms called

According to (B.11) and (B.14), the DFT can be computed using

the following algorithm (figure B.2): (1) Find sequences

x(n)+x(n+N/2) and [x(n)x(n+N/2)]exp(j2n/N), where 0nN/21.

(2) Find the DFTs of the two sequences.

The above decomposition is continued until each DFT has only 1

point. The 1-point DFTs contain no operation and do not have to be

carried out.

The number of complex multiplications required in this algorithm

is N(log2N)/2. This number is less than N2, the number of complex

multiplications required in the direct DFT. The following table gives

a few typical cases.

N 512 1024 2048

N2 262144 1048576 4194304

N(log2N)/2 2304 5120 11264

Page 13: B. Fast Algorithms for Discrete Fourier Transform of... · 2020. 5. 19. · B.1. Introduction The discrete Fourier transform (DFT) can be computed by a class of fast algorithms called

Figure B.2. Radix-2 Decimation-in-Frequency FFT.

x(0)

x(1)

x(N/21)

x(N/2)

x(N/2+1)

x(N1)

exp[j2(N/21)/N]

exp[j20/N]

exp[j21/N]

DFT

(N/2)

DFT

(N/2)

X(0)

X(2)

X(N2)

X(1)

X(3)

X(N1)

Page 14: B. Fast Algorithms for Discrete Fourier Transform of... · 2020. 5. 19. · B.1. Introduction The discrete Fourier transform (DFT) can be computed by a class of fast algorithms called

B.3.2. Several Details

This algorithm consists of two steps: the butterfly operations and

the sequence reordering.

The butterfly operations are implemented using three nested loops

or recursively. They are done in place. That is, in each stage of the

computation, the output sequence and the input sequence can use the

same memory space.

X(k) X(0) X(1) X(2) X(3) X(4) X(5) X(6) X(7)

Old

Position

000

0

100

4

010

2

110

6

001

1

101

5

011

3

111

7

New

Position

000

0

001

1

010

2

011

3

100

4

101

5

110

6

111

7

Page 15: B. Fast Algorithms for Discrete Fourier Transform of... · 2020. 5. 19. · B.1. Introduction The discrete Fourier transform (DFT) can be computed by a class of fast algorithms called

The frequency-domain sequence is reordered in the following bit-

reversed way. The sample at position bm1bm2…b0 (binary index) is

transferred to position b0b1…bm1 (binary index). The case of N=8 is

shown in the above table.

A few variations of this algorithm can be obtained by changing the

scheme of reordering.

B.4. FFT for a More General N

When the length of the sequence is a composite integer initially or

after zero padding, the FFT applies.

Assume that x(n) is a finite-length sequence over 0nN1. Here,

N=N1N2 (N1 and N2 are two positive integers not equal to 1) initially

or after zero-padding. The DFT of x(n) is defined as

1.Nk0 ,knN

2jexp)n(x)k(X

1N

0n

(B.15)

Page 16: B. Fast Algorithms for Discrete Fourier Transform of... · 2020. 5. 19. · B.1. Introduction The discrete Fourier transform (DFT) can be computed by a class of fast algorithms called

Letting n=n1N2+n2 (0n1N11, 0n2N21) and k=k2N1+k1

(0k1N11, 0k2N21), we obtain

1,Nk0 1,Nk0

,)nNn)(kNk(N

2jexp

)nNn(x)kNk(X

2211

221112

1N

0n

1N

0n

221112

1

1

2

2

(B.16)

which is further written as

.1Nk0 ,1Nk0

,nkN

2jexpnk

N

2jexpnk

N

2jexp

)nNn(x)kNk(X

2211

2111

1

22

2

1N

0n

1N

0n

221112

1

1

2

2

(B.17)

Page 17: B. Fast Algorithms for Discrete Fourier Transform of... · 2020. 5. 19. · B.1. Introduction The discrete Fourier transform (DFT) can be computed by a class of fast algorithms called

Changing the order of the summations, we obtain

1.Nk0 1,Nk0

,nkN

2jexpnk

N

2jexp

nkN

2jexp)nNn(x)kNk(X

2211

22

2

21

1N

0n

1N

0n

11

1

221112

2

2

1

1

(B.18)

According to (B.18), the DFT can be computed by the following

algorithm:

(1) For each n2, compute the DFT of x(n1N2+n2) with respect to n1

to obtain p(k1,n2).

(2) Multiply p(k1,n2) by exp(j2k1n2/N) to obtain q(k1,n2).

(3) For each k1, compute the DFT of q(k1,n2) with respect to n2 to

obtain X(k2N1+k1).

Page 18: B. Fast Algorithms for Discrete Fourier Transform of... · 2020. 5. 19. · B.1. Introduction The discrete Fourier transform (DFT) can be computed by a class of fast algorithms called

The number of complex multiplications required in this algorithm

is N(N1+N2+1). This number is less than N2, the number of complex

multiplications required in the direct DFT.

The above decomposition can be continued and the computation

can be further reduced until each DFT has a prime number of points.

B.5. FFT for a Real Sequence

Let x(n) be a real finite-length sequence over 0nN1, where N

is an even number larger than 2 initially or after zero-padding. Then

the DFT of x(n) can be computed using a fast algorithm.

Let

xe(r)=x(2r), 0rN/21 (B.19)

and

xo(r)=x(2r+1), 0rN/21. (B.20)

Page 19: B. Fast Algorithms for Discrete Fourier Transform of... · 2020. 5. 19. · B.1. Introduction The discrete Fourier transform (DFT) can be computed by a class of fast algorithms called

Define

y(r)=xe(r)+jxo(r), 0rN/21. (B.21)

Then

y*(r)=xe(r)jxo(r), 0rN/21. (B.22)

From (B.21) and (B.22), we obtain

xe(r)=[y(r)+y*(r)]/2, 0rN/21 (B.23)

and

xo(r)=[y(r)y*(r)]/(2j), 0rN/21. (B.24)

Taking the DFT of (B.23) and (B.24), we obtain

Xe(k)=[Y(k)+Y(k)*]/2, 0kN/21 (B.25)

and

Xo(k)=[Y(k)Y(k)*]/(2j), 0kN/21. (B.26)

Page 20: B. Fast Algorithms for Discrete Fourier Transform of... · 2020. 5. 19. · B.1. Introduction The discrete Fourier transform (DFT) can be computed by a class of fast algorithms called

According to (B.3) and (B.5), we have

12/Nk0 ),k(XkN

2jexp)k(X)k(X oe

(B.27)

and

.12/Nk0 ),k(XkN

2jexp)k(X)2/Nk(X oe

(B.28)

Based on the above analysis, the DFT of x(n) can be computed by

the following algorithm: (1) Find y(r) from (B.21). (2) Find Y(k), the

the DFT of y(r). (3) Find Xe(k) and Xo(k) from (B.25) and (B.26). (4)

Find the DFT of x(n) from (B.27) and (B.28). In this algorithm, only

an N/2-point DFT and some auxiliary operations are required.

B.6. Inverse Fast Fourier Transform

A class of fast algorithms called the inverse fast Fourier transform

(IFFT) can be used to compute the inverse discrete Fourier transform

Page 21: B. Fast Algorithms for Discrete Fourier Transform of... · 2020. 5. 19. · B.1. Introduction The discrete Fourier transform (DFT) can be computed by a class of fast algorithms called

(IDFT).

The DFT and the IDFT are defined as follows:

(B.30)1.Nn0 ,knN

2jexp)k(X

N

1)n(x

1,Nk0 ,knN

2jexp)n(x)k(X

1N

0k

1N

0n

(B.29)

According to (B.29) and (B.30), the algorithms for the DFT can be

used to compute the IDFT if the relevant signs are changed and the

factor 1/N is incorporated.

x(n) can be written as

1.Nn0 ,knN

2jexp)k(X

N

1)n(x

*1N

0k

*

(B.31)

According to (B.31), the IDFT can be computed using the following

Page 22: B. Fast Algorithms for Discrete Fourier Transform of... · 2020. 5. 19. · B.1. Introduction The discrete Fourier transform (DFT) can be computed by a class of fast algorithms called

algorithm: (1) Determine X*(k)/N. (2) Compute the DFT of X*(k)/N.

(3) Conjugate the DFT of X*(k)/N.

x(n) can be written as

1.Nn0 ,knN

2jexp)k(X

N

1)n(x

1N

0k

(B.32)

Here, X(k) is X(k) extended with period N. According to (B.32), the

IDFT can be computed using the following algorithm: (1) Determine

X(k)/N, 0kN1. (2) Compute the DFT of X(k)/N, 0kN1.