import fsm_utils
def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed):
- fg = gr.flow_graph ()
+ tb = gr.top_block ()
# TX
src = gr.lfsr_32k_source_s()
fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts
dst = gr.check_lfsr_32k_s();
- fg.connect (src,src_head,s2fsmi,enc,mod)
- fg.connect (mod,(add,0))
- fg.connect (noise,(add,1))
- fg.connect (add,metrics)
- fg.connect (metrics,va,fsmi2s,dst)
+ tb.connect (src,src_head,s2fsmi,enc,mod)
+ tb.connect (mod,(add,0))
+ tb.connect (noise,(add,1))
+ tb.connect (add,metrics)
+ tb.connect (metrics,va,fsmi2s,dst)
- fg.run()
+ tb.run()
# A bit of cheating: run the program once and print the
# final encoder state.
sys.exit (1)
# system parameters
- f=trellis.fsm(fname) # get the FSM specification from a file (will hopefully be automated in the future...)
+ f=trellis.fsm(fname) # get the FSM specification from a file
Kb=1024*16 # packet size in bits (make it multiple of 16 so it can be packed in a short)
bitspersymbol = int(round(math.log(f.I())/math.log(2))) # bits per FSM input symbol
K=Kb/bitspersymbol # packet size in trellis steps