def test_001_codeallr2m3 (self):
        """ Check Golay-SD-decoding m=3 for all possible inputs """

	src_data = (	0.648,0.680,0.636,0.946,0.209,0.710,0.237,0.120,
			0.608,0.451,0.459,0.662,0.771,0.351,0.663,0.417,
			0.842,0.833,0.257,0.614,0.583,0.541,0.870,0.265,
			0.319,0.120,0.940,0.646,0.480,0.640,0.545,0.648,
			0.544,0.722,0.523,0.994,0.219,0.106,0.110,0.064)
	expected_data = (	6,
				0,
				14,
				1,
				22)
        src1 = gr.vector_source_f(src_data,0,8)
        coding_action = chancoding.rmg_decoder_sd_vfi(3,1)
        sink = gr.vector_sink_i()

        self.tb.connect(src1, coding_action)
        self.tb.connect(coding_action, sink)
        self.tb.run()

        self.assertEqual( coding_action.get_vlen_in(), 8)
        self.assertEqual( coding_action.get_vlen_out(), 1)
        self.assertEqual( coding_action.get_num_bits_out(), 5)

	for i in range( len(expected_data) ):
        	self.assertEqual( sink.data()[i] , expected_data[i], i)
Example #2
0
    def test_002_codem5(self):
        """ Check Golay-SD-decoding m5 for 5 possible inputs """

        expected_data = (1360, 1481, 990, 1522, 1604)
        src_data = (0.395, 0.737, 0.360, 0.688, 0.443, 0.243, 0.755, 0.045,
                    0.263, 0.587, 0.150, 0.348, 0.521, 0.742, 0.672, 0.394,
                    0.485, 0.862, 0.531, 0.526, 0.094, 0.697, 0.139, 0.193,
                    0.973, 0.933, 0.772, 0.628, 0.764, 0.366, 0.449, 0.405,
                    0.155, 0.589, 0.885, 0.515, 0.990, 0.862, 0.168, 0.769,
                    0.834, 0.439, 0.672, 0.328, 0.950, 0.791, 0.217, 0.378,
                    0.756, 0.809, 0.397, 0.770, 0.392, 0.888, 0.430, 0.822,
                    0.198, 0.271, 0.425, 0.331, 0.020, 0.443, 0.705, 0.684,
                    0.228, 0.802, 0.480, 0.528, 0.990, 0.613, 0.866, 0.001,
                    0.989, 0.880, 0.816, 0.583, 0.697, 0.930, 0.561, 0.851,
                    0.055, 0.148, 0.496, 0.190, 0.496, 0.679, 0.137, 0.112,
                    0.090, 0.535, 0.319, 0.790, 0.826, 0.749, 0.407, 0.200,
                    0.193, 0.490, 0.050, 0.363, 0.615, 0.032, 0.630, 0.553,
                    0.210, 0.845, 0.485, 0.863, 0.121, 0.017, 0.581, 0.929,
                    0.582, 0.770, 0.983, 0.891, 0.730, 0.661, 0.626, 0.084,
                    0.667, 0.247, 0.586, 0.739, 0.846, 0.575, 0.901, 0.499,
                    0.729, 0.932, 0.053, 0.574, 0.621, 0.167, 0.143, 0.106,
                    0.083, 0.948, 0.206, 0.418, 0.641, 0.565, 0.209, 0.271,
                    0.874, 0.853, 0.491, 0.124, 0.446, 0.536, 0.500, 0.696,
                    0.539, 0.282, 0.636, 0.043, 0.190, 0.147, 0.206, 0.124)
        src1 = gr.vector_source_f(src_data, 0, 32)
        coding_action = chancoding.rmg_decoder_sd_vfi(5, 5)
        sink = gr.vector_sink_i()

        self.tb.connect(src1, coding_action)
        self.tb.connect(coding_action, sink)
        self.tb.run()

        for i in range(len(expected_data)):
            self.assertEqual(sink.data()[i], expected_data[i])
    def test_002_codem5 (self):
        """ Check Golay-SD-decoding m5 for 5 possible inputs """

	expected_data = (	1360,
				1481,
				990,
				1522,
				1604)
	src_data = (	0.395,0.737,0.360,0.688,0.443,0.243,0.755,0.045,0.263,0.587,0.150,0.348,0.521,0.742,0.672,0.394,0.485,0.862,0.531,0.526,0.094,0.697,0.139,0.193,0.973,0.933,0.772,0.628,0.764,0.366,0.449,0.405,
			0.155,0.589,0.885,0.515,0.990,0.862,0.168,0.769,0.834,0.439,0.672,0.328,0.950,0.791,0.217,0.378,0.756,0.809,0.397,0.770,0.392,0.888,0.430,0.822,0.198,0.271,0.425,0.331,0.020,0.443,0.705,0.684,
			0.228,0.802,0.480,0.528,0.990,0.613,0.866,0.001,0.989,0.880,0.816,0.583,0.697,0.930,0.561,0.851,0.055,0.148,0.496,0.190,0.496,0.679,0.137,0.112,0.090,0.535,0.319,0.790,0.826,0.749,0.407,0.200,
			0.193,0.490,0.050,0.363,0.615,0.032,0.630,0.553,0.210,0.845,0.485,0.863,0.121,0.017,0.581,0.929,0.582,0.770,0.983,0.891,0.730,0.661,0.626,0.084,0.667,0.247,0.586,0.739,0.846,0.575,0.901,0.499,
			0.729,0.932,0.053,0.574,0.621,0.167,0.143,0.106,0.083,0.948,0.206,0.418,0.641,0.565,0.209,0.271,0.874,0.853,0.491,0.124,0.446,0.536,0.500,0.696,0.539,0.282,0.636,0.043,0.190,0.147,0.206,0.124)
        src1 = gr.vector_source_f(src_data,0,32)
        coding_action = chancoding.rmg_decoder_sd_vfi(5,5)
        sink = gr.vector_sink_i()

        self.tb.connect(src1, coding_action)
        self.tb.connect(coding_action, sink)
        self.tb.run()

	for i in range( len(expected_data) ):
        	self.assertEqual( sink.data()[i] , expected_data[i])
Example #4
0
    def test_001_codeallr2m3(self):
        """ Check Golay-SD-decoding m=3 for all possible inputs """

        src_data = (0.648, 0.680, 0.636, 0.946, 0.209, 0.710, 0.237, 0.120,
                    0.608, 0.451, 0.459, 0.662, 0.771, 0.351, 0.663, 0.417,
                    0.842, 0.833, 0.257, 0.614, 0.583, 0.541, 0.870, 0.265,
                    0.319, 0.120, 0.940, 0.646, 0.480, 0.640, 0.545, 0.648,
                    0.544, 0.722, 0.523, 0.994, 0.219, 0.106, 0.110, 0.064)
        expected_data = (6, 0, 14, 1, 22)
        src1 = gr.vector_source_f(src_data, 0, 8)
        coding_action = chancoding.rmg_decoder_sd_vfi(3, 1)
        sink = gr.vector_sink_i()

        self.tb.connect(src1, coding_action)
        self.tb.connect(coding_action, sink)
        self.tb.run()

        self.assertEqual(coding_action.get_vlen_in(), 8)
        self.assertEqual(coding_action.get_vlen_out(), 1)
        self.assertEqual(coding_action.get_num_bits_out(), 5)

        for i in range(len(expected_data)):
            self.assertEqual(sink.data()[i], expected_data[i], i)
    def test_003_codem7 (self):
        """ Check Golay-SD-decoding m=7 for 5 possible inputs """

	src_data = ( 0.654,0.329,0.641,0.118,0.111,0.723,0.133,0.684,0.944,0.799,0.089,0.073,0.052,0.735,0.799,0.891,0.486,0.550,0.128,0.105,0.742,0.608,0.338,0.781,0.062,0.397,0.557,0.693,0.288,0.782,0.708,0.730,0.527,0.604,0.668,0.049,0.011,0.747,0.294,0.339,0.826,0.110,0.534,0.906,0.778,0.081,0.090,0.632,0.762,0.506,0.047,0.299,0.063,0.298,0.333,0.996,0.102,0.457,0.308,0.094,0.197,0.898,0.014,0.442,0.054,0.243,0.072,0.895,0.213,0.135,0.300,0.598,0.185,0.562,0.737,0.746,0.105,0.913,0.469,0.676,0.906,0.209,0.176,0.336,0.522,0.057,0.360,0.179,0.101,0.819,0.764,0.465,0.415,0.288,1.000,0.707,0.540,0.989,0.119,0.899,0.331,0.663,0.178,0.055,0.447,0.348,0.855,0.560,0.843,0.026,0.649,0.468,0.333,0.296,0.302,0.940,0.031,0.134,0.399,0.178,0.514,0.786,0.859,0.985,0.935,0.861,0.064,0.738,
0.957,0.654,0.318,0.291,0.025,0.125,0.430,0.425,0.743,0.559,0.360,0.423,0.453,0.300,0.336,0.598,0.833,0.531,0.295,0.686,0.351,0.872,0.759,0.162,0.382,0.155,0.621,0.403,0.983,0.403,0.685,0.074,0.397,0.258,0.171,0.988,0.623,0.167,0.314,0.558,0.707,0.914,0.078,0.213,0.185,0.556,0.704,0.893,0.252,0.218,0.317,0.318,0.197,0.169,0.143,0.099,0.135,0.127,0.632,0.109,0.532,0.723,0.656,0.424,0.008,0.093,0.131,0.126,0.697,0.773,0.316,0.060,0.610,0.452,0.430,0.674,0.038,0.273,0.397,0.769,0.488,0.798,0.267,0.188,0.934,0.110,0.656,0.433,0.759,0.695,0.433,0.965,0.604,0.292,0.785,0.113,0.105,0.406,0.092,0.531,0.238,0.295,0.101,0.782,0.152,0.485,0.642,0.229,0.552,0.389,0.206,0.772,0.087,0.207,0.368,0.790,0.598,0.686,0.370,0.367,0.087,0.867,0.971,0.735,0.235,0.741,0.584,0.750,
0.042,0.183,0.218,0.138,0.626,0.900,0.886,0.535,0.784,0.684,0.019,0.940,0.067,0.990,0.803,0.088,0.536,0.030,0.987,0.805,0.228,0.452,0.249,0.276,0.531,0.576,0.618,0.384,0.814,0.746,0.801,0.911,0.022,0.628,0.384,0.661,0.348,0.724,0.046,0.181,0.641,0.088,0.374,0.224,0.925,0.266,0.958,0.177,0.572,0.735,0.842,0.371,0.726,0.185,0.422,0.026,0.143,0.388,0.605,0.653,0.225,0.998,0.356,0.632,0.867,0.061,0.444,0.951,0.636,0.506,0.853,0.790,0.815,0.318,0.817,0.391,0.420,0.643,0.716,0.672,0.768,0.065,0.229,0.752,0.258,0.441,0.578,0.795,0.922,0.164,0.933,0.654,0.924,0.021,0.256,0.181,0.416,0.399,0.547,0.326,0.526,0.121,0.749,0.810,0.037,0.680,0.541,0.954,0.154,0.703,0.517,0.895,0.666,0.164,0.176,0.824,0.099,0.213,0.464,0.682,0.106,0.744,0.741,0.760,0.764,0.241,0.458,0.936,
0.857,0.716,0.241,0.452,0.349,0.048,0.661,0.591,0.625,0.712,0.231,0.282,0.663,0.357,0.032,0.955,0.740,0.838,0.328,0.973,0.695,0.493,0.414,0.757,0.361,0.620,0.331,0.550,0.980,0.553,0.323,0.836,0.750,0.399,0.834,0.647,0.731,0.125,0.937,0.344,0.619,0.714,0.918,0.928,0.391,0.138,0.895,0.486,0.812,0.998,0.432,0.502,0.055,0.391,0.102,0.629,0.907,0.511,0.211,0.339,0.179,0.312,0.773,0.558,0.045,0.100,0.896,0.194,0.490,0.100,0.183,0.108,0.935,0.767,0.830,0.178,0.237,0.624,0.478,0.674,0.270,0.225,0.730,0.705,0.379,0.043,0.771,0.923,0.844,0.010,0.694,0.783,0.727,0.309,0.126,0.218,0.414,0.455,0.887,0.347,0.972,0.355,0.997,0.720,0.083,0.512,0.584,0.552,0.584,0.751,0.603,0.412,0.528,0.681,0.296,0.245,0.663,0.337,0.767,0.989,0.677,0.946,0.985,0.411,0.355,0.940,0.617,0.107,
0.900,0.149,0.599,0.559,0.914,0.883,0.785,0.247,0.455,0.389,0.865,0.988,0.972,0.418,0.757,0.485,0.811,0.934,0.667,0.407,0.073,0.654,0.207,0.669,0.934,0.873,0.594,0.373,0.850,0.830,0.938,0.373,0.522,0.647,0.447,0.026,0.577,0.729,0.550,0.944,0.885,0.598,0.897,0.801,0.287,0.981,0.940,0.301,0.560,0.022,0.134,0.669,0.781,0.789,0.363,0.476,0.139,0.308,0.647,0.504,0.750,0.270,0.561,0.471,0.434,0.839,0.716,0.985,0.544,0.286,0.801,0.923,0.071,0.583,0.878,0.722,0.721,0.196,0.047,0.304,0.055,0.894,0.687,0.545,0.795,0.736,0.343,0.048,0.400,0.931,0.095,0.885,0.122,0.349,0.153,0.332,0.258,0.269,0.123,0.404,0.232,0.652,0.975,0.084,0.020,0.812,0.621,0.362,0.676,0.587,0.668,0.190,0.973,0.043,0.964,0.450,0.354,0.878,0.490,0.504,0.807,0.367,0.589,0.139,0.837,0.138,0.732,0.282
)
	expected_data = (	461883,
				144744,
				135175,
				261846,
				284672)
        src1 = gr.vector_source_f(src_data,0,128)
        coding_action = chancoding.rmg_decoder_sd_vfi(7,11)
        sink = gr.vector_sink_i()

        self.tb.connect(src1, coding_action)
        self.tb.connect(coding_action, sink)
        self.tb.run()

	for i in range( len(expected_data) ):
        	self.assertEqual( sink.data()[i] , expected_data[i])
Example #6
0
    def test_003_codem7(self):
        """ Check Golay-SD-decoding m=7 for 5 possible inputs """

        src_data = (
            0.654, 0.329, 0.641, 0.118, 0.111, 0.723, 0.133, 0.684, 0.944,
            0.799, 0.089, 0.073, 0.052, 0.735, 0.799, 0.891, 0.486, 0.550,
            0.128, 0.105, 0.742, 0.608, 0.338, 0.781, 0.062, 0.397, 0.557,
            0.693, 0.288, 0.782, 0.708, 0.730, 0.527, 0.604, 0.668, 0.049,
            0.011, 0.747, 0.294, 0.339, 0.826, 0.110, 0.534, 0.906, 0.778,
            0.081, 0.090, 0.632, 0.762, 0.506, 0.047, 0.299, 0.063, 0.298,
            0.333, 0.996, 0.102, 0.457, 0.308, 0.094, 0.197, 0.898, 0.014,
            0.442, 0.054, 0.243, 0.072, 0.895, 0.213, 0.135, 0.300, 0.598,
            0.185, 0.562, 0.737, 0.746, 0.105, 0.913, 0.469, 0.676, 0.906,
            0.209, 0.176, 0.336, 0.522, 0.057, 0.360, 0.179, 0.101, 0.819,
            0.764, 0.465, 0.415, 0.288, 1.000, 0.707, 0.540, 0.989, 0.119,
            0.899, 0.331, 0.663, 0.178, 0.055, 0.447, 0.348, 0.855, 0.560,
            0.843, 0.026, 0.649, 0.468, 0.333, 0.296, 0.302, 0.940, 0.031,
            0.134, 0.399, 0.178, 0.514, 0.786, 0.859, 0.985, 0.935, 0.861,
            0.064, 0.738, 0.957, 0.654, 0.318, 0.291, 0.025, 0.125, 0.430,
            0.425, 0.743, 0.559, 0.360, 0.423, 0.453, 0.300, 0.336, 0.598,
            0.833, 0.531, 0.295, 0.686, 0.351, 0.872, 0.759, 0.162, 0.382,
            0.155, 0.621, 0.403, 0.983, 0.403, 0.685, 0.074, 0.397, 0.258,
            0.171, 0.988, 0.623, 0.167, 0.314, 0.558, 0.707, 0.914, 0.078,
            0.213, 0.185, 0.556, 0.704, 0.893, 0.252, 0.218, 0.317, 0.318,
            0.197, 0.169, 0.143, 0.099, 0.135, 0.127, 0.632, 0.109, 0.532,
            0.723, 0.656, 0.424, 0.008, 0.093, 0.131, 0.126, 0.697, 0.773,
            0.316, 0.060, 0.610, 0.452, 0.430, 0.674, 0.038, 0.273, 0.397,
            0.769, 0.488, 0.798, 0.267, 0.188, 0.934, 0.110, 0.656, 0.433,
            0.759, 0.695, 0.433, 0.965, 0.604, 0.292, 0.785, 0.113, 0.105,
            0.406, 0.092, 0.531, 0.238, 0.295, 0.101, 0.782, 0.152, 0.485,
            0.642, 0.229, 0.552, 0.389, 0.206, 0.772, 0.087, 0.207, 0.368,
            0.790, 0.598, 0.686, 0.370, 0.367, 0.087, 0.867, 0.971, 0.735,
            0.235, 0.741, 0.584, 0.750, 0.042, 0.183, 0.218, 0.138, 0.626,
            0.900, 0.886, 0.535, 0.784, 0.684, 0.019, 0.940, 0.067, 0.990,
            0.803, 0.088, 0.536, 0.030, 0.987, 0.805, 0.228, 0.452, 0.249,
            0.276, 0.531, 0.576, 0.618, 0.384, 0.814, 0.746, 0.801, 0.911,
            0.022, 0.628, 0.384, 0.661, 0.348, 0.724, 0.046, 0.181, 0.641,
            0.088, 0.374, 0.224, 0.925, 0.266, 0.958, 0.177, 0.572, 0.735,
            0.842, 0.371, 0.726, 0.185, 0.422, 0.026, 0.143, 0.388, 0.605,
            0.653, 0.225, 0.998, 0.356, 0.632, 0.867, 0.061, 0.444, 0.951,
            0.636, 0.506, 0.853, 0.790, 0.815, 0.318, 0.817, 0.391, 0.420,
            0.643, 0.716, 0.672, 0.768, 0.065, 0.229, 0.752, 0.258, 0.441,
            0.578, 0.795, 0.922, 0.164, 0.933, 0.654, 0.924, 0.021, 0.256,
            0.181, 0.416, 0.399, 0.547, 0.326, 0.526, 0.121, 0.749, 0.810,
            0.037, 0.680, 0.541, 0.954, 0.154, 0.703, 0.517, 0.895, 0.666,
            0.164, 0.176, 0.824, 0.099, 0.213, 0.464, 0.682, 0.106, 0.744,
            0.741, 0.760, 0.764, 0.241, 0.458, 0.936, 0.857, 0.716, 0.241,
            0.452, 0.349, 0.048, 0.661, 0.591, 0.625, 0.712, 0.231, 0.282,
            0.663, 0.357, 0.032, 0.955, 0.740, 0.838, 0.328, 0.973, 0.695,
            0.493, 0.414, 0.757, 0.361, 0.620, 0.331, 0.550, 0.980, 0.553,
            0.323, 0.836, 0.750, 0.399, 0.834, 0.647, 0.731, 0.125, 0.937,
            0.344, 0.619, 0.714, 0.918, 0.928, 0.391, 0.138, 0.895, 0.486,
            0.812, 0.998, 0.432, 0.502, 0.055, 0.391, 0.102, 0.629, 0.907,
            0.511, 0.211, 0.339, 0.179, 0.312, 0.773, 0.558, 0.045, 0.100,
            0.896, 0.194, 0.490, 0.100, 0.183, 0.108, 0.935, 0.767, 0.830,
            0.178, 0.237, 0.624, 0.478, 0.674, 0.270, 0.225, 0.730, 0.705,
            0.379, 0.043, 0.771, 0.923, 0.844, 0.010, 0.694, 0.783, 0.727,
            0.309, 0.126, 0.218, 0.414, 0.455, 0.887, 0.347, 0.972, 0.355,
            0.997, 0.720, 0.083, 0.512, 0.584, 0.552, 0.584, 0.751, 0.603,
            0.412, 0.528, 0.681, 0.296, 0.245, 0.663, 0.337, 0.767, 0.989,
            0.677, 0.946, 0.985, 0.411, 0.355, 0.940, 0.617, 0.107, 0.900,
            0.149, 0.599, 0.559, 0.914, 0.883, 0.785, 0.247, 0.455, 0.389,
            0.865, 0.988, 0.972, 0.418, 0.757, 0.485, 0.811, 0.934, 0.667,
            0.407, 0.073, 0.654, 0.207, 0.669, 0.934, 0.873, 0.594, 0.373,
            0.850, 0.830, 0.938, 0.373, 0.522, 0.647, 0.447, 0.026, 0.577,
            0.729, 0.550, 0.944, 0.885, 0.598, 0.897, 0.801, 0.287, 0.981,
            0.940, 0.301, 0.560, 0.022, 0.134, 0.669, 0.781, 0.789, 0.363,
            0.476, 0.139, 0.308, 0.647, 0.504, 0.750, 0.270, 0.561, 0.471,
            0.434, 0.839, 0.716, 0.985, 0.544, 0.286, 0.801, 0.923, 0.071,
            0.583, 0.878, 0.722, 0.721, 0.196, 0.047, 0.304, 0.055, 0.894,
            0.687, 0.545, 0.795, 0.736, 0.343, 0.048, 0.400, 0.931, 0.095,
            0.885, 0.122, 0.349, 0.153, 0.332, 0.258, 0.269, 0.123, 0.404,
            0.232, 0.652, 0.975, 0.084, 0.020, 0.812, 0.621, 0.362, 0.676,
            0.587, 0.668, 0.190, 0.973, 0.043, 0.964, 0.450, 0.354, 0.878,
            0.490, 0.504, 0.807, 0.367, 0.589, 0.139, 0.837, 0.138, 0.732,
            0.282)
        expected_data = (461883, 144744, 135175, 261846, 284672)
        src1 = gr.vector_source_f(src_data, 0, 128)
        coding_action = chancoding.rmg_decoder_sd_vfi(7, 11)
        sink = gr.vector_sink_i()

        self.tb.connect(src1, coding_action)
        self.tb.connect(coding_action, sink)
        self.tb.run()

        for i in range(len(expected_data)):
            self.assertEqual(sink.data()[i], expected_data[i])