def test_adaptive_fir_filter_ccf_002(self):
        decim = 4
        taps = 20*[0.5, 0.5]
        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_ccf("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_ccf_002(self):
        src_data = 40*[1+1j, 2+2j, 3+3j, 4+4j]
        expected_data = ((0.5+0.5j), (5.5+5.5j), (10.5+10.5j), (15.5+15.5j),
                         (20.5+20.5j), (25.5+25.5j), (30.5+30.5j), (35.5+35.5j),
                         (40.5+40.5j), (45.5+45.5j), (50+50j), (50+50j), (50+50j),
                         (50+50j), (50+50j), (50+50j), (50+50j), (50+50j), (50+50j),
                         (50+50j), (50+50j), (50+50j), (50+50j), (50+50j), (50+50j),
                         (50+50j), (50+50j), (50+50j), (50+50j), (50+50j), (50+50j),
                         (50+50j), (50+50j), (50+50j), (50+50j), (50+50j),
                         (50+50j), (50+50j), (50+50j), (50+50j))

        src = blocks.vector_source_c(src_data)
        op  = filter.adaptive_fir_ccf("test", 4, 20*[0.5, 0.5])
        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_ccf_001(self):
        src_data = 40*[1+1j, 2+2j, 3+3j, 4+4j]
        expected_data = ((0.5+0.5j), (1.5+1.5j), (3+3j), (5+5j), (5.5+5.5j),
                         (6.5+6.5j), (8+8j), (10+10j), (10.5+10.5j), (11.5+11.5j),
                         (13+13j), (15+15j), (15.5+15.5j), (16.5+16.5j), (18+18j),
                         (20+20j), (20.5+20.5j), (21.5+21.5j), (23+23j), (25+25j),
                         (25.5+25.5j), (26.5+26.5j), (28+28j), (30+30j), (30.5+30.5j),
                         (31.5+31.5j), (33+33j), (35+35j), (35.5+35.5j), (36.5+36.5j),
                         (38+38j), (40+40j), (40.5+40.5j), (41.5+41.5j), (43+43j),
                         (45+45j), (45.5+45.5j), (46.5+46.5j), (48+48j), (50+50j),
                         (50+50j), (50+50j), (50+50j), (50+50j), (50+50j), (50+50j),
                         (50+50j), (50+50j), (50+50j), (50+50j), (50+50j), (50+50j),
                         (50+50j), (50+50j), (50+50j), (50+50j), (50+50j), (50+50j),
                         (50+50j), (50+50j), (50+50j), (50+50j), (50+50j), (50+50j),
                         (50+50j), (50+50j), (50+50j), (50+50j), (50+50j), (50+50j),
                         (50+50j), (50+50j), (50+50j), (50+50j), (50+50j), (50+50j),
                         (50+50j), (50+50j), (50+50j), (50+50j), (50+50j), (50+50j),
                         (50+50j), (50+50j), (50+50j), (50+50j), (50+50j), (50+50j),
                         (50+50j), (50+50j), (50+50j), (50+50j), (50+50j), (50+50j),
                         (50+50j), (50+50j), (50+50j), (50+50j), (50+50j), (50+50j),
                         (50+50j), (50+50j), (50+50j), (50+50j), (50+50j), (50+50j),
                         (50+50j), (50+50j), (50+50j), (50+50j), (50+50j), (50+50j),
                         (50+50j), (50+50j), (50+50j), (50+50j), (50+50j), (50+50j),
                         (50+50j), (50+50j), (50+50j), (50+50j), (50+50j), (50+50j),
                         (50+50j), (50+50j), (50+50j), (50+50j), (50+50j), (50+50j),
                         (50+50j), (50+50j), (50+50j), (50+50j), (50+50j), (50+50j),
                         (50+50j), (50+50j), (50+50j), (50+50j), (50+50j), (50+50j),
                         (50+50j), (50+50j), (50+50j), (50+50j), (50+50j), (50+50j),
                         (50+50j), (50+50j), (50+50j), (50+50j), (50+50j), (50+50j),
                         (50+50j), (50+50j), (50+50j), (50+50j), (50+50j), (50+50j))

        src = blocks.vector_source_c(src_data)
        op  = filter.adaptive_fir_ccf("test", 1, 20*[0.5, 0.5])
        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)