How to get complex64 output from numpy.fft?
1 answer
Well, it looks like the type is defined quite deeply in the C code. Fftpack_litemodule.c uses NPY_CDOUBLE
as an array type, and it's basically yours complex128
. The only solution I can see is to convert the array to complex64
using, astype(np.complex64)
or use the scipy.fftpack package , which returns an array from float64
encoding complex values as:
[y(0),Re(y(1)),Im(y(1)),...,Re(y(n/2))] if n is even
[y(0),Re(y(1)),Im(y(1)),...,Re(y(n/2)),Im(y(n/2))] if n is odd
+2
source to share