discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with OOT Interpolator module in Python


From: George Edwards
Subject: Problem with OOT Interpolator module in Python
Date: Thu, 21 Jan 2021 16:03:36 -0600

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__(selfmy_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(selfinput_itemsoutput_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])


reply via email to

[Prev in Thread] Current Thread [Next in Thread]