示例#1
0
文件: app1.py 项目: WiLab/gr-iio
    def __init__(self):
        gr.top_block.__init__(self)

        sample_rate = 48000
        ampl = 0.1
        src = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 350, ampl)
        sink = iio.fmcomms_sink()
        self.connect(src, sink)
	print "Devices instantiated and connect"
示例#2
0
 def test_001_t (self):
     # set up fg
     input = (0,0,0,0,0,0)
     expected_output = (0.025024, 0, 0, 0, 0, 0)
     src = blocks.vector_source_i(input)
     #src = input
     block = iio.fmcomms_sink()
     dst = blocks.vector_sink_f()
     self.tb.connect(src,block)
     self.tb.connect(block,dst)
     print ('Before run')
     self.tb.run ()
     print ('After run')
     # check data
     result_data = dst.data()
     print ("The data from the block:",result_data)
     self.assertFloatTuplesAlmostEqual(expected_output, result_data,6)