Ejemplo n.º 1
0
 def test_002_moving_sum_cc(self):
     src_data = [float(i ** 3) * (7 ** -2) + 0.5j * i for i in range(-20, 20)]
     expected_result = [src_data[0]] + [src_data[i] + src_data[i - 1] for i in range(1, 40)]
     src = blocks.vector_source_c(src_data)
     moving_sum = dab.moving_sum_cc(2)
     dst = blocks.vector_sink_c()
     self.tb.connect(src, moving_sum)
     self.tb.connect(moving_sum, dst)
     self.tb.run()
     result_data = dst.data()
     self.assertComplexTuplesAlmostEqual(expected_result, result_data, 4)
Ejemplo n.º 2
0
 def test_001_moving_sum_cc(self):
     src_data = (0j, 1 + 0j, 1j, -1 + 0j, 0j, 0j, 0j, 1 + 0j, 1j, 2 + 0j)
     expected_result = (0j, 1 + 0j, 1 + 1j, 1j, 1j, 1j, -1 + 1j, 0j, 1 + 1j, 3 + 1j)
     src = blocks.vector_source_c(src_data)
     moving_sum = dab.moving_sum_cc(5)
     dst = blocks.vector_sink_c()
     self.tb.connect(src, moving_sum)
     self.tb.connect(moving_sum, dst)
     self.tb.run()
     result_data = dst.data()
     self.assertComplexTuplesAlmostEqual(expected_result, result_data, 6)
Ejemplo n.º 3
0
 def test_001_moving_sum_cc(self):
     src_data = (0j, 1 + 0j, 1j, -1 + 0j, 0j, 0j, 0j, 1 + 0j, 1j, 2 + 0j)
     expected_result = (0j, 1 + 0j, 1 + 1j, 1j, 1j, 1j, -1 + 1j, 0j, 1 + 1j,
                        3 + 1j)
     src = blocks.vector_source_c(src_data)
     moving_sum = dab.moving_sum_cc(5)
     dst = blocks.vector_sink_c()
     self.tb.connect(src, moving_sum)
     self.tb.connect(moving_sum, dst)
     self.tb.run()
     result_data = dst.data()
     self.assertComplexTuplesAlmostEqual(expected_result, result_data, 6)
Ejemplo n.º 4
0
 def test_002_moving_sum_cc(self):
     src_data = [float(i**3) * (7**-2) + 0.5j * i for i in range(-20, 20)]
     expected_result = [src_data[0]] + [
         src_data[i] + src_data[i - 1] for i in range(1, 40)
     ]
     src = blocks.vector_source_c(src_data)
     moving_sum = dab.moving_sum_cc(2)
     dst = blocks.vector_sink_c()
     self.tb.connect(src, moving_sum)
     self.tb.connect(moving_sum, dst)
     self.tb.run()
     result_data = dst.data()
     self.assertComplexTuplesAlmostEqual(expected_result, result_data, 4)