def transform(self, src_data, rate, freq): src = gr.vector_source_f(src_data, False) dft = gr.goertzel_fc(rate, rate, freq) dst = gr.vector_sink_c() self.tb.connect(src, dft, dst) self.tb.run() return dst.data()
def __init__(self): gr.hier_block2.__init__(self, "HierBlock_tone", gr.io_signature(1, 1, gr.sizeof_float), gr.io_signature(1, 1, 4)) mag = gr.complex_to_mag () dft= gr.goertzel_fc(AUDIO_RATE,TONE_DUR_SAMP,TONE_FREQ) self.connect(self,dft,mag,self)