diff options
Diffstat (limited to 'gr-trellis/src')
-rwxr-xr-x | gr-trellis/src/examples/test_sccc_hard.py | 14 | ||||
-rwxr-xr-x | gr-trellis/src/examples/test_sccc_soft.py | 20 | ||||
-rwxr-xr-x | gr-trellis/src/examples/test_sccc_turbo.py | 40 | ||||
-rwxr-xr-x | gr-trellis/src/examples/test_tcm.py | 18 | ||||
-rwxr-xr-x | gr-trellis/src/examples/test_tcm1.py | 18 | ||||
-rwxr-xr-x | gr-trellis/src/examples/test_tcm2.py | 18 | ||||
-rwxr-xr-x | gr-trellis/src/examples/test_tcm_combined.py | 12 | ||||
-rwxr-xr-x | gr-trellis/src/examples/test_tcm_parallel.py | 18 | ||||
-rwxr-xr-x | gr-trellis/src/examples/test_turbo_equalization.py | 38 | ||||
-rwxr-xr-x | gr-trellis/src/examples/test_turbo_equalization1.py | 38 | ||||
-rwxr-xr-x | gr-trellis/src/examples/test_turbo_equalization2.py | 36 | ||||
-rwxr-xr-x | gr-trellis/src/examples/test_viterbi_equalization.py | 14 | ||||
-rwxr-xr-x | gr-trellis/src/examples/test_viterbi_equalization1.py | 16 | ||||
-rwxr-xr-x | gr-trellis/src/python/qa_trellis.py | 4 |
14 files changed, 152 insertions, 152 deletions
diff --git a/gr-trellis/src/examples/test_sccc_hard.py b/gr-trellis/src/examples/test_sccc_hard.py index d634282fe..a7933a18e 100755 --- a/gr-trellis/src/examples/test_sccc_hard.py +++ b/gr-trellis/src/examples/test_sccc_hard.py @@ -10,7 +10,7 @@ import random import fsm_utils def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): - fg = gr.flow_graph () + tb = gr.top_block () # TX @@ -35,13 +35,13 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, 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_out,inter,enc_in,mod) - fg.connect (mod,(add,0)) - fg.connect (noise,(add,1)) - fg.connect (add,metrics_in) - fg.connect (metrics_in,va_in,deinter,metrics_out,va_out,fsmi2s,dst) + tb.connect (src,src_head,s2fsmi,enc_out,inter,enc_in,mod) + tb.connect (mod,(add,0)) + tb.connect (noise,(add,1)) + tb.connect (add,metrics_in) + tb.connect (metrics_in,va_in,deinter,metrics_out,va_out,fsmi2s,dst) - fg.run() + tb.run() ntotal = dst.ntotal () nright = dst.nright () diff --git a/gr-trellis/src/examples/test_sccc_soft.py b/gr-trellis/src/examples/test_sccc_soft.py index 23e6553ca..d96d36e3f 100755 --- a/gr-trellis/src/examples/test_sccc_soft.py +++ b/gr-trellis/src/examples/test_sccc_soft.py @@ -13,7 +13,7 @@ import fsm_utils def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): - fg = gr.flow_graph () + tb = gr.top_block () # TX @@ -38,15 +38,15 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, 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_out,inter,enc_in,mod) - fg.connect (mod,(add,0)) - fg.connect (noise,(add,1)) - fg.connect (add,metrics_in) - fg.connect (gnd,(siso_in,0)) - fg.connect (metrics_in,(siso_in,1)) - fg.connect (siso_in,deinter,va_out,fsmi2s,dst) - - fg.run() + tb.connect (src,src_head,s2fsmi,enc_out,inter,enc_in,mod) + tb.connect (mod,(add,0)) + tb.connect (noise,(add,1)) + tb.connect (add,metrics_in) + tb.connect (gnd,(siso_in,0)) + tb.connect (metrics_in,(siso_in,1)) + tb.connect (siso_in,deinter,va_out,fsmi2s,dst) + + tb.run() ntotal = dst.ntotal () nright = dst.nright () diff --git a/gr-trellis/src/examples/test_sccc_turbo.py b/gr-trellis/src/examples/test_sccc_turbo.py index f67fb0922..f3a856de7 100755 --- a/gr-trellis/src/examples/test_sccc_turbo.py +++ b/gr-trellis/src/examples/test_sccc_turbo.py @@ -11,7 +11,7 @@ import fsm_utils -def make_rx(fg,fo,fi,dimensionality,constellation,K,interleaver,IT,Es,N0,type): +def make_rx(tb,fo,fi,dimensionality,constellation,K,interleaver,IT,Es,N0,type): metrics_in = trellis.metrics_f(fi.O(),dimensionality,constellation,trellis.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for innner Viterbi scale = gr.multiply_const_ff(1.0/N0) gnd = gr.vector_source_f([0],True); @@ -32,27 +32,27 @@ def make_rx(fg,fo,fi,dimensionality,constellation,K,interleaver,IT,Es,N0,type): siso_out.append( trellis.viterbi_s(fo,K,0,-1) ) # no soft outputs needed # connect first stage - fg.connect (gnd,inter[0]) - fg.connect (metrics_in,scale) - fg.connect (scale,(siso_in[0],1)) + tb.connect (gnd,inter[0]) + tb.connect (metrics_in,scale) + tb.connect (scale,(siso_in[0],1)) # connect the rest for it in range(IT): if it < IT-1: - fg.connect (metrics_in,(siso_in[it+1],1)) - fg.connect (siso_in[it],deinter[it],(siso_out[it],1)) - fg.connect (gnd,(siso_out[it],0)) - fg.connect (siso_out[it],inter[it+1]) - fg.connect (inter[it],(siso_in[it],0)) + tb.connect (metrics_in,(siso_in[it+1],1)) + tb.connect (siso_in[it],deinter[it],(siso_out[it],1)) + tb.connect (gnd,(siso_out[it],0)) + tb.connect (siso_out[it],inter[it+1]) + tb.connect (inter[it],(siso_in[it],0)) else: - fg.connect (siso_in[it],deinter[it],siso_out[it]) - fg.connect (inter[it],(siso_in[it],0)) + tb.connect (siso_in[it],deinter[it],siso_out[it]) + tb.connect (inter[it],(siso_in[it],0)) return (metrics_in,siso_out[IT-1]) def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,Es,N0,IT,seed): - fg = gr.flow_graph () + tb = gr.top_block () # TX @@ -69,18 +69,18 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) # RX - (head,tail) = make_rx(fg,fo,fi,dimensionality,constellation,K,interleaver,IT,Es,N0,trellis.TRELLIS_MIN_SUM) - #(head,tail) = make_rx(fg,fo,fi,dimensionality,constellation,K,interleaver,IT,Es,N0,trellis.TRELLIS_SUM_PRODUCT) + (head,tail) = make_rx(tb,fo,fi,dimensionality,constellation,K,interleaver,IT,Es,N0,trellis.TRELLIS_MIN_SUM) + #(head,tail) = make_rx(tb,fo,fi,dimensionality,constellation,K,interleaver,IT,Es,N0,trellis.TRELLIS_SUM_PRODUCT) 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_out,inter,enc_in,mod) - fg.connect (mod,(add,0)) - fg.connect (noise,(add,1)) - fg.connect (add,head) - fg.connect (tail,fsmi2s,dst) + tb.connect (src,src_head,s2fsmi,enc_out,inter,enc_in,mod) + tb.connect (mod,(add,0)) + tb.connect (noise,(add,1)) + tb.connect (add,head) + tb.connect (tail,fsmi2s,dst) - fg.run() + tb.run() #print enc_out.ST(), enc_in.ST() diff --git a/gr-trellis/src/examples/test_tcm.py b/gr-trellis/src/examples/test_tcm.py index f22501558..62e0c413a 100755 --- a/gr-trellis/src/examples/test_tcm.py +++ b/gr-trellis/src/examples/test_tcm.py @@ -10,7 +10,7 @@ import random import fsm_utils def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): - fg = gr.flow_graph () + tb = gr.top_block () # TX @@ -38,16 +38,16 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): dst = gr.check_lfsr_32k_s() - fg.connect (src,src_head,s2fsmi,enc,mod) - #fg.connect (src,b2s,s2fsmi,enc,mod) - fg.connect (mod,(add,0)) - fg.connect (noise,(add,1)) - fg.connect (add,metrics) - fg.connect (metrics,va,fsmi2s,dst) - #fg.connect (metrics,va,fsmi2s,s2b,dst) + tb.connect (src,src_head,s2fsmi,enc,mod) + #tb.connect (src,b2s,s2fsmi,enc,mod) + tb.connect (mod,(add,0)) + tb.connect (noise,(add,1)) + tb.connect (add,metrics) + tb.connect (metrics,va,fsmi2s,dst) + #tb.connect (metrics,va,fsmi2s,s2b,dst) - fg.run() + tb.run() # A bit of cheating: run the program once and print the # final encoder state.. diff --git a/gr-trellis/src/examples/test_tcm1.py b/gr-trellis/src/examples/test_tcm1.py index 66d7131e3..746bd9336 100755 --- a/gr-trellis/src/examples/test_tcm1.py +++ b/gr-trellis/src/examples/test_tcm1.py @@ -10,7 +10,7 @@ import random import fsm_utils def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): - fg = gr.flow_graph () + tb = gr.top_block () # TX packet = [0]*Kb @@ -40,16 +40,16 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): #dst = gr.check_lfsr_32k_s(); - #fg.connect (src,src_head,s2fsmi,enc,mod) - fg.connect (src,b2s,s2fsmi,enc,mod) - fg.connect (mod,(add,0)) - fg.connect (noise,(add,1)) - fg.connect (add,metrics) - #fg.connect (metrics,va,fsmi2s,dst) - fg.connect (metrics,va,fsmi2s,s2b,dst) + #tb.connect (src,src_head,s2fsmi,enc,mod) + tb.connect (src,b2s,s2fsmi,enc,mod) + tb.connect (mod,(add,0)) + tb.connect (noise,(add,1)) + tb.connect (add,metrics) + #tb.connect (metrics,va,fsmi2s,dst) + tb.connect (metrics,va,fsmi2s,s2b,dst) - fg.run() + tb.run() # A bit of cheating: run the program once and print the # final encoder state.. diff --git a/gr-trellis/src/examples/test_tcm2.py b/gr-trellis/src/examples/test_tcm2.py index 9680909ea..e527fc5ed 100755 --- a/gr-trellis/src/examples/test_tcm2.py +++ b/gr-trellis/src/examples/test_tcm2.py @@ -10,7 +10,7 @@ import random import fsm_utils def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): - fg = gr.flow_graph () + tb = gr.top_block () # TX @@ -38,16 +38,16 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): dst = gr.check_lfsr_32k_s() - fg.connect (src,src_head,s2fsmi,enc,mod) - #fg.connect (src,b2s,s2fsmi,enc,mod) - fg.connect (mod,(add,0)) - fg.connect (noise,(add,1)) - fg.connect (add,metrics) - fg.connect (metrics,va,fsmi2s,dst) - #fg.connect (metrics,va,fsmi2s,s2b,dst) + tb.connect (src,src_head,s2fsmi,enc,mod) + #tb.connect (src,b2s,s2fsmi,enc,mod) + tb.connect (mod,(add,0)) + tb.connect (noise,(add,1)) + tb.connect (add,metrics) + tb.connect (metrics,va,fsmi2s,dst) + #tb.connect (metrics,va,fsmi2s,s2b,dst) - fg.run() + tb.run() # A bit of cheating: run the program once and print the # final encoder state.. diff --git a/gr-trellis/src/examples/test_tcm_combined.py b/gr-trellis/src/examples/test_tcm_combined.py index 92e020bea..d2d42b40b 100755 --- a/gr-trellis/src/examples/test_tcm_combined.py +++ b/gr-trellis/src/examples/test_tcm_combined.py @@ -9,7 +9,7 @@ import sys 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() @@ -30,13 +30,13 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): 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,va,fsmi2s,dst) + tb.connect (src,src_head,s2fsmi,enc,mod) + tb.connect (mod,(add,0)) + tb.connect (noise,(add,1)) + tb.connect (add,va,fsmi2s,dst) - fg.run() + tb.run() # A bit of cheating: run the program once and print the # final encoder state.. diff --git a/gr-trellis/src/examples/test_tcm_parallel.py b/gr-trellis/src/examples/test_tcm_parallel.py index f9dcb5852..8e2f5a230 100755 --- a/gr-trellis/src/examples/test_tcm_parallel.py +++ b/gr-trellis/src/examples/test_tcm_parallel.py @@ -9,7 +9,7 @@ import sys import fsm_utils def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed,P): - fg = gr.flow_graph () + tb = gr.top_block () # TX src = gr.lfsr_32k_source_s() @@ -33,17 +33,17 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed,P): 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,s2p) + tb.connect (src,src_head,s2fsmi,s2p) for i in range(P): - fg.connect ((s2p,i),(enc,i),(mod,i)) - fg.connect ((mod,i),(add[i],0)) - fg.connect (noise[i],(add[i],1)) - fg.connect (add[i],(metrics,i)) - fg.connect ((metrics,i),(va,i),(p2s,i)) - fg.connect (p2s,fsmi2s,dst) + tb.connect ((s2p,i),(enc,i),(mod,i)) + tb.connect ((mod,i),(add[i],0)) + tb.connect (noise[i],(add[i],1)) + tb.connect (add[i],(metrics,i)) + tb.connect ((metrics,i),(va,i),(p2s,i)) + tb.connect (p2s,fsmi2s,dst) - fg.run() + tb.run() # A bit of cheating: run the program once and print the # final encoder state. diff --git a/gr-trellis/src/examples/test_turbo_equalization.py b/gr-trellis/src/examples/test_turbo_equalization.py index ff0497e2b..612f6951c 100755 --- a/gr-trellis/src/examples/test_turbo_equalization.py +++ b/gr-trellis/src/examples/test_turbo_equalization.py @@ -9,7 +9,7 @@ import sys import fsm_utils -def make_rx(fg,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,type): +def make_rx(tb,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,type): metrics_in = trellis.metrics_f(fi.O(),dimensionality,tot_constellation,trellis.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for innner SISO scale = gr.multiply_const_ff(1.0/N0) gnd = gr.vector_source_f([0],True); @@ -30,27 +30,27 @@ def make_rx(fg,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,typ siso_out.append( trellis.viterbi_s(fo,K,0,-1) ) # no soft outputs needed # connect first stage - fg.connect (gnd,inter[0]) - fg.connect (metrics_in,scale) - fg.connect (scale,(siso_in[0],1)) + tb.connect (gnd,inter[0]) + tb.connect (metrics_in,scale) + tb.connect (scale,(siso_in[0],1)) # connect the rest for it in range(IT): if it < IT-1: - fg.connect (metrics_in,(siso_in[it+1],1)) - fg.connect (siso_in[it],deinter[it],(siso_out[it],1)) - fg.connect (gnd,(siso_out[it],0)) - fg.connect (siso_out[it],inter[it+1]) - fg.connect (inter[it],(siso_in[it],0)) + tb.connect (metrics_in,(siso_in[it+1],1)) + tb.connect (siso_in[it],deinter[it],(siso_out[it],1)) + tb.connect (gnd,(siso_out[it],0)) + tb.connect (siso_out[it],inter[it+1]) + tb.connect (inter[it],(siso_in[it],0)) else: - fg.connect (siso_in[it],deinter[it],siso_out[it]) - fg.connect (inter[it],(siso_in[it],0)) + tb.connect (siso_in[it],deinter[it],siso_out[it]) + tb.connect (inter[it],(siso_in[it],0)) return (metrics_in,siso_out[IT-1]) def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,tot_constellation,Es,N0,IT,seed): - fg = gr.flow_graph () + tb = gr.top_block () # TX src = gr.lfsr_32k_source_s() @@ -67,17 +67,17 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,tot_constellat noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) # RX - (head,tail) = make_rx(fg,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,trellis.TRELLIS_MIN_SUM) + (head,tail) = make_rx(tb,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,trellis.TRELLIS_MIN_SUM) 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_out,inter,enc_in,mod) - fg.connect (mod,(add,0)) - fg.connect (noise,(add,1)) - fg.connect (add,head) - fg.connect (tail,fsmi2s,dst) + tb.connect (src,src_head,s2fsmi,enc_out,inter,enc_in,mod) + tb.connect (mod,(add,0)) + tb.connect (noise,(add,1)) + tb.connect (add,head) + tb.connect (tail,fsmi2s,dst) - fg.run() + tb.run() ntotal = dst.ntotal () nright = dst.nright () diff --git a/gr-trellis/src/examples/test_turbo_equalization1.py b/gr-trellis/src/examples/test_turbo_equalization1.py index 5afd5ba66..8d2feec8a 100755 --- a/gr-trellis/src/examples/test_turbo_equalization1.py +++ b/gr-trellis/src/examples/test_turbo_equalization1.py @@ -9,7 +9,7 @@ import sys import random import fsm_utils -def make_rx(fg,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,type): +def make_rx(tb,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,type): metrics_in = trellis.metrics_f(fi.O(),dimensionality,tot_constellation,trellis.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for innner SISO scale = gr.multiply_const_ff(1.0/N0) gnd = gr.vector_source_f([0],True); @@ -30,27 +30,27 @@ def make_rx(fg,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,typ siso_out.append( trellis.viterbi_s(fo,K,0,-1) ) # no soft outputs needed # connect first stage - fg.connect (gnd,inter[0]) - fg.connect (metrics_in,scale) - fg.connect (scale,(siso_in[0],1)) + tb.connect (gnd,inter[0]) + tb.connect (metrics_in,scale) + tb.connect (scale,(siso_in[0],1)) # connect the rest for it in range(IT): if it < IT-1: - fg.connect (scale,(siso_in[it+1],1)) - fg.connect (siso_in[it],deinter[it],(siso_out[it],1)) - fg.connect (gnd,(siso_out[it],0)) - fg.connect (siso_out[it],inter[it+1]) - fg.connect (inter[it],(siso_in[it],0)) + tb.connect (scale,(siso_in[it+1],1)) + tb.connect (siso_in[it],deinter[it],(siso_out[it],1)) + tb.connect (gnd,(siso_out[it],0)) + tb.connect (siso_out[it],inter[it+1]) + tb.connect (inter[it],(siso_in[it],0)) else: - fg.connect (siso_in[it],deinter[it],siso_out[it]) - fg.connect (inter[it],(siso_in[it],0)) + tb.connect (siso_in[it],deinter[it],siso_out[it]) + tb.connect (inter[it],(siso_in[it],0)) return (metrics_in,siso_out[IT-1]) def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,channel,modulation,dimensionality,tot_constellation,Es,N0,IT,seed): - fg = gr.flow_graph () + tb = gr.top_block () L = len(channel) # TX @@ -70,16 +70,16 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,channel,modulation,dimensiona noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) # RX - (head,tail) = make_rx(fg,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,trellis.TRELLIS_MIN_SUM) + (head,tail) = make_rx(tb,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,trellis.TRELLIS_MIN_SUM) dst = gr.vector_sink_s(); - fg.connect (src,enc_out,inter,mod) - fg.connect (mod,isi,(add,0)) - fg.connect (noise,(add,1)) - fg.connect (add,head) - fg.connect (tail,dst) + tb.connect (src,enc_out,inter,mod) + tb.connect (mod,isi,(add,0)) + tb.connect (noise,(add,1)) + tb.connect (add,head) + tb.connect (tail,dst) - fg.run() + tb.run() data = dst.data() ntotal = len(data) diff --git a/gr-trellis/src/examples/test_turbo_equalization2.py b/gr-trellis/src/examples/test_turbo_equalization2.py index 7e252d6d1..f1731016e 100755 --- a/gr-trellis/src/examples/test_turbo_equalization2.py +++ b/gr-trellis/src/examples/test_turbo_equalization2.py @@ -9,7 +9,7 @@ import sys import random import fsm_utils -def make_rx(fg,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,type): +def make_rx(tb,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,type): scale = gr.multiply_const_ff(math.sqrt(1.0/N0)) gnd = gr.vector_source_f([0],True); @@ -29,26 +29,26 @@ def make_rx(fg,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,typ siso_out.append( trellis.viterbi_s(fo,K,0,-1) ) # no soft outputs needed # connect first stage - fg.connect (gnd,inter[0]) - fg.connect (scale,(siso_in[0],1)) + tb.connect (gnd,inter[0]) + tb.connect (scale,(siso_in[0],1)) # connect the rest for it in range(IT): if it < IT-1: - fg.connect (scale,(siso_in[it+1],1)) - fg.connect (siso_in[it],deinter[it],(siso_out[it],1)) - fg.connect (gnd,(siso_out[it],0)) - fg.connect (siso_out[it],inter[it+1]) - fg.connect (inter[it],(siso_in[it],0)) + tb.connect (scale,(siso_in[it+1],1)) + tb.connect (siso_in[it],deinter[it],(siso_out[it],1)) + tb.connect (gnd,(siso_out[it],0)) + tb.connect (siso_out[it],inter[it+1]) + tb.connect (inter[it],(siso_in[it],0)) else: - fg.connect (siso_in[it],deinter[it],siso_out[it]) - fg.connect (inter[it],(siso_in[it],0)) + tb.connect (siso_in[it],deinter[it],siso_out[it]) + tb.connect (inter[it],(siso_in[it],0)) return (scale,siso_out[IT-1]) def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,channel,modulation,dimensionality,tot_constellation,Es,N0,IT,seed): - fg = gr.flow_graph () + tb = gr.top_block () L = len(channel) # TX @@ -68,16 +68,16 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,channel,modulation,dimensiona noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) # RX - (head,tail) = make_rx(fg,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,trellis.TRELLIS_MIN_SUM) + (head,tail) = make_rx(tb,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,trellis.TRELLIS_MIN_SUM) dst = gr.vector_sink_s(); - fg.connect (src,enc_out,inter,mod) - fg.connect (mod,isi,(add,0)) - fg.connect (noise,(add,1)) - fg.connect (add,head) - fg.connect (tail,dst) + tb.connect (src,enc_out,inter,mod) + tb.connect (mod,isi,(add,0)) + tb.connect (noise,(add,1)) + tb.connect (add,head) + tb.connect (tail,dst) - fg.run() + tb.run() data = dst.data() ntotal = len(data) diff --git a/gr-trellis/src/examples/test_viterbi_equalization.py b/gr-trellis/src/examples/test_viterbi_equalization.py index 24545e3b0..86fc00674 100755 --- a/gr-trellis/src/examples/test_viterbi_equalization.py +++ b/gr-trellis/src/examples/test_viterbi_equalization.py @@ -9,7 +9,7 @@ import sys import fsm_utils def run_test (f,Kb,bitspersymbol,K,dimensionality,tot_constellation,N0,seed): - fg = gr.flow_graph () + tb = gr.top_block () # TX src = gr.lfsr_32k_source_s() @@ -29,13 +29,13 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,tot_constellation,N0,seed): 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() ntotal = dst.ntotal () nright = dst.nright () diff --git a/gr-trellis/src/examples/test_viterbi_equalization1.py b/gr-trellis/src/examples/test_viterbi_equalization1.py index 002d41a76..d26f73bc0 100755 --- a/gr-trellis/src/examples/test_viterbi_equalization1.py +++ b/gr-trellis/src/examples/test_viterbi_equalization1.py @@ -10,7 +10,7 @@ import random import fsm_utils def run_test (f,Kb,bitspersymbol,K,channel,modulation,dimensionality,tot_constellation,N0,seed): - fg = gr.flow_graph () + tb = gr.top_block () L = len(channel) # TX @@ -37,14 +37,14 @@ def run_test (f,Kb,bitspersymbol,K,channel,modulation,dimensionality,tot_constel va = trellis.viterbi_combined_fs(f,K+L,0,0,dimensionality,tot_constellation,trellis.TRELLIS_EUCLIDEAN) # using viterbi_combined_fs instead of metrics_f/viterbi_s allows larger packet lengths because metrics_f is complaining for not being able to allocate large buffers. This is due to the large f.O() in this application... dst = gr.vector_sink_s() - fg.connect (src,mod) - fg.connect (mod,isi,(add,0)) - fg.connect (noise,(add,1)) - #fg.connect (add,metrics) - #fg.connect (metrics,va,dst) - fg.connect (add,skip,va,dst) + tb.connect (src,mod) + tb.connect (mod,isi,(add,0)) + tb.connect (noise,(add,1)) + #tb.connect (add,metrics) + #tb.connect (metrics,va,dst) + tb.connect (add,skip,va,dst) - fg.run() + tb.run() data = dst.data() ntotal = len(data) - L diff --git a/gr-trellis/src/python/qa_trellis.py b/gr-trellis/src/python/qa_trellis.py index 27cea8e87..306bf994d 100755 --- a/gr-trellis/src/python/qa_trellis.py +++ b/gr-trellis/src/python/qa_trellis.py @@ -26,10 +26,10 @@ import trellis class qa_trellis (gr_unittest.TestCase): def setUp (self): - self.fg = gr.flow_graph () + self.tb = gr.top_block () def tearDown (self): - self.fg = None + self.tb = None def test_001_fsm (self): I = 2 |