def test_001_t (self):
        # set up fg
	src_data = (-3 + 1j , 4 + 2j, -5 + 5j, 2)
	for i in range(6000):
		src_data = src_data + (-3 + 1j , 4 + 2j, -5 + 5j, 2)
        #expected_result0 = (-3 + 1j, -4 + 2j, -5 + 5j, -2)
	#expected_result1 = (4 + 2j, -3 - 1j , 2 , -5 -5j)
        src = blocks.vector_source_c(src_data)
        mmtx = mimo.alamouti_encode_cc()

	add = blocks.add_cc()

	mmrx = mimo.alamouti_decode_cc()
        dst = blocks.vector_sink_c()

        self.tb.connect(src, mmtx)
        self.tb.connect((mmtx,0), (add,0))
	self.tb.connect((mmtx,1), (add,1))
	self.tb.connect(add, (mmrx,0))
	self.tb.connect(add, (mmrx,1))
	self.tb.connect(mmrx, dst)
        self.tb.run ()
        # check data
	result_data = dst.data()
	print len(result_data)
	#for i in range(len(result_data)):
	#	print result_data[i]
	#	print src_data[i]
        self.assertComplexTuplesAlmostEqual(src_data , result_data, 1025)
    def test_001_t(self):
        # set up fg
        src_data = (-3 + 1j, 4 + 2j, -5 + 5j, 2)
        for i in range(6000):
            src_data = src_data + (-3 + 1j, 4 + 2j, -5 + 5j, 2)

    #expected_result0 = (-3 + 1j, -4 + 2j, -5 + 5j, -2)
        #expected_result1 = (4 + 2j, -3 - 1j , 2 , -5 -5j)
        src = blocks.vector_source_c(src_data)
        mmtx = mimo.alamouti_encode_cc()

        add = blocks.add_cc()

        mmrx = mimo.alamouti_decode_cc()
        dst = blocks.vector_sink_c()

        self.tb.connect(src, mmtx)
        self.tb.connect((mmtx, 0), (add, 0))
        self.tb.connect((mmtx, 1), (add, 1))
        self.tb.connect(add, (mmrx, 0))
        self.tb.connect(add, (mmrx, 1))
        self.tb.connect(mmrx, dst)
        self.tb.run()
        # check data
        result_data = dst.data()
        print len(result_data)
        #for i in range(len(result_data)):
        #	print result_data[i]
        #	print src_data[i]
        self.assertComplexTuplesAlmostEqual(src_data, result_data, 1025)
示例#3
0
    def notest_001_t (self):
	expected_result = (-3 + 1j , 4 + 2j, -5 + 5j, 2)
	#alamouti code ant1
        src_data0 = (-3 + 1j, -4 + 2j, -5 + 5j, -2)
	#alamouti code ant2
	src_data1 = (4 + 2j, -3 - 1j , 2 , -5 -5j)
	#simple channel
	input_data= (1 + 3j , -7 + 1j , -3 + 5j , -7 - 5j) #src_data0 + src_data1

        src = blocks.vector_source_c(input_data)
        mm = mimo.alamouti_decode_cc()
        dst = blocks.vector_sink_c()
        self.tb.connect(src, (mm,0))
	self.tb.connect(src, (mm,1))
	self.tb.connect(mm, dst)
        self.tb.run ()
        # check data
	result_data = dst.data()
        self.assertComplexTuplesAlmostEqual(expected_result, result_data, 5)