def test_probe_mpsk_snr_est_m2m4(self): expected_result = [11.02, 6.20, 4.98, 5.16, 5.66] actual_result = [] for i in xrange(1, 6): src_data = [b + (i * n) for b, n in zip(self._bits, self._noise)] src = gr.vector_source_c(src_data) N = 10000 alpha = 0.001 op = digital.probe_mpsk_snr_est_c(digital.SNR_EST_M2M4, N, alpha) tb = gr.top_block() tb.connect(src, op) tb.run() # run the graph and wait for it to finish actual_result.append(op.snr()) self.assertFloatTuplesAlmostEqual(expected_result, actual_result, 2)
def test_probe_mpsk_snr_est_m2m4(self): expected_result = [11.02, 6.20, 4.98, 5.16, 5.66] actual_result = [] for i in xrange(1,6): src_data = [b+(i*n) for b,n in zip(self._bits, self._noise)] src = blocks.vector_source_c(src_data) N = 10000 alpha = 0.001 op = digital.probe_mpsk_snr_est_c(digital.SNR_EST_M2M4, N, alpha) tb = gr.top_block() tb.connect(src, op) tb.run() # run the graph and wait for it to finish actual_result.append(op.snr()) self.assertFloatTuplesAlmostEqual(expected_result, actual_result, 2)
def test_probe_mpsk_snr_est_m2m4 (self): expected_result = [11.02, 6.20, 4.98, 5.16, 5.66] actual_result = [] for i in xrange(1,6): src_data = [b+(i*n) for b,n in zip(self._bits, self._noise)] src = gr.vector_source_c (src_data) N = 10000 alpha = 0.001 op = digital.probe_mpsk_snr_est_c (digital.SNR_EST_M2M4, N, alpha) self.tb.connect (src, op) self.tb.run () # run the graph and wait for it to finish actual_result.append(op.snr.queryValue()) # Reset python sandbox environment self.tb.stop() self.tb.__del__() self.assertFloatTuplesAlmostEqual (expected_result, actual_result, 2)