Skip to content Skip to sidebar Skip to footer

What's The Fastest Way To Convert An Interleaved NumPy Integer Array To Complex64?

I have a stream of incoming data that has interleaved real and imaginary integers. Converting these to complex64 values is the slowest operation in my program. This is my current a

Solution 1:

[~]
|1> import numpy as np

[~]
|2> a = np.zeros(1000000, dtype=np.int16)

[~]
|3> b = a.astype(np.float32).view(np.complex64)

[~]
|4> b.shape
(500000,)

[~]
|5> b.dtype
dtype('complex64')

Post a Comment for "What's The Fastest Way To Convert An Interleaved NumPy Integer Array To Complex64?"