#!/usr/bin/env python
#
-# Copyright 2005,2006 Free Software Foundation, Inc.
+# Copyright 2005,2006,2007,2010 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 2, or (at your option)
+# 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,
#
# 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., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
#
from gnuradio import gr, gr_unittest
class test_single_pole_iir_cc(gr_unittest.TestCase):
def setUp (self):
- self.fg = gr.flow_graph ()
+ self.tb = gr.top_block ()
def tearDown (self):
- self.fg = None
+ self.tb = None
def test_001(self):
src_data = (0+0j, 1000+1000j, 2000+2000j, 3000+3000j, 4000+4000j, 5000+5000j)
src = gr.vector_source_c(src_data)
op = gr.single_pole_iir_filter_cc (1.0)
dst = gr.vector_sink_c()
- self.fg.connect (src, op, dst)
- self.fg.run()
+ self.tb.connect (src, op, dst)
+ self.tb.run()
result_data = dst.data()
self.assertComplexTuplesAlmostEqual (expected_result, result_data)
src = gr.vector_source_c(src_data)
op = gr.single_pole_iir_filter_cc (0.125)
dst = gr.vector_sink_c()
- self.fg.connect (src, op, dst)
- self.fg.run()
+ self.tb.connect (src, op, dst)
+ self.tb.run()
result_data = dst.data()
self.assertComplexTuplesAlmostEqual (expected_result, result_data, 3)
op = gr.single_pole_iir_filter_cc (0.125, block_size)
p2s = gr.parallel_to_serial(gr.sizeof_gr_complex, block_size)
dst = gr.vector_sink_c()
- self.fg.connect (src, s2p, op, p2s, dst)
- self.fg.run()
+ self.tb.connect (src, s2p, op, p2s, dst)
+ self.tb.run()
result_data = dst.data()
self.assertComplexTuplesAlmostEqual (expected_result, result_data, 3)
if __name__ == '__main__':
- gr_unittest.main ()
+ gr_unittest.run(test_single_pole_iir_cc, "test_single_pole_iir_cc.xml")