Presentation is loading. Please wait.

Presentation is loading. Please wait.

Guerino Mazzola (Fall 2015 © ): Introduction to Music Technology IIIDigital Audio III.4 (We Oct 28) Fast Fourier Transform (FFT)

Similar presentations


Presentation on theme: "Guerino Mazzola (Fall 2015 © ): Introduction to Music Technology IIIDigital Audio III.4 (We Oct 28) Fast Fourier Transform (FFT)"— Presentation transcript:

1 Guerino Mazzola (Fall 2015 © ): Introduction to Music Technology IIIDigital Audio III.4 (We Oct 28) Fast Fourier Transform (FFT)

2 Guerino Mazzola (Fall 2015 © ): Introduction to Music Technology Recall these facts: The representation w r = w(rΔ) = w(r/N) = ∑ m = 0, 1, 2, 3,... N-1 c m e i2 .mr/N identifies the sequence w = (w 0,w 1,w 2,…,w N-1 ) as a vector in the N-dimensional complex space So our samples of fundamental frequency f = 1 are identified with the vectors w ∈ identifies the sequence w = (w 0,w 1,w 2,…,w N-1 ) as a vector in the N-dimensional complex space ¬ N. So our samples of fundamental frequency f = 1 are identified with the vectors w ∈ ¬ N. We have a scalar product — similar to the highschool formula (u,v) = |u|.|v|.cos(u,v): Have N exponential functions e 0, e 1, e 2,... e N-1 that are represented as vectors in Have N exponential functions e 0, e 1, e 2,... e N-1 that are represented as vectors in ¬ N e m = (e m (r) = e i2 .mr/N ) r = 0,1,2,...N-1 〈 e m, e m 〉 = 1, 〈 e m, e k 〉 = 0 m ≠ k = orthogonality relations mentioned above! e 0, e 1, e 2,... e N-1 The e 0, e 1, e 2,... e N-1 = orthonormal basis like for normal 3 space! (ortho ~ perpendicular, normal ~ length 1) They replace the sinusoidal functions! 90 o emememem elelelel ekekekek u v

3 Guerino Mazzola (Fall 2015 © ): Introduction to Music Technology And this: Every sound sample vector w = (w 0,w 1,w 2,…,w N-1 ) in can be written as a linear combination Every sound sample vector w = (w 0,w 1,w 2,…,w N-1 ) in ¬ N can be written as a linear combination w = ∑ m = 0, 1, 2, 3,... N-1 c m e m of the exponential functions, and the (uniquely determined) coefficients c m are calculated via c m = 〈 w, e m 〉 = 1/N.∑ r = 0, 1, 2, 3,... N-1 w r e -i2 .mr/N And this: Every sound sample vector w = (w 0,w 1,w 2,…,w N-1 ) in can be written as a linear combination Every sound sample vector w = (w 0,w 1,w 2,…,w N-1 ) in ¬ N can be written as a linear combination w = ∑ m = 0, 1, 2, 3,... N-1 c m e m of the exponential functions, and the (uniquely determined) coefficients c m are calculated via c m = 〈 w, e m 〉 = 1/N.∑ r = 0, 1, 2, 3,... N-1 w r e -i2 .mr/N 90 o emememem elelelel ekekekek So we have to calculate the coefficients c m ! The big question is:How fast can we do this? N can be very large!! Think of CD: 44100 samples/second So we have to calculate the coefficients c m ! The big question is:How fast can we do this? N can be very large!! Think of CD: 44100 samples/second

4 Guerino Mazzola (Fall 2015 © ): Introduction to Music Technology John W. Tuckey Carl F. Gauss

5 Guerino Mazzola (Fall 2015 © ): Introduction to Music Technology For the calculation of the N values c m = 〈 w, e m 〉 = 1/N.∑ r = 0, 1, 2, 3,... N-1 w r e -i2 .mr/N we suppose that the values 1.w r for all r = 0,1,... N-1 2.E(N) = e -i2  /N are all known. We have to calculate the powers e -i2 .2/N = E(N) 2,... e -i2 .(N-1)/N = E(N) N-1 by N-2 multiplications. And then for all m, r the N 2 multiplications w r × e -i2 .mr/N And we have to add N-1 times the products and make one division by N per m, adding up to N 2 additional operations. This all adds up to 2N 2 + N-2 operations, which grows in a quadratic manner with respect to N. Example: N = 44100: 2N 2 + N-2 = Example: N = 44100: 2N 2 + N-2 = 3 889 664 098 ≈ 3.889 Billions

6 Guerino Mazzola (Fall 2015 © ): Introduction to Music Technology The FFT algorithm allows instead of 2N 2 + N-2 operations, which grows in a quadratic manner with respect to N. a growth of only N.log(N), which means a much lesser growth ans shown here for the quotient The FFT algorithm allows instead of 2N 2 + N-2 operations, which grows in a quadratic manner with respect to N. a growth of only N.log(N), which means a much lesser growth ans shown here for the quotient Compared to 3.889 × 10 9, we only get 2.048 × 10 5 here! (2N 2 + N-2)/N.log(N)

7 Guerino Mazzola (Fall 2015 © ): Introduction to Music Technology

8 And this is the trick: The sound sample vector w = (w 0,w 1,w 2,…,w 2N-1 ) in is split into two parts of length N each: The sound sample vector w = (w 0,w 1,w 2,…,w 2N-1 ) in ¬ 2N is split into two parts of length N each: And this is the trick: The sound sample vector w = (w 0,w 1,w 2,…,w 2N-1 ) in is split into two parts of length N each: The sound sample vector w = (w 0,w 1,w 2,…,w 2N-1 ) in ¬ 2N is split into two parts of length N each: w + = (w 0, w 2, w 4,…,w 2N-2 ) even w − = (w 1, w 3,…,w 2N-1 ) odd w = (w 0,w 1,w 2,…,w 2N-1 ) ¬ 2N ¬N¬N c + = (c + 0, c + 1, c + 2,…,c + N-1 ) Fourier(N) c − = (c − 0, c − 1,…, c − N-1 ) Fourier(N) Have this decisive formula: c r = (c + r + e(N) r. c − r )/2, i.e. per r we have 2 multiplications, one addition and a total of 2N powers of e(N). Together with the 2.Fourier(N) operations for the c + and c − we have Fourier(2N) ≤ 3 × 2N + 2N + 2.Fourier(N) = 2.Fourier(N) + 8N, QED.


Download ppt "Guerino Mazzola (Fall 2015 © ): Introduction to Music Technology IIIDigital Audio III.4 (We Oct 28) Fast Fourier Transform (FFT)"

Similar presentations


Ads by Google