Ejemplo n.º 1
0
    def test_002(self):
        ''' Test impulse response - short form, cc '''
        src_data = [1,] + 100*[0,]
        expected_result = ((-0.029296875+0j), (-0.0302734375+0j),
                           (0.96875+0j), (-0.0302734375+0j),
                           (-0.029296875+0j))

        src = blocks.vector_source_c(src_data)
        op = filter.dc_blocker_cc(32, False)
        dst = blocks.vector_sink_c()

        self.tb.connect (src, op, dst)
        self.tb.run()

        # only test samples around D-1
        result_data = dst.data()[29:34]
        self.assertComplexTuplesAlmostEqual (expected_result, result_data)
Ejemplo n.º 2
0
    def test_001(self):
        ''' Test impulse response - long form, cc '''
        src_data = [1,] + 100*[0,]
        expected_result = ((-0.02072429656982422+0j), (-0.02081298828125+0j),
                           (0.979156494140625+0j), (-0.02081298828125+0j),
                           (-0.02072429656982422+0j))

        src = blocks.vector_source_c(src_data)
        op = filter.dc_blocker_cc(32, True)
        dst = blocks.vector_sink_c()

        self.tb.connect (src, op, dst)
        self.tb.run()

        # only test samples around 2D-2
        result_data = dst.data()[60:65]
        self.assertComplexTuplesAlmostEqual (expected_result, result_data)
Ejemplo n.º 3
0
    def test_002(self):
        ''' Test impulse response - short form, cc '''
        src_data = [
            1,
        ] + 100 * [
            0,
        ]
        expected_result = ((-0.029296875 + 0j), (-0.0302734375 + 0j),
                           (0.96875 + 0j), (-0.0302734375 + 0j),
                           (-0.029296875 + 0j))

        src = blocks.vector_source_c(src_data)
        op = filter.dc_blocker_cc(32, False)
        dst = blocks.vector_sink_c()

        self.tb.connect(src, op, dst)
        self.tb.run()

        # only test samples around D-1
        result_data = dst.data()[29:34]
        self.assertComplexTuplesAlmostEqual(expected_result, result_data)
Ejemplo n.º 4
0
    def test_001(self):
        ''' Test impulse response - long form, cc '''
        src_data = [
            1,
        ] + 100 * [
            0,
        ]
        expected_result = ((-0.02072429656982422 + 0j),
                           (-0.02081298828125 + 0j), (0.979156494140625 + 0j),
                           (-0.02081298828125 + 0j),
                           (-0.02072429656982422 + 0j))

        src = blocks.vector_source_c(src_data)
        op = filter.dc_blocker_cc(32, True)
        dst = blocks.vector_sink_c()

        self.tb.connect(src, op, dst)
        self.tb.run()

        # only test samples around 2D-2
        result_data = dst.data()[60:65]
        self.assertComplexTuplesAlmostEqual(expected_result, result_data)