Exemplo n.º 1
0
    def __init__(self, bitrate,
                 constellation, samples_per_symbol,
                 differential, excess_bw, gray_coded,
                 freq_bw, timing_bw, phase_bw,
                 verbose, log):

        gr.hier_block2.__init__(self, "bert_receive",
                                gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
                                gr.io_signature(0, 0, 0))                    # Output signature
        
        self._bitrate = bitrate

        self._demod = digital.generic_demod(constellation, differential, 
                                            samples_per_symbol,
                                            gray_coded, excess_bw,
                                            freq_bw, timing_bw, phase_bw,
                                            verbose, log)

        self._symbol_rate = self._bitrate / self._demod.bits_per_symbol()
        self._sample_rate = self._symbol_rate * samples_per_symbol

        # Add an SNR probe on the demodulated constellation
        self._snr_probe = digital.probe_mpsk_snr_est_c(digital.SNR_EST_M2M4, 1000,
                                                       alpha=10.0/self._symbol_rate)
        self.connect(self._demod.time_recov, self._snr_probe)
        
        # Descramble BERT sequence.  A channel error will create 3 incorrect bits
        self._descrambler = digital.descrambler_bb(0x8A, 0x7F, 7) # CCSDS 7-bit descrambler

        # Measure BER by the density of 0s in the stream
        self._ber = digital.probe_density_b(1.0/self._symbol_rate)
        
        self.connect(self, self._demod, self._descrambler, self._ber)
Exemplo n.º 2
0
    def __init__(self, bitrate, constellation, samples_per_symbol,
                 differential, excess_bw, gray_coded, freq_bw, timing_bw,
                 phase_bw, verbose, log):

        gr.hier_block2.__init__(
            self,
            "bert_receive",
            gr.io_signature(1, 1, gr.sizeof_gr_complex),  # Input signature
            gr.io_signature(0, 0, 0))  # Output signature

        self._bitrate = bitrate

        self._demod = digital.generic_demod(constellation, differential,
                                            samples_per_symbol, gray_coded,
                                            excess_bw, freq_bw, timing_bw,
                                            phase_bw, verbose, log)

        self._symbol_rate = self._bitrate / self._demod.bits_per_symbol()
        self._sample_rate = self._symbol_rate * samples_per_symbol

        # Add an SNR probe on the demodulated constellation
        self._snr_probe = digital.probe_mpsk_snr_est_c(digital.SNR_EST_M2M4,
                                                       1000,
                                                       alpha=10.0 /
                                                       self._symbol_rate)
        self.connect(self._demod.time_recov, self._snr_probe)

        # Descramble BERT sequence.  A channel error will create 3 incorrect bits
        self._descrambler = digital.descrambler_bb(
            0x8A, 0x7F, 7)  # CCSDS 7-bit descrambler

        # Measure BER by the density of 0s in the stream
        self._ber = digital.probe_density_b(1.0 / self._symbol_rate)

        self.connect(self, self._demod, self._descrambler, self._ber)
Exemplo n.º 3
0
    def test_002(self):
        src_data = [1, 1, 1, 1]
        expected_data = 1
        src = blocks.vector_source_b(src_data)
        op = digital.probe_density_b(0.01)
        self.tb.connect(src, op)
        self.tb.run()

        result_data = op.density()
        self.assertEqual(expected_data, result_data)
Exemplo n.º 4
0
    def test_002(self):
        src_data = [1, 1, 1, 1]
        expected_data = 1
        src = blocks.vector_source_b(src_data)
        op = digital.probe_density_b(0.01)
        self.tb.connect(src, op)
        self.tb.run()

        result_data = op.density()
        self.assertEqual(expected_data, result_data)
Exemplo n.º 5
0
    def test_003(self):
        src_data = [0, 1, 0, 1, 0, 1, 0, 1, 0, 1]
        expected_data = 0.95243
        src = blocks.vector_source_b(src_data)
        op = digital.probe_density_b(0.01)
        self.tb.connect(src, op)
        self.tb.run()

        result_data = op.density()
        print result_data
        self.assertAlmostEqual(expected_data, result_data, 5)
Exemplo n.º 6
0
    def test_003(self):
        src_data = [0, 1, 0, 1, 0, 1, 0, 1, 0, 1]
        expected_data = 0.95243
        src = blocks.vector_source_b(src_data)
        op = digital.probe_density_b(0.01)
        self.tb.connect(src, op)
        self.tb.run()

        result_data = op.density()
        print(result_data)
        self.assertAlmostEqual(expected_data, result_data, 5)