我想知道我是否可以在一个嵌入式Python块中拥有多个输入?如果答案是肯定的,我如何才能得到它?
要想拥有多个输入,你需要向 in_sig
参数。例如,要有两个复杂的输入,你需要 in_sig=[np.complex64, np.complex64]
class blk(gr.sync_block): # other base classes are basic_block, decim_block, interp_block
"""Embedded Python Block example - a simple multiply const"""
def __init__(self, example_param=1.0): # only default arguments here
"""arguments to this function show up as parameters in GRC"""
gr.sync_block.__init__(
self,
name='Embedded Python Block', # will show up in GRC
in_sig=[np.complex64, np.complex64],
out_sig=[np.complex64]
)