python - How to get complex64 output from numpy.fft? -
i have following code:
ga=rfft2(a)
a
type float32
, ga
comes out complex128
doubling data. how can out complex64
data? isn't default functionality fftw
?
well, seems type defined quite deep in c code. fftpack_litemodule.c uses npy_cdouble
array type , complex128
. solution see transform array complex64
using astype(np.complex64)
or use scipy.fftpack package returns array of float64
encoding complex values as:
[y(0),re(y(1)),im(y(1)),...,re(y(n/2))] if n [y(0),re(y(1)),im(y(1)),...,re(y(n/2)),im(y(n/2))] if n odd
Comments
Post a Comment