Sunteți pe pagina 1din 6

FFT Examples

Let’s calculate the Discrete Fourier Transform (DFT) of the sequence ~s = h1, 2, 3, 4, 5, 6, 7, 8i
using the Fast Fourier Transform (FFT).
(Remember, the FFT is just a fast algorithm for computing the DFT, it is not
a transform, just a method for computing the DFT efficiently!)
The associated polynomial is

P (x) = 1 + 2x + 3x2 + 4x3 + 5x4 + 6x5 + 7x6 + 8x7 ;

the DF T (~s) is just the sequence of values

DF T (~s) = hP (ω80 ), P (ω81 ), P (ω82 ), P (ω83 ), P (ω84 ), P (ω85 ), P (ω86 ), P (ω87 )i

Note that we have

√ √ √ √
2 2 2 2
ω80 = 1; ω81 = + ı̇ ; ω82 = ı̇; ω83 = − + ı̇ ;
2 2 2 2
√ √ √ √
2 2 2 2
ω84 = −1; 5
ω8 = − − ı̇ ; ω86 = − ı̇; 7
ω8 = − ı̇ ;
2 2 2 2
see Figure 1:

Figure 1.

Also,

ω40 = 1; ω41 = ı̇; ω42 = −1; ω43 = − ı̇


1
2

ω20 = 1; ω21 = −1.

We now proceed with the “Divide-And-Conquer” procedure: letting y = x2 we get

P (x) = 1 + 2x + 3x2 + 4x3 + 5x4 + 6x5 + 7x6 + 8x7

= (1 + 3x2 + 5x4 + 7x6 ) + x(2 + 4x2 + 6x4 + 8x6 )

= (1 + 3y + 5y 2 + 7y 3 ) + x(2 + 4y + 6y 2 + 8y 3 ).

We now let

Pe (y) = 1 + 3y + 5y 2 + 7y 3 ; Po (y) = 2 + 4y + 6y 2 + 8y 3 ;

Continuing with “Divide-And-Conquer” strategy we get, letting z = y 2

Pe (y) = (1 + 5y 2 ) + y(3 + 7y 2 ); Po (y) = 2 + 6y 2 + y(4 + 8y 2 );

= (1 + 5z) + y(3 + 7z); = 2 + 6z + y(4 + 8z).

We now let:

Pee (z) = 1 + 5z; Peo (z) = 3 + 7z;

Poe (z) = 2 + 6z; Poo (z) = 4 + 8z.

Note that, as powers of ωn rotate once around the circle, the powers of the squares
n
ωn2 = ω n2 rotate twice through only 2
many distinct values; for example, for n=8, using
the cancelation Lemma, i.e., (ωnk )2 = ω kn we get:
2
3

x= ω80 ω81 ω82 ω83 ω84 ω85 ω86 ω87

x2 = (ω80 )2 (ω81 )2 (ω82 )2 (ω83 )2 (ω84 )2 (ω85 )2 (ω86 )2 (ω87 )2

k k k k k k k k

ω40 ω41 ω42 ω43 ω44 ω45 ω46 ω47

k k k k k k k k

ω40 ω41 ω42 ω43 ω40 ω41 ω42 ω43

Thus, if

(1) P (x) = P e (x2 ) + x P o (x2 )

n
and P (x) is of degree n − 1, then for k = 0 to −1
2
n
+k 2
(2) P e ((ωnk )2 ) = P e (ω kn ) and also P e ((ωn2 ) ) = P e (ω kn );
2 2
n
+k
(3) P o ((ωnk )2 ) = P o (ω kn ) and also P o ((ωn2
)2 ) = P o (ω kn );
2 2
n n
+k
(4) ωn 2
= ωn ωnk
2
= −ωnk .

Consequently, from (1)–(3) we have the following recursion for every n of the form
n = 2m :
if

• ~s = hs0 , s1 , s2 , s3 , . . . , sn i;
• s~e = hs0 , s2 , s4 , . . . , sn i and s~o = hs1 , s3 , s5 , . . . , sn−1 i
(note: both of these sequences are of length n/2)

and if

• DF T (~s) = hf0 , f1 , f2 , f3 , . . . fn i
• DF T (s~e ) = hf0e , f1e , . . . , f ne i and DF T (s~o ) = hf0o , f1o , . . . , f no i;
2 2
4

n
then for all 0 ≤ k ≤ 2
− 1 we have

(5) fk = fke + ωnk fko ; f n2 +k = fke + ω kn +k fko = fke − ωnk fko ;


2

We now compute

DF T (h1, 5i) = hPee (ω20 ), Pee (ω21 )i = hPee (1), Pee (−1)i

= h1 + 5 · 1, 1 + 5 · (−1)i = h6, −4i

DF T (h3, 7i) = hPeo (ω20 ), Peo (ω21 )i = hPeo (1), Peo (−1)i

= h3 + 7 · 1, 3 + 7 · (−1)i = h10, −4i

DF T (h2, 6i) = hPoe (ω20 ), Poe (ω21 )i = hPoe (1), Poe (−1)i

= h2 + 6 · 1, 2 + 6 · (−1)i = h8, −4i

DF T (h4, 8i) = hPoo (ω20 ), Poo (ω21 )i = hPoo (1), Poo (−1)i

= h4 + 8 · 1, 4 + 8 · (−1)i = h12, −4i

We now use equations (5) with n = 4 to start putting things together:

DF T (h1, 3, 5, 7i) = h6 + ω40 · 10, −4 + ω41 (−4), 6 − ω40 · 10, −4 − ω41 (−4)i

= h6 + 10, −4 + ı̇(−4), 6 − 10, −4 − ı̇(−4)i

= h16, −4 − 4 ı̇, −4, −4 + 4 ı̇i

DF T (h2, 4, 6, 8i) = h8 + ω40 · 12, −4 + ω41 (−4), 8 − ω40 · 12, −4 − ω41 (−4)i

= h8 + 12, −4 + ı̇(−4), 8 − 12, −4 − ı̇(−4)i

= h20, −4 − 4 ı̇, −4, −4 + 4 ı̇i

Finally we obtain from (5) with n = 8,

DF T (h1, 2, 3, 4, 5, 6, 7, 8i) = h16 + ω80 · 20, −4 − 4 ı̇ +ω81 (−4 − 4 ı̇), −4 + ω82 · (−4), −4 + 4 ı̇ +ω83 (−4 + 4 ı̇),

16 − ω80 · 20, −4 − 4 ı̇ −ω81 (−4 − 4 ı̇), −4 − ω82 · (−4), −4 + 4 ı̇ −ω83 (−4 + 4 ı̇)i
5
* √ √ ! √ √ !
2 2 2 2
= 16 + 1 · 20, −4 − 4 ı̇ + + ı̇ (−4 − 4 ı̇), −4 + ı̇ ·(−4), −4 + 4 ı̇ + − + ı̇ (−4 + 4 ı̇),
2 2 2 2
√ √ ! √ √ ! +
2 2 2 2
16 − 1 · 20, −4 − 4 ı̇ − + ı̇ (−4 − 4 ı̇), −4 − ı̇ ·(−4), −4 + 4 ı̇ − − + ı̇ (−4 + 4 ı̇)
2 2 2 2

√ √ √ √
= h36, −4 − 4 ı̇(1 + 2), −4 − 4 ı̇, −4 + 4 ı̇(1 − 2), −4, −4 − 4 ı̇(1 − 2), −4 + 4 ı̇, −4 + 4 ı̇(1 + 2)i

Another example

Previous example might have resulted in confusingly symmetric calculations, so let us


compute the DFT of the sequence h1, 8, 4, 3, 2, 5, 6, 7i. The corresponding polynomial is
now

Q(x) = 1 + 8x + 4x2 + 3x3 + 2x4 + 5x5 + 6x6 + 7x7

= 1 + 4x2 + 2x4 + 6x6 + x(8 + 3x2 + 5x4 + 7x6 ).

Substituting y = x2 we get

Q(x) = 1 + 4y + 2y 2 + 6y 3 + x(8 + 3y + 5y 2 + 7y 3 ).

We let

Qe (y) = 1 + 4y + 2y 2 + 6y 3 ; Qo (y) = 8 + 3y + 5y 2 + 7y 3 ;

We now have with substitution z = y 2

Qe (y) = 1 + 2y 2 + y(4 + 6y 2 ); Qo (y) = 8 + 5y 2 + y(3 + 7y 2 );

= 1 + 2z + y(4 + 6z); = 8 + 5z + y(3 + 7z);

We let

Qee (y) = 1 + 2z; Qeo (y) = 4 + 6z;

Qoe (y) = 8 + 5z; Qoo (y) = 3 + 7z;


6

We now have:

DF T (h1, 2i) = hQee (ω20 ), Qee (ω2 )i = hQee (1), Qee (−1)i = h3, −1i;

DF T (h4, 6i) = hQeo (ω20 ), Qeo (ω2 )i = hQeo (1), Qeo (−1)i = h10, −2i;

DF T (h8, 5i) = hQoe (ω20 ), Qoe (ω2 )i = hQee (1), Qee (−1)i = h13, 3i;

DF T (h3, 7i) = hQoo (ω20 ), Qoo (ω2 )i = hQee (1), Qee (−1)i = h10, −4i.

We now use equations (5) with n = 4 to start putting things together:

DF T (h1, 4, 2, 6i) = h3 + ω40 · 10, −1 + ω41 (−2), 3 − ω40 · 10, −1 − ω41 (−2)i

= h3 + 10, −1 + ı̇(−2), 3 − 10, −1 − ı̇(−2)i

= h13, −1 − 2 ı̇, −7, −1 + 2 ı̇i

DF T (h8, 3, 5, 7i) = h13 + ω40 · 10, 3 + ω41 (−4), 13 − ω40 · 10, 3 − ω41 (−4)i

= h13 + 10, 3 + ı̇(−4), 13 − 10, 3 − ı̇(−4)i

= h23, 3 − 4 ı̇, 3, 3 + 4 ı̇i

Finally, from (5) with n = 8 we obtain

DF T (h1, 8, 4, 3, 2, 5, 6, 7i) = h13 + ω80 · 23, −1 − 2 ı̇ +ω81 (3 − 4 ı̇), −7 + ω82 · 3, −1 + 2 ı̇ +ω83 (3 + 4 ı̇),

13 − ω80 · 23, −1 − 2 ı̇ −ω81 (3 − 4 ı̇), −7 − ω82 · 3, −1 + 2 ı̇ −ω83 (3 + 4 ı̇)i


* √ √ ! √ √ !
2 2 2 2
= 13 + 1 · 23, −1 − 2 ı̇ + + ı̇ (3 − 4 ı̇), −7 + ı̇ ·3, −1 + 2 ı̇ + − + ı̇ (3 + 4 ı̇),
2 2 2 2
√ √ ! √ √ ! +
2 2 2 2
13 − 1 · 23, −1 − 2 ı̇ − + ı̇ (3 − 4 ı̇), −7 − ı̇ ·3, −1 + 2 ı̇ − − + ı̇ (3 + 4 ı̇)
2 2 2 2
* √ √ √ √
−2 + 7 2 4+ 2 −2 − 7 2 4− 2
= 36, − ı̇ , −7 + 3 ı̇, + ı̇ ,
2 2 2 2
√ √ √ √ +
−2 − 7 2 4− 2 −2 + 7 2 4+ 2
−10, − ı̇ , −7 − 3 ı̇, + ı̇
2 2 2 2

S-ar putea să vă placă și