#!/usr/bin/env python from gnuradio import gr, eng_notation, gru, window, blks2 from gnuradio import audio from gnuradio import usrp from gnuradio.eng_option import eng_option from optparse import OptionParser from gnuradio import gr_unittest class my_top_block(gr.top_block): def __init__(self): gr.top_block.__init__(self) self.data = (1+2j, 3+4j, 5+6j) self.src = gr.vector_source_c (self.data) self.converte = gr.complex_to_float() self.re_sink = gr.vector_sink_f () self.im_sink = gr.vector_sink_f () self.connect (self.src, (self.converte,0)) self.connect ((self.converte,0), self.re_sink) self.connect((self.converte,1), self.im_sink) if __name__ == '__main__' : tb = my_top_block() try: tb.run() except KeyboardInterrupt: pass print "src data: ", tb.data print "real: ", tb.re_sink.data() print "imag: ", tb.im_sink.data()