6 lines
337 B
Python
6 lines
337 B
Python
>>> from numpy.fft import fft
|
|
>>> from numpy import array
|
|
>>> a = array((0.0, 0.924, 0.707, -0.383, -1.0, -0.383, 0.707, 0.924, 0.0, -0.924, -0.707, 0.383, 1.0, 0.383, -0.707, -0.924))
|
|
>>> print( ' '.join("%5.3f" % abs(f) for f in fft(a)) )
|
|
0.000 0.001 0.000 8.001 0.000 0.001 0.000 0.001 0.000 0.001 0.000 0.001 0.000 8.001 0.000 0.001
|