|
From: | Josh Morman |
Subject: | Re: GRC port type assignment in Python Block |
Date: | Mon, 26 Jul 2021 07:32:31 -0400 |
Hello All,
I am trying to write a python block that will convert shorts to complex int16, and I am having some difficulties. I have a need for this block so that I can read int16 data from a file using the file source block, and then transmit that data to a USRP X310 using a UHD USRP sink using complex int16 input type.
The problem I am having is being able to set out_sig within the block init to a numpy dtype representation of complex int16. I tried using the following: np.dtype([(‘re’, np.int16), (‘im’, np.int16)]). I get the following error when using this: Can’t map dtype([(‘re’, ‘<i2’), (‘im’, ’<i2’)]) to GRC port type.
Does anyone know of a way to set the out_sig in a python block to a complex int16 type that will map to the complex int16 GRC port type? I figure this must be doable if the UHD USRP blocks have complex int16 GRC port types.
Best Regards,
Jerrid
[Prev in Thread] | Current Thread | [Next in Thread] |