r/Python • • Aug 28 '13

Understanding the FFT Algorithm (with Python examples)

http://jakevdp.github.io/blog/2013/08/28/understanding-the-fft/
135 Upvotes

13 comments sorted by

View all comments

Show parent comments

4

u/minno I <3 duck typing less than I used to, interfaces are nice Aug 29 '13

Why the e = exp(1)? Just use exp to do the exponentiation.

5

u/jakevdp Aug 29 '13

math.exp can't handle complex numbers. You'd need to use cmath.exp instead.

2

u/isarl Aug 29 '13

So why not use from cmath import exp,pi?

1

u/Antagonist360 Aug 29 '13

Sure that would work. Didn't know about cmath