def test_adaptive_fir_filter_ccc_002(self):
        decim = 4
        taps = 20*[0.5+1j, 0.5+1j]
        src_data = 40*[1+1j, 2+2j, 3+3j, 4+4j]
        expected_data = fir_filter(src_data, taps, decim)

        src = blocks.vector_source_c(src_data)
        op  = filter.adaptive_fir_ccc("test", decim, taps)
        dst = blocks.vector_sink_c()
        self.tb.connect(src, op, dst)
        self.tb.run()
        result_data = dst.data()
        self.assertComplexTuplesAlmostEqual(expected_data, result_data, 5)
 def test_adaptive_fir_filter_ccc_001(self):
     src_data = 40*[1+1j, 2+2j, 3+3j, 4+4j]
     expected_data = ((-0.5+1.5j), (-1.5+4.5j), (-3+9j), (-5+15j),
                      (-5.5+16.5j), (-6.5+19.5j), (-8+24j), (-10+30j),
                      (-10.5+31.5j), (-11.5+34.5j), (-13+39j), (-15+45j),
                      (-15.5+46.5j), (-16.5+49.5j), (-18+54j), (-20+60j),
                      (-20.5+61.5j), (-21.5+64.5j), (-23+69j), (-25+75j),
                      (-25.5+76.5j), (-26.5+79.5j), (-28+84j), (-30+90j),
                      (-30.5+91.5j), (-31.5+94.5j), (-33+99j), (-35+105j),
                      (-35.5+106.5j), (-36.5+109.5j), (-38+114j), (-40+120j),
                      (-40.5+121.5j), (-41.5+124.5j), (-43+129j), (-45+135j),
                      (-45.5+136.5j), (-46.5+139.5j), (-48+144j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j), (-50+150j))
     src = blocks.vector_source_c(src_data)
     op  = filter.adaptive_fir_ccc("test", 1, 20*[0.5+1j, 0.5+1j])
     dst = blocks.vector_sink_c()
     self.tb.connect(src, op, dst)
     self.tb.run()
     result_data = dst.data()
     self.assertComplexTuplesAlmostEqual(expected_data, result_data, 5)
 def test_adaptive_fir_filter_ccc_002(self):
     src_data = 40*[1+1j, 2+2j, 3+3j, 4+4j]
     expected_data = ((-0.5+1.5j), (-5.5+16.5j), (-10.5+31.5j),
                      (-15.5+46.5j), (-20.5+61.5j), (-25.5+76.5j),
                      (-30.5+91.5j), (-35.5+106.5j), (-40.5+121.5j),
                      (-45.5+136.5j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j), (-50+150j),
                      (-50+150j), (-50+150j), (-50+150j))
     src = blocks.vector_source_c(src_data)
     op  = filter.adaptive_fir_ccc("test", 4, 20*[0.5+1j, 0.5+1j])
     dst = blocks.vector_sink_c()
     self.tb.connect(src, op, dst)
     self.tb.run()
     result_data = dst.data()
     self.assertComplexTuplesAlmostEqual(expected_data, result_data, 5)