def test_006_peak_location_cf (self): src_data = (0+0j,5+0j,0+0j,0+0j,0+0j,5+0j,0+0j,0+0j) expected_result = (1.0,1.0) src = gr.vector_source_c (src_data) sqr = howto_swig.peak_location_cf (4,4) dst = gr.vector_sink_f () self.tb.connect (src, sqr) self.tb.connect (sqr, dst) self.tb.run () result_data = dst.data () self.assertFloatTuplesAlmostEqual (expected_result, result_data)
def test_004_peak_location_cf(self): src_data = ((0 + 0j), (0 + 0j), (5 + 0j), (0 + 0j)) expected_result = (2.0, ) src = gr.vector_source_c(src_data) sqr = howto_swig.peak_location_cf(4, 4) dst = gr.vector_sink_f() self.tb.connect(src, sqr) self.tb.connect(sqr, dst) self.tb.run() result_data = dst.data() self.assertFloatTuplesAlmostEqual(expected_result, result_data)