summaryrefslogtreecommitdiff
path: root/gr-digital/python/qa_fll_band_edge.py
diff options
context:
space:
mode:
Diffstat (limited to 'gr-digital/python/qa_fll_band_edge.py')
-rwxr-xr-xgr-digital/python/qa_fll_band_edge.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/gr-digital/python/qa_fll_band_edge.py b/gr-digital/python/qa_fll_band_edge.py
index 9e4ca079b7..1e699bbdd4 100755
--- a/gr-digital/python/qa_fll_band_edge.py
+++ b/gr-digital/python/qa_fll_band_edge.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2011 Free Software Foundation, Inc.
+# Copyright 2011,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,25 +21,27 @@
#
from gnuradio import gr, gr_unittest
-import digital_swig
+import digital_swig as digital
+import filter_swig as filter
+import analog_swig as analog
import random, math
class test_fll_band_edge_cc(gr_unittest.TestCase):
- def setUp (self):
- self.tb = gr.top_block ()
+ def setUp(self):
+ self.tb = gr.top_block()
- def tearDown (self):
+ def tearDown(self):
self.tb = None
- def test01 (self):
+ def test01(self):
sps = 4
rolloff = 0.35
bw = 2*math.pi/100.0
ntaps = 45
# Create pulse shape filter
- rrc_taps = gr.firdes.root_raised_cosine(
+ rrc_taps = filter.firdes.root_raised_cosine(
sps, sps, 1.0, rolloff, ntaps)
# The frequency offset to correct
@@ -49,14 +51,14 @@ class test_fll_band_edge_cc(gr_unittest.TestCase):
random.seed(0)
data = [2.0*random.randint(0, 2) - 1.0 for i in xrange(200)]
self.src = gr.vector_source_c(data, False)
- self.rrc = gr.interp_fir_filter_ccf(sps, rrc_taps)
+ self.rrc = filter.interp_fir_filter_ccf(sps, rrc_taps)
# Mix symbols with a complex sinusoid to spin them
- self.nco = gr.sig_source_c(1, gr.GR_SIN_WAVE, foffset, 1)
+ self.nco = analog.sig_source_c(1, analog.GR_SIN_WAVE, foffset, 1)
self.mix = gr.multiply_cc()
# FLL will despin the symbols to an arbitrary phase
- self.fll = digital_swig.fll_band_edge_cc(sps, rolloff, ntaps, bw)
+ self.fll = digital.fll_band_edge_cc(sps, rolloff, ntaps, bw)
# Create sinks for all outputs of the FLL
# we will only care about the freq and error outputs
@@ -78,7 +80,7 @@ class test_fll_band_edge_cc(gr_unittest.TestCase):
dst_data = self.vsnk_frq.data()[N:]
expected_result = len(dst_data)* [-0.20,]
- self.assertFloatTuplesAlmostEqual (expected_result, dst_data, 4)
+ self.assertFloatTuplesAlmostEqual(expected_result, dst_data, 4)
if __name__ == '__main__':
gr_unittest.run(test_fll_band_edge_cc, "test_fll_band_edge_cc.xml")