Esempio n. 1
0
def fft_BUG(n, x, y, sn):
    z=[x[i]+y[i]*1j for i in range(1,n+1)]
    z = array(z)
    if sn>0.0: z=_ifft(z)*n
    else:      z=_fft(z)
    for i in range(1,n+1):
        x[i]=z[i-1].real; y[i]=z[i-1].imag
    return (x,y)
Esempio n. 2
0
def fft(n, x, y, sn):
    z=[x[i]+y[i]*1j for i in range(0,n)]
    z = array(z)
    if sn>0.0: z=_ifft(z)*n
    else:      z=_fft(z)
    xx = zeros(n+1,float); yy = zeros(n+1,float)
    for i in range(0,n):
        xx[i]=z[i].real; yy[i]=z[i].imag
    return (xx,yy)