diff options
author | Tom Rondeau <tom@trondeau.com> | 2014-10-21 16:07:53 -0400 |
---|---|---|
committer | Tom Rondeau <tom@trondeau.com> | 2014-10-21 16:07:53 -0400 |
commit | fdf13bdc0640f4ffa892c9bebedf74274bc6ea82 (patch) | |
tree | 255ccf0c2dbddaba6b83ca9fc2ade8921be46cba /gr-digital/python/digital/qa_costas_loop_cc.py | |
parent | 5f4e68a60e96609fffe5478fb356798831201d87 (diff) |
digital: adding use of tanh and snr info to costas loop.
Diffstat (limited to 'gr-digital/python/digital/qa_costas_loop_cc.py')
-rwxr-xr-x | gr-digital/python/digital/qa_costas_loop_cc.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/gr-digital/python/digital/qa_costas_loop_cc.py b/gr-digital/python/digital/qa_costas_loop_cc.py index 9ecb017599..e48f45cc22 100755 --- a/gr-digital/python/digital/qa_costas_loop_cc.py +++ b/gr-digital/python/digital/qa_costas_loop_cc.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 import cmath @@ -46,7 +46,7 @@ class test_costas_loop_cc(gr_unittest.TestCase): self.tb.connect(self.src, self.test, self.snk) self.tb.run() - + expected_result = data dst_data = self.snk.data() self.assertComplexTuplesAlmostEqual(expected_result, dst_data, 5) @@ -77,7 +77,7 @@ class test_costas_loop_cc(gr_unittest.TestCase): rot = cmath.exp(0.2j) # some small rotation data = [complex(2*random.randint(0,1)-1, 0) for i in xrange(100)] - + N = 40 # settling time expected_result = data[N:] data = [rot*d for d in data] @@ -89,7 +89,7 @@ class test_costas_loop_cc(gr_unittest.TestCase): self.tb.run() dst_data = self.snk.data()[N:] - + # generously compare results; the loop will converge near to, but # not exactly on, the target data self.assertComplexTuplesAlmostEqual(expected_result, dst_data, 2) @@ -103,7 +103,7 @@ class test_costas_loop_cc(gr_unittest.TestCase): rot = cmath.exp(0.2j) # some small rotation data = [complex(2*random.randint(0,1)-1, 2*random.randint(0,1)-1) for i in xrange(100)] - + N = 40 # settling time expected_result = data[N:] data = [rot*d for d in data] @@ -130,7 +130,7 @@ class test_costas_loop_cc(gr_unittest.TestCase): const = psk.psk_constellation(order) data = [random.randint(0,7) for i in xrange(100)] data = [2*rot*const.points()[d] for d in data] - + N = 40 # settling time expected_result = data[N:] @@ -144,7 +144,7 @@ class test_costas_loop_cc(gr_unittest.TestCase): self.tb.run() dst_data = self.snk.data()[N:] - + # generously compare results; the loop will converge near to, but # not exactly on, the target data self.assertComplexTuplesAlmostEqual(expected_result, dst_data, 2) |