Code:
# Python 2.0 (#1, Oct 29 2000, 23:53:20) (SAS/C 6.x] on amiga
# Type "copyright", "credits" or "license" for more information.
# The line below is for progress info ONLY.
print("\033[23;1fNow running the Python FFT function...")
import sys
import cmath
def fft(DATA):
N=len(DATA)
if N<=1: return DATA
EVEN=fft([DATA[K] for K in range(0,N,2)])
ODD=fft([DATA[K] for K in range(1,N,2)])
L=[EVEN[K]+cmath.exp(-2j*cmath.pi*K/N)*ODD[K] for K in range(N/2)]
R=[EVEN[K]-cmath.exp(-2j*cmath.pi*K/N)*ODD[K] for K in range(N/2)]
return L+R
FFT_LIST=[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,\
1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,\
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0,\
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
FFT=fft(FFT_LIST)
# print(FFT)
LENGTH=len(FFT)
STDOUT=sys.stdout
sys.stdout=open("DATA.txt", "w")
for FFT_LISTING in range(0,LENGTH,1): print("%i" % (int(abs(FFT[FFT_LISTING]))))
sys.stdout=STDOUT
sys.exit()