diff options
Diffstat (limited to 'gr-digital/python/digital/qa_mpsk_snr_est.py')
-rwxr-xr-x | gr-digital/python/digital/qa_mpsk_snr_est.py | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/gr-digital/python/digital/qa_mpsk_snr_est.py b/gr-digital/python/digital/qa_mpsk_snr_est.py index 032edf1c73..97d31c7686 100755 --- a/gr-digital/python/digital/qa_mpsk_snr_est.py +++ b/gr-digital/python/digital/qa_mpsk_snr_est.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2011-2013 Free Software Foundation, Inc. -# +# # This file is part of GNU Radio -# +# # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. -# +# # GNU Radio is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with GNU Radio; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -# +# import random from gnuradio import gr, gr_unittest, digital, blocks @@ -44,7 +44,7 @@ class test_mpsk_snr_est(gr_unittest.TestCase): 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) dst = blocks.null_sink(gr.sizeof_gr_complex) @@ -55,9 +55,9 @@ class test_mpsk_snr_est(gr_unittest.TestCase): result.append(op.snr()) return result - + def test_mpsk_snr_est_simple(self): - expected_result = [11.48, 5.91, 3.30, 2.08, 1.46] + expected_result = [8.20, 4.99, 3.23, 2.01, 1.03] N = 10000 alpha = 0.001 @@ -67,7 +67,7 @@ class test_mpsk_snr_est(gr_unittest.TestCase): self.assertFloatTuplesAlmostEqual(expected_result, actual_result, 2) def test_mpsk_snr_est_skew(self): - expected_result = [11.48, 5.91, 3.30, 2.08, 1.46] + expected_result = [8.31, 1.83, -1.68, -3.56, -4.68] N = 10000 alpha = 0.001 @@ -77,7 +77,7 @@ class test_mpsk_snr_est(gr_unittest.TestCase): self.assertFloatTuplesAlmostEqual(expected_result, actual_result, 2) def test_mpsk_snr_est_m2m4(self): - expected_result = [11.02, 6.20, 4.98, 5.16, 5.66] + expected_result = [8.01, 3.19, 1.97, 2.15, 2.65] N = 10000 alpha = 0.001 @@ -87,7 +87,7 @@ class test_mpsk_snr_est(gr_unittest.TestCase): self.assertFloatTuplesAlmostEqual(expected_result, actual_result, 2) def test_mpsk_snr_est_svn(self): - expected_result = [10.92, 6.02, 4.78, 4.98, 5.51] + expected_result = [7.91, 3.01, 1.77, 1.97, 2.49] N = 10000 alpha = 0.001 @@ -97,12 +97,12 @@ class test_mpsk_snr_est(gr_unittest.TestCase): 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] + expected_result = [8.01, 3.19, 1.97, 2.15, 2.65] 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 @@ -121,4 +121,3 @@ if __name__ == '__main__': # noise source, so these estimates have no real meaning; # just a sanity check. gr_unittest.run(test_mpsk_snr_est, "test_mpsk_snr_est.xml") - |