We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ca39660 commit 71153baCopy full SHA for 71153ba
src/urh/signalprocessing/IQArray.py
@@ -209,7 +209,10 @@ def convert_array_to_iq(arr: np.ndarray) -> np.ndarray:
209
arr = arr.view(np.float32)
210
elif arr.dtype == np.complex128:
211
arr = arr.view(np.float64)
212
- return arr.reshape((-1, 2), order="C")
+ if len(arr) % 2 == 0:
213
+ return arr.reshape((-1, 2), order="C")
214
+ else: # ignore the last half sample to avoid a conversion error
215
+ return arr[:-1].reshape((-1, 2), order="C")
216
elif arr.ndim == 2:
217
return arr
218
else:
0 commit comments