def __init__(self, generic_encoder=0, generic_decoder=0, esno=0, berminerrors=100, samp_rate=32000, berlimit=-5.0, threading="capillary", puncpat='11'): gr.hier_block2.__init__( self, "BER Generator", gr.io_signature(0, 0, 0), gr.io_signature(1, 1, gr.sizeof_float*1)) ################################################## # Parameters ################################################## self.generic_encoder = generic_encoder self.generic_decoder = generic_decoder self.esno = esno self.berminerrors = berminerrors self.samp_rate = samp_rate self.berlimit = berlimit self.threading = threading self.puncpat = puncpat ################################################## # Blocks ################################################## self.random_gen_b_0 = fec.random_gen_b(0) #self.puncture_ff_0 = fec.puncture_ff(0, read_bitlist(puncpat), puncpat.count('0'), len(puncpat)) self.gr_unpacked_to_packed_xx_0_0 = blocks.unpacked_to_packed_bb(1, gr.GR_LSB_FIRST) self.gr_unpacked_to_packed_xx_0 = blocks.unpacked_to_packed_bb(1, gr.GR_LSB_FIRST) self.gr_throttle_0 = blocks.throttle(gr.sizeof_char*1, samp_rate) #self.generic_encoder_0 = fec.encoder(generic_encoder, gr.sizeof_char, gr.sizeof_float) self.gaussnoise_ff_0 = fec.gaussnoise_ff(esno) self.encoder_interface_0 = extended_encoder_interface \ (encoder_obj_list=generic_encoder, threading='capillary', puncpat=puncpat) self.decoder_interface_0 = extended_decoder_interface \ (decoder_obj_list=generic_decoder, threading='capillary', ann=None, puncpat=puncpat, integration_period=10000, rotator=None) self.ber_bf_0_0 = fec.ber_bf(berminerrors, berlimit) ################################################## # Connections ################################################## self.connect((self.gr_unpacked_to_packed_xx_0_0, 0), (self.ber_bf_0_0, 0)) self.connect((self.gr_unpacked_to_packed_xx_0, 0), (self.ber_bf_0_0, 1)) #self.connect((self.gr_throttle_0, 0), (self.generic_encoder_0, 0)) self.connect((self.gr_throttle_0, 0), (self.gr_unpacked_to_packed_xx_0, 0)) self.connect((self.ber_bf_0_0, 0), (self, 0)) self.connect((self.decoder_interface_0, 0), (self.gr_unpacked_to_packed_xx_0_0, 0)) #self.connect((self.generic_encoder_0, 0), (self.puncture_ff_0, 0)) #self.connect((self.puncture_ff_0, 0), (self.gaussnoise_ff_0, 0)) self.connect((self.gaussnoise_ff_0, 0), (self.decoder_interface_0, 0)) self.connect((self.random_gen_b_0, 0), (self.gr_throttle_0, 0)) self.connect((self.gr_throttle_0, 0), (self.encoder_interface_0, 0)) self.connect((self.encoder_interface_0, 0), (self.gaussnoise_ff_0, 0))
def __init__(self, generic_encoder=0, generic_decoder=0, esno=0, berminerrors=100, samp_rate=32000, berlimit=-5.0, threading="capillary", puncpat='11'): gr.hier_block2.__init__( self, "BER Generator", gr.io_signature(0, 0, 0), gr.io_signature(1, 1, gr.sizeof_float*1), ) ################################################## # Parameters ################################################## self.generic_encoder = generic_encoder self.generic_decoder = generic_decoder self.esno = esno self.berminerrors = berminerrors self.samp_rate = samp_rate self.berlimit = berlimit self.threading = threading self.puncpat = puncpat ################################################## # Blocks ################################################## self.random_gen_b_0 = fec.random_gen_b(0) #self.puncture_ff_0 = fec.puncture_ff(0, read_bitlist(puncpat), puncpat.count('0'), len(puncpat)) self.gr_unpacked_to_packed_xx_0_0 = blocks.unpacked_to_packed_bb(1, gr.GR_LSB_FIRST) self.gr_unpacked_to_packed_xx_0 = blocks.unpacked_to_packed_bb(1, gr.GR_LSB_FIRST) self.gr_throttle_0 = blocks.throttle(gr.sizeof_char*1, samp_rate) #self.generic_encoder_0 = fec.encoder(generic_encoder, gr.sizeof_char, gr.sizeof_float) self.encoder_interface_0 = extended_encoder_interface(encoder_obj_list=generic_encoder, threading='capillary', puncpat=puncpat); self.gaussnoise_ff_0 = fec.gaussnoise_ff(esno) self.decoder_interface_0 = extended_decoder_interface(decoder_obj_list=generic_decoder, threading='capillary', ann=None, puncpat=puncpat, integration_period=10000, rotator=None) self.ber_bb_0_0 = fec.ber_bb(berminerrors, berlimit) ################################################## # Connections ################################################## self.connect((self.gr_unpacked_to_packed_xx_0_0, 0), (self.ber_bb_0_0, 0)) self.connect((self.gr_unpacked_to_packed_xx_0, 0), (self.ber_bb_0_0, 1)) #self.connect((self.gr_throttle_0, 0), (self.generic_encoder_0, 0)) self.connect((self.gr_throttle_0, 0), (self.gr_unpacked_to_packed_xx_0, 0)) self.connect((self.ber_bb_0_0, 0), (self, 0)) self.connect((self.decoder_interface_0, 0), (self.gr_unpacked_to_packed_xx_0_0, 0)) #self.connect((self.generic_encoder_0, 0), (self.puncture_ff_0, 0)) #self.connect((self.puncture_ff_0, 0), (self.gaussnoise_ff_0, 0)) self.connect((self.gaussnoise_ff_0, 0), (self.decoder_interface_0, 0)) self.connect((self.random_gen_b_0, 0), (self.gr_throttle_0, 0)) self.connect((self.gr_throttle_0, 0), (self.encoder_interface_0, 0)) self.connect((self.encoder_interface_0, 0), (self.gaussnoise_ff_0, 0))
def __init__(self, encoder_list, decoder_list, esno=numpy.arange(0.0, 3.0, .25), samp_rate=3200000, threading='capillary', puncpat='11'): gr.hier_block2.__init__( self, "New Bercurve", gr.io_signature(0, 0, 0), gr.io_signature(len(esno) * 2, len(esno) * 2, gr.sizeof_char*1), ) ################################################## # Parameters ################################################## self.esno = esno self.samp_rate = samp_rate self.encoder_list = encoder_list self.decoder_list = decoder_list self.puncpat = puncpat ################################################## # Blocks ################################################## self.random_gen_b_0 = fec.random_gen_b(0) self.deinterleave = blocks.deinterleave(gr.sizeof_char*1) self.connect(self.random_gen_b_0, self.deinterleave); self.ber_generators = [] for i in range(0, len(esno)): if(encoder_list is None): ber_generator_temp = fec_raw_test( esno=esno[i], samp_rate=samp_rate) else: ber_generator_temp = fec_test( generic_encoder=encoder_list[i], generic_decoder=decoder_list[i], esno=esno[i], samp_rate=samp_rate, threading=threading, puncpat=puncpat) self.ber_generators.append(ber_generator_temp); ################################################## # Connections ################################################## for i in range(0, len(esno)): self.connect((self.deinterleave, i), (self.ber_generators[i])) self.connect((self.ber_generators[i], 0), (self, i*2)); self.connect((self.ber_generators[i], 1), (self, i*2 + 1));
def __init__(self, encoder_list, decoder_list, esno=numpy.arange(0.0, 3.0, .25), samp_rate=3200000, threading='capillary', puncpat='11'): gr.hier_block2.__init__( self, "New Bercurve", gr.io_signature(0, 0, 0), gr.io_signature(len(esno) * 2, len(esno) * 2, gr.sizeof_char*1), ) ################################################## # Parameters ################################################## self.esno = esno self.samp_rate = samp_rate self.encoder_list = encoder_list self.decoder_list = decoder_list self.puncpat = puncpat ################################################## # Blocks ################################################## self.random_gen_b_0 = fec.random_gen_b(0) self.deinterleave = blocks.deinterleave(gr.sizeof_char*1) self.connect(self.random_gen_b_0, self.deinterleave); self.ber_generators = [] for i in range(0, len(esno)): ber_generator_temp = fec_test( generic_encoder=encoder_list[i], generic_decoder=decoder_list[i], esno=esno[i], samp_rate=samp_rate, threading=threading, puncpat=puncpat ); self.ber_generators.append(ber_generator_temp); ################################################## # Connections ################################################## for i in range(0, len(esno)): self.connect((self.deinterleave, i), (self.ber_generators[i])) self.connect((self.ber_generators[i], 0), (self, i*2)); self.connect((self.ber_generators[i], 1), (self, i*2 + 1));