Hello,
I am developing an interpolator-like algorithm with a Python OOT Interpolator module. The trivial code below takes 3-complex input streams into an OOT Interpolator block and the goal is to output 2 complex samples=> out[:] = np.array([v2,v2]) where v2 = 1.0+1.0*1j at each time instance based on the triplet, a sample from each input. The error running the QA file is: could not broadcast input array from shape (2) into shape (8). I do not know if giving the Interpolator 3 inputs could be the problem? The algorithmic goal at each time step is to output two complex samples based on one sample from each of the 3 input ports doing out[:] = np.array([v2,v2]). My main code is below (the yml settings could be wrong as I am not familiar with using the OOT Interpolator).
Thanks for your help!
George
def __init__(self, my_start = True):
gr.interp_block.__init__(self,
name="my_interp_py_cc",
in_sig=[np.complex64, np.complex64, np.complex64],
out_sig=[np.complex64 ], interp = 2)
self.my_start = my_start
self.v1 = v1 = np.zeros(8)+np.zeros(8)*1j
self.v2 = v2 = 1.0+1.0*1j
def work(self, input_items, output_items):
in0 = input_items[0]
in1 = input_items[1]
in2 = input_items[2]
out = output_items[0]
global v1, v2
if self.my_start == True:
v1 = self.v1
v2 = self.v2
self.my_start = False
self.v1 = v1
self.v2 = v2
v2 = 1.0+1.0*1j
out[:] = np.array([v2,v2])
return len(output_items[0])
No comments:
Post a Comment