mirror of
https://github.com/mborgerding/kissfft.git
synced 2025-07-18 13:04:19 -04:00
Dog slow, but does mixed radix!
'make test' output : ### testing SNR for 1024 point FFTs #### DOUBLE snr_t2f = 295.52 snr_f2t = 307.98 #### FLOAT snr_t2f = 144.62 snr_f2t = 143.23 #### SHORT snr_t2f = -31.515 snr_f2t = -60.836 #### timing 10000 x 1024 point FFTs #### DOUBLE Elapsed:0:44.17 user:35.11 sys:0.27 #### FLOAT Elapsed:0:24.22 user:19.66 sys:0.16 #### SHORT Elapsed:0:30.39 user:25.07 sys:0.09
This commit is contained in:
6
fft.py
6
fft.py
@ -15,18 +15,22 @@ def fft(f):
|
||||
else:
|
||||
raise Exception('%s not factorable ' % n)
|
||||
|
||||
print 'n=%d,p=%d' % (n,p)
|
||||
print f,' << fin'
|
||||
m = n/p
|
||||
Fout=[]
|
||||
for q in range(p): # 0,1
|
||||
fp = f[q::p]
|
||||
print fp,'<< fp'
|
||||
Fp = fft( fp )
|
||||
Fout.extend( Fp )
|
||||
|
||||
for u in range(m):
|
||||
scratch = Fout[u::m] # u to end in strides of m
|
||||
print scratch
|
||||
for q1 in range(p):
|
||||
k = q1*m + u # indices to Fout above that became scratch
|
||||
Fout[ k ] = scratch[0]
|
||||
Fout[ k ] = scratch[0] # cuz e**0==1 in loop below
|
||||
for q in range(1,p):
|
||||
t = e ** ( j*2*pi*k*q/n )
|
||||
Fout[ k ] += scratch[q] * t
|
||||
|
Reference in New Issue
Block a user