parameters: (self, constellation, f, N0=0.25, seed=-666)
docstring: constellation - a constellation object used for modulation.
          f - a finite state machine specification used for coding.
          N0 - noise level
          seed - random seed
docstring_summary: constellation - a constellation object used for modulation.
          f - a finite state machine specification used for coding.
          N0 - noise level
          seed - random seed
docstring_tokens: constellation - a constellation object used for modulation . f - a finite state machine specification used for coding . N0 - noise level seed - random seed
function: def __init__(self, constellation, f, N0=0.25, seed=-666):
          """
          constellation - a constellation object used for modulation.
          f - a finite state machine specification used for coding.
          N0 - noise level
          seed - random seed
          """
          super(trellis_tb, self).__init__()
          # packet size in bits (make it multiple of 16 so it can be packed in a
          # short)
          packet_size = 1024 * 16
          # bits per FSM input symbol
          # bits per FSM input symbol
          bitspersymbol = int(round(math.log(f.I()) / math.log(2)))
          # packet size in trellis steps
          K = packet_size // bitspersymbol
  
          # TX
          src = blocks.lfsr_32k_source_s()
          # packet size in shorts
          src_head = blocks.head(gr.sizeof_short, packet_size // 16)
          # unpack shorts to symbols compatible with the FSM input cardinality
          s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol, gr.GR_MSB_FIRST)
          # initial FSM state = 0
          enc = trellis.encoder_ss(f, 0)
          mod = digital.chunks_to_symbols_sc(constellation.points(), 1)
  
          # CHANNEL
          add = blocks.add_cc()
          noise = analog.noise_source_c(
              analog.GR_GAUSSIAN, math.sqrt(
                  N0 / 2), seed)
  
          # RX
          # data preprocessing to generate metrics for Viterbi
          metrics = trellis.constellation_metrics_cf(
              constellation.base(), digital.TRELLIS_EUCLIDEAN)
          # Put -1 if the Initial/Final states are not set.
          va = trellis.viterbi_s(f, K, 0, -1)
          # pack FSM input symbols to shorts
          fsmi2s = blocks.unpacked_to_packed_ss(bitspersymbol, gr.GR_MSB_FIRST)
          # check the output
          self.dst = blocks.check_lfsr_32k_s()
  
          self.connect(src, src_head, s2fsmi, enc, mod)
          self.connect(mod, (add, 0))
          self.connect(noise, (add, 1))
          self.connect(add, metrics, va, fsmi2s, self.dst)
function_tokens: def __init__ ( self , constellation , f , N0 = 0.25 , seed = - 666 ) : super ( trellis_tb , self ) . __init__ ( ) # packet size in bits (make it multiple of 16 so it can be packed in a # short) packet_size = 1024 * 16 # bits per FSM input symbol # bits per FSM input symbol bitspersymbol = int ( round ( math . log ( f . I ( ) ) / math . log ( 2 ) ) ) # packet size in trellis steps K = packet_size // bitspersymbol # TX src = blocks . lfsr_32k_source_s ( ) # packet size in shorts src_head = blocks . head ( gr . sizeof_short , packet_size // 16 ) # unpack shorts to symbols compatible with the FSM input cardinality s2fsmi = blocks . packed_to_unpacked_ss ( bitspersymbol , gr . GR_MSB_FIRST ) # initial FSM state = 0 enc = trellis . encoder_ss ( f , 0 ) mod = digital . chunks_to_symbols_sc ( constellation . points ( ) , 1 ) # CHANNEL add = blocks . add_cc ( ) noise = analog . noise_source_c ( analog . GR_GAUSSIAN , math . sqrt ( N0 / 2 ) , seed ) # RX # data preprocessing to generate metrics for Viterbi metrics = trellis . constellation_metrics_cf ( constellation . base ( ) , digital . TRELLIS_EUCLIDEAN ) # Put -1 if the Initial/Final states are not set. va = trellis . viterbi_s ( f , K , 0 , - 1 ) # pack FSM input symbols to shorts fsmi2s = blocks . unpacked_to_packed_ss ( bitspersymbol , gr . GR_MSB_FIRST ) # check the output self . dst = blocks . check_lfsr_32k_s ( ) self . connect ( src , src_head , s2fsmi , enc , mod ) self . connect ( mod , ( add , 0 ) ) self . connect ( noise , ( add , 1 ) ) self . connect ( add , metrics , va , fsmi2s , self . dst )