summaryrefslogtreecommitdiff
path: root/gr-analog/python/qa_agc.py
diff options
context:
space:
mode:
Diffstat (limited to 'gr-analog/python/qa_agc.py')
-rwxr-xr-xgr-analog/python/qa_agc.py49
1 files changed, 14 insertions, 35 deletions
diff --git a/gr-analog/python/qa_agc.py b/gr-analog/python/qa_agc.py
index dc4922cf84..263f9a647e 100755
--- a/gr-analog/python/qa_agc.py
+++ b/gr-analog/python/qa_agc.py
@@ -24,14 +24,12 @@ from gnuradio import gr, gr_unittest
import analog_swig as analog
import math
-test_output = False
+class test_agc(gr_unittest.TestCase):
-class test_agc (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
@@ -105,8 +103,8 @@ class test_agc (gr_unittest.TestCase):
(1.26766037940979-0.92100900411605835j))
sampling_freq = 100
- src1 = gr.sig_source_c(sampling_freq, gr.GR_SIN_WAVE,
- sampling_freq * 0.10, 100.0)
+ src1 = analog.sig_source_c(sampling_freq, analog.GR_SIN_WAVE,
+ sampling_freq * 0.10, 100.0)
dst1 = gr.vector_sink_c()
head = gr.head(gr.sizeof_gr_complex, int (5*sampling_freq * 0.10))
@@ -116,9 +114,6 @@ class test_agc (gr_unittest.TestCase):
tb.connect(head, agc)
tb.connect(agc, dst1)
- if test_output == True:
- tb.connect(agc, gr.file_sink(gr.sizeof_gr_complex, "test_agc_cc.dat"))
-
tb.run()
dst_data = dst1.data()
self.assertComplexTuplesAlmostEqual(expected_result, dst_data, 4)
@@ -193,8 +188,8 @@ class test_agc (gr_unittest.TestCase):
-3.3931560516357422)
sampling_freq = 100
- src1 = gr.sig_source_f (sampling_freq, gr.GR_SIN_WAVE,
- sampling_freq * 0.10, 100.0)
+ src1 = analog.sig_source_f(sampling_freq, analog.GR_SIN_WAVE,
+ sampling_freq * 0.10, 100.0)
dst1 = gr.vector_sink_f ()
head = gr.head (gr.sizeof_float, int (5*sampling_freq * 0.10))
@@ -204,9 +199,6 @@ class test_agc (gr_unittest.TestCase):
tb.connect (head, agc)
tb.connect (agc, dst1)
- if test_output == True:
- tb.connect (agc, gr.file_sink(gr.sizeof_float, "test_agc_ff.dat"))
-
tb.run ()
dst_data = dst1.data ()
self.assertFloatTuplesAlmostEqual (expected_result, dst_data, 4)
@@ -283,8 +275,8 @@ class test_agc (gr_unittest.TestCase):
(0.80901449918746948-0.5877833366394043j))
sampling_freq = 100
- src1 = gr.sig_source_c(sampling_freq, gr.GR_SIN_WAVE,
- sampling_freq * 0.10, 100)
+ src1 = analog.sig_source_c(sampling_freq, analog.GR_SIN_WAVE,
+ sampling_freq * 0.10, 100)
dst1 = gr.vector_sink_c()
head = gr.head(gr.sizeof_gr_complex, int(5*sampling_freq * 0.10))
@@ -294,9 +286,6 @@ class test_agc (gr_unittest.TestCase):
tb.connect(head, agc)
tb.connect(agc, dst1)
- if test_output == True:
- tb.connect(agc, gr.file_sink(gr.sizeof_gr_complex, "test_agc2_cc.dat"))
-
tb.run()
dst_data = dst1.data()
self.assertComplexTuplesAlmostEqual(expected_result, dst_data, 4)
@@ -373,8 +362,8 @@ class test_agc (gr_unittest.TestCase):
-0.61937344074249268)
sampling_freq = 100
- src1 = gr.sig_source_f(sampling_freq, gr.GR_SIN_WAVE,
- sampling_freq * 0.10, 100)
+ src1 = analog.sig_source_f(sampling_freq, analog.GR_SIN_WAVE,
+ sampling_freq * 0.10, 100)
dst1 = gr.vector_sink_f()
head = gr.head(gr.sizeof_float, int(5*sampling_freq * 0.10))
@@ -384,9 +373,6 @@ class test_agc (gr_unittest.TestCase):
tb.connect(head, agc)
tb.connect(agc, dst1)
- if test_output == True:
- tb.connect(agc, gr.file_sink(gr.sizeof_float, "test_agc2_ff.dat"))
-
tb.run()
dst_data = dst1.data()
self.assertFloatTuplesAlmostEqual(expected_result, dst_data, 4)
@@ -449,8 +435,8 @@ class test_agc (gr_unittest.TestCase):
(0.80901449918746948-0.5877833366394043j))
sampling_freq = 100
- src1 = gr.sig_source_c(sampling_freq, gr.GR_SIN_WAVE,
- sampling_freq * 0.10, 100)
+ src1 = analog.sig_source_c(sampling_freq, analog.GR_SIN_WAVE,
+ sampling_freq * 0.10, 100)
dst1 = gr.vector_sink_c()
head = gr.head(gr.sizeof_gr_complex, int(5*sampling_freq * 0.10))
@@ -460,9 +446,6 @@ class test_agc (gr_unittest.TestCase):
tb.connect(head, agc)
tb.connect(agc, dst1)
- if test_output == True:
- tb.connect(agc, gr.file_sink(gr.sizeof_gr_complex, "test_agc2_cc.dat"))
-
tb.run()
dst_data = dst1.data()
self.assertComplexTuplesAlmostEqual(expected_result, dst_data, 4)
@@ -481,10 +464,6 @@ class test_agc (gr_unittest.TestCase):
dst = gr.vector_sink_c()
self.tb.connect(src, agc, dst)
- if test_output == True:
- self.tb.connect(agc, gr.file_sink(gr.sizeof_gr_complex,
- "test_feedforward_cc.dat"))
-
self.tb.run()
dst_data = dst.data()[0:len(expected_result)]