discuss-gnuradio
[Top][All Lists]
Advanced

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

Initializing parameter variables in Python OOT module


From: George Edwards
Subject: Initializing parameter variables in Python OOT module
Date: Thu, 7 Jan 2021 14:34:24 -0700

Happy New Year!

I am having problems initializing Python OOT parameters.

At the start of the program several parameters need initialization. One param is a complex valued parameter v1 to be initialized at the start of the program run with 8 zeros, i.e., v1 = np.array([0+0*1j,  0+0*1j ,...  , 0+0*1j ]), I am having problems setting up initialization.

Here is a snippet of what I have tried which is not working:

def my_init(self):   # written below the grc def __init__ (self) method
     v1 =  np.array([0+0*1j,  0+0*1j ,... ,   0+0*1j ]) 
     # other variables for initialization, eg. v2

In the grc general_work method the params are used:

def general_work(self, input_items, output_items):
      ....
      ....
      if value == True        # I am not certain exactly how to set value and where
           v1, v2, ... = self.my_init()    #my_init() should run once only at start time
           
      v2 = np.fft.ifft(v1)
I appreciate any help or advice.

Regards,
George
           

reply via email to

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