def __init__(self, constellation, differential, data_length=None, src_data=None): """ constellation -- a constellation object differential -- whether differential encoding is used data_length -- the number of bits of data to use src_data -- a list of the bits to use """ super(rec_test_tb, self).__init__() # Transmission Blocks if src_data is None: self.src_data = tuple([rndm.randint(0,1) for i in range(0, data_length)]) else: self.src_data = src_data packer = gr.unpacked_to_packed_bb(1, gr.GR_MSB_FIRST) src = gr.vector_source_b(self.src_data) mod = generic_mod(constellation, differential=differential) # Channel channel = gr.channel_model(NOISE_VOLTAGE, FREQUENCY_OFFSET, TIMING_OFFSET) # Receiver Blocks demod = generic_demod(constellation, differential=differential, freq_bw=FREQ_BW, phase_bw=PHASE_BW) self.dst = gr.vector_sink_b() self.connect(src, packer, mod, channel, demod, self.dst)
def __init__(self, constellation, differential, data_length=None, src_data=None): """ constellation -- a constellation object differential -- whether differential encoding is used data_length -- the number of bits of data to use src_data -- a list of the bits to use """ super(rec_test_tb, self).__init__() # Transmission Blocks if src_data is None: self.src_data = tuple( [random.randint(0, 1) for i in range(0, data_length)]) else: self.src_data = src_data packer = gr.unpacked_to_packed_bb(1, gr.GR_MSB_FIRST) src = gr.vector_source_b(self.src_data) mod = generic_mod(constellation, differential=differential) # Channel channel = gr.channel_model(NOISE_VOLTAGE, FREQUENCY_OFFSET, TIMING_OFFSET) # Receiver Blocks demod = generic_demod(constellation, differential=differential, freq_bw=FREQ_BW, phase_bw=PHASE_BW) self.dst = gr.vector_sink_b() self.connect(src, packer, mod, channel, demod, self.dst)
def __init__(self, constellation, differential, data_length=None, src_data=None, freq_offset=True): """ Args: constellation: a constellation object differential: whether differential encoding is used data_length: the number of bits of data to use src_data: a list of the bits to use freq_offset: whether to use a frequency offset in the channel """ super(rec_test_tb, self).__init__() # Transmission Blocks if src_data is None: self.src_data = tuple([rndm.randint(0, 1) for i in range(0, data_length)]) else: self.src_data = src_data packer = blocks.unpacked_to_packed_bb(1, gr.GR_MSB_FIRST) src = blocks.vector_source_b(self.src_data) mod = generic_mod(constellation, differential=differential) # Channel if freq_offset: channel = channel_model(NOISE_VOLTAGE, FREQUENCY_OFFSET, TIMING_OFFSET) else: channel = channel_model(NOISE_VOLTAGE, 0, TIMING_OFFSET) # Receiver Blocks if freq_offset: demod = generic_demod(constellation, differential=differential, freq_bw=FREQ_BW, phase_bw=PHASE_BW) else: demod = generic_demod(constellation, differential=differential, freq_bw=0, phase_bw=0) self.dst = blocks.vector_sink_b() self.connect(src, packer, mod, channel, demod, self.dst)
def __init__(self, constellation, differential, data_length=None, src_data=None, freq_offset=True): """ Args: constellation: a constellation object differential: whether differential encoding is used data_length: the number of bits of data to use src_data: a list of the bits to use freq_offset: whether to use a frequency offset in the channel """ super(rec_test_tb, self).__init__() # Transmission Blocks if src_data is None: self.src_data = tuple( [rndm.randint(0, 1) for i in range(0, data_length)]) else: self.src_data = src_data packer = blocks.unpacked_to_packed_bb(1, gr.GR_MSB_FIRST) src = blocks.vector_source_b(self.src_data) mod = generic_mod(constellation, differential=differential) # Channel if freq_offset: channel = channel_model(NOISE_VOLTAGE, FREQUENCY_OFFSET, TIMING_OFFSET) else: channel = channel_model(NOISE_VOLTAGE, 0, TIMING_OFFSET) # Receiver Blocks if freq_offset: demod = generic_demod(constellation, differential=differential, freq_bw=FREQ_BW, phase_bw=PHASE_BW) else: demod = generic_demod(constellation, differential=differential, freq_bw=0, phase_bw=0) self.dst = blocks.vector_sink_b() self.connect(src, packer, mod, channel, demod, self.dst)