commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r3642 - gnuradio/branches/developers/eb/digital-wip/gn


From: eb
Subject: [Commit-gnuradio] r3642 - gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/python/gnuradio/gr
Date: Mon, 25 Sep 2006 15:14:08 -0600 (MDT)

Author: eb
Date: 2006-09-25 15:14:07 -0600 (Mon, 25 Sep 2006)
New Revision: 3642

Modified:
   
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/python/gnuradio/gr/qa_agc.py
Log:
additional agc test code work-in-progress

Modified: 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/python/gnuradio/gr/qa_agc.py
===================================================================
--- 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/python/gnuradio/gr/qa_agc.py
  2006-09-25 21:11:44 UTC (rev 3641)
+++ 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/python/gnuradio/gr/qa_agc.py
  2006-09-25 21:14:07 UTC (rev 3642)
@@ -335,5 +335,99 @@
         self.assertFloatTuplesAlmostEqual (expected_result, dst_data, 4)
 
 
+    def test_005(self):
+        ''' Test the complex AGC loop (attack and decay rate inputs) '''
+        fg = self.fg
+
+        expected_result = \
+                        ((100.000244140625+7.2191943445432116e-07j),
+                         (0.80881959199905396+0.58764183521270752j),
+                         (0.30894950032234192+0.95084899663925171j),
+                         (-0.30895623564720154+0.95086973905563354j),
+                         (-0.80887287855148315+0.58768033981323242j),
+                         (-0.99984413385391235+5.850709250410091e-09j),
+                         (-0.80889981985092163-0.58770018815994263j),
+                         (-0.30897706747055054-0.95093393325805664j),
+                         (0.30898112058639526-0.95094609260559082j),
+                         (0.80893135070800781-0.58772283792495728j),
+                         (0.99990922212600708-8.7766354184282136e-09j),
+                         (0.80894720554351807+0.58773452043533325j),
+                         (0.30899339914321899+0.95098406076431274j),
+                         (-0.30899572372436523+0.95099133253097534j),
+                         (-0.80896598100662231+0.58774799108505249j),
+                         (-0.99994778633117676+1.4628290578855285e-08j),
+                         (-0.80897533893585205-0.58775502443313599j),
+                         (-0.30900305509567261-0.95101380348205566j),
+                         (0.30900448560714722-0.95101797580718994j),
+                         (0.80898630619049072-0.58776277303695679j),
+                         (0.99997037649154663-1.7554345532744264e-08j),
+                         (0.80899184942245483+0.58776694536209106j),
+                         (0.30900871753692627+0.95103120803833008j),
+                         (-0.30900952219963074+0.95103377103805542j),
+                         (-0.8089984655380249+0.58777159452438354j),
+                         (-0.99998390674591064+2.3406109050938539e-08j),
+                         (-0.809001624584198-0.58777409791946411j),
+                         (-0.30901208519935608-0.95104163885116577j),
+                         (0.30901262164115906-0.95104306936264038j),
+                         (0.80900543928146362-0.587776780128479j),
+                         (0.99999171495437622-2.6332081404234486e-08j),
+                         (0.80900734663009644+0.58777821063995361j),
+                         (0.30901408195495605+0.95104765892028809j),
+                         (-0.30901429057121277+0.95104855298995972j),
+                         (-0.80900967121124268+0.58777981996536255j),
+                         (-0.99999648332595825+3.2183805842578295e-08j),
+                         (-0.80901080369949341-0.58778077363967896j),
+                         (-0.30901527404785156-0.95105135440826416j),
+                         (0.30901545286178589-0.95105189085006714j),
+                         (0.80901217460632324-0.58778166770935059j),
+                         (0.99999916553497314-3.5109700036173308e-08j),
+                         (0.809012770652771+0.58778214454650879j),
+                         (0.30901595950126648+0.9510534405708313j),
+                         (-0.30901598930358887+0.95105385780334473j),
+                         (-0.80901366472244263+0.58778274059295654j),
+                         (-1.0000008344650269+4.0961388947380328e-08j),
+                         (-0.8090139627456665-0.58778303861618042j),
+                         (-0.30901634693145752-0.95105475187301636j),
+                         (0.30901640653610229-0.95105493068695068j),
+                         (0.80901449918746948-0.5877833366394043j))
+
+        sampling_freq = 100
+        src1 = gr.sig_source_c (sampling_freq, gr.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))
+
+        agc = gr.agc2_cc(1e-2, 1e-3, 1, 1, 1000)
+        
+        fg.connect (src1, head)
+        fg.connect (head, agc)
+        fg.connect (agc, dst1)
+
+        if test_output == True:
+            fg.connect (agc, gr.file_sink(gr.sizeof_gr_complex, 
"test_agc2_cc.dat"))
+
+        fg.run ()
+        dst_data = dst1.data ()
+        self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 4)
+
+
+    def test_100(self):        # FIXME needs work
+        ''' Test complex feedforward agc with constant input '''
+        input_data = 16*(0.0,) + 64*(1.0,) + 64*(0.0,)
+        expected_result = ()
+
+        src = gr.vector_source_c(input_data)
+        agc = gr.feedforward_agc_cc(16, 2.0)
+        dst = gr.vector_sink_c ()
+        self.fg.connect (src, agc, dst)
+
+        if test_output == True:
+            self.fg.connect (agc, gr.file_sink(gr.sizeof_gr_complex, 
"test_feedforward_cc.dat"))
+
+        self.fg.run ()
+        dst_data = dst.data ()
+        #self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 4)
+
+
 if __name__ == '__main__':
     gr_unittest.main ()





reply via email to

[Prev in Thread] Current Thread [Next in Thread]