summaryrefslogtreecommitdiff
path: root/gr-trellis/examples/python
diff options
context:
space:
mode:
Diffstat (limited to 'gr-trellis/examples/python')
-rwxr-xr-xgr-trellis/examples/python/test_cpm.py14
-rwxr-xr-xgr-trellis/examples/python/test_pccc_turbo1.py10
-rwxr-xr-xgr-trellis/examples/python/test_sccc_hard.py6
-rwxr-xr-xgr-trellis/examples/python/test_sccc_soft.py8
-rwxr-xr-xgr-trellis/examples/python/test_sccc_turbo.py8
-rwxr-xr-xgr-trellis/examples/python/test_sccc_turbo1.py6
-rwxr-xr-xgr-trellis/examples/python/test_sccc_turbo2.py6
-rwxr-xr-xgr-trellis/examples/python/test_tcm.py10
-rwxr-xr-xgr-trellis/examples/python/test_tcm_bit.py10
-rwxr-xr-xgr-trellis/examples/python/test_tcm_combined.py6
-rwxr-xr-xgr-trellis/examples/python/test_tcm_parallel.py6
-rwxr-xr-xgr-trellis/examples/python/test_turbo_equalization.py8
-rwxr-xr-xgr-trellis/examples/python/test_turbo_equalization1.py6
-rwxr-xr-xgr-trellis/examples/python/test_turbo_equalization2.py6
-rwxr-xr-xgr-trellis/examples/python/test_viterbi_equalization.py6
-rwxr-xr-xgr-trellis/examples/python/test_viterbi_equalization1.py6
16 files changed, 61 insertions, 61 deletions
diff --git a/gr-trellis/examples/python/test_cpm.py b/gr-trellis/examples/python/test_cpm.py
index 8d1e2024c1..99b75a7dd1 100755
--- a/gr-trellis/examples/python/test_cpm.py
+++ b/gr-trellis/examples/python/test_cpm.py
@@ -93,7 +93,7 @@ def run_test(seed,blocksize):
##################################################
# Blocks
##################################################
- random_source_x_0 = gr.vector_source_b(data.tolist(), False)
+ random_source_x_0 = blocks.vector_source_b(data.tolist(), False)
digital_chunks_to_symbols_xx_0 = digital.chunks_to_symbols_bf((-1, 1), 1)
filter_interp_fir_filter_xxx_0 = filter.interp_fir_filter_fff(Q, p)
analog_frequency_modulator_fc_0 = analog.frequency_modulator_fc(2*math.pi*h*(1.0/Q))
@@ -107,11 +107,11 @@ def run_test(seed,blocksize):
filter_fir_filter_xxx_0_0 = filter.fir_filter_ccc(Q, MF[0].conjugate())
filter_fir_filter_xxx_0_0_0 = filter.fir_filter_ccc(Q, MF[1].conjugate())
blocks_streams_to_stream_0 = blocks.streams_to_stream(gr.sizeof_gr_complex*1, int(N))
- gr_skiphead_0 = gr.skiphead(gr.sizeof_gr_complex*1, int(N*(1+0)))
+ blocks_skiphead_0 = blocks.skiphead(gr.sizeof_gr_complex*1, int(N*(1+0)))
viterbi = trellis.viterbi_combined_cb(f, head+blocksize+tail, 0, -1, int(N),
constellation, digital.TRELLIS_EUCLIDEAN)
- gr_vector_sink_x_0 = gr.vector_sink_b()
+ blocks_vector_sink_x_0 = blocks.vector_sink_b()
##################################################
# Connections
@@ -127,13 +127,13 @@ def run_test(seed,blocksize):
tb.connect((blocks_multiply_vxx_0, 0), (filter_fir_filter_xxx_0_0_0, 0))
tb.connect((filter_fir_filter_xxx_0_0, 0), (blocks_streams_to_stream_0, 0))
tb.connect((filter_fir_filter_xxx_0_0_0, 0), (blocks_streams_to_stream_0, 1))
- tb.connect((blocks_streams_to_stream_0, 0), (gr_skiphead_0, 0))
- tb.connect((gr_skiphead_0, 0), (viterbi, 0))
- tb.connect((viterbi, 0), (gr_vector_sink_x_0, 0))
+ tb.connect((blocks_streams_to_stream_0, 0), (blocks_skiphead_0, 0))
+ tb.connect((blocks_skiphead_0, 0), (viterbi, 0))
+ tb.connect((viterbi, 0), (blocks_vector_sink_x_0, 0))
tb.run()
- dataest = gr_vector_sink_x_0.data()
+ dataest = blocks_vector_sink_x_0.data()
#print data
#print numpy.array(dataest)
perr = 0
diff --git a/gr-trellis/examples/python/test_pccc_turbo1.py b/gr-trellis/examples/python/test_pccc_turbo1.py
index bb596f1818..7104aa5039 100755
--- a/gr-trellis/examples/python/test_pccc_turbo1.py
+++ b/gr-trellis/examples/python/test_pccc_turbo1.py
@@ -19,12 +19,12 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,
# TX
- src = gr.lfsr_32k_source_s()
- src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts
+ src = blocks.lfsr_32k_source_s()
+ src_head = blocks.head (gr.sizeof_short,Kb/16) # packet size in shorts
s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the outer FSM input cardinality
- #src = gr.vector_source_s([0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],False)
+ #src = blocks.vector_source_s([0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],False)
enc = trellis.pccc_encoder_ss(fo,0,fi,0,interleaver,K)
- code = gr.vector_sink_s()
+ code = blocks.vector_sink_s()
mod = digital.chunks_to_symbols_sf(constellation,dimensionality)
# CHANNEL
@@ -37,7 +37,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,
dec = trellis.pccc_decoder_s(fo,0,-1,fi,0,-1,interleaver,K,IT,trellis.TRELLIS_MIN_SUM)
fsmi2s = blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts
- dst = gr.check_lfsr_32k_s()
+ dst = blocks.check_lfsr_32k_s()
tb.connect (src,src_head,s2fsmi,enc,mod)
#tb.connect (src,enc,mod)
diff --git a/gr-trellis/examples/python/test_sccc_hard.py b/gr-trellis/examples/python/test_sccc_hard.py
index ec1fdd1bc5..83393df4dc 100755
--- a/gr-trellis/examples/python/test_sccc_hard.py
+++ b/gr-trellis/examples/python/test_sccc_hard.py
@@ -19,8 +19,8 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,
# TX
- src = gr.lfsr_32k_source_s()
- src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts
+ src = blocks.lfsr_32k_source_s()
+ src_head = blocks.head(gr.sizeof_short,Kb/16) # packet size in shorts
s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the outer FSM input cardinality
enc_out = trellis.encoder_ss(fo,0) # initial state = 0
inter = trellis.permutation(interleaver.K(),interleaver.INTER(),1,gr.sizeof_short)
@@ -38,7 +38,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,
metrics_out = trellis.metrics_s(fo.O(),1,[0,1,2,3],digital.TRELLIS_HARD_SYMBOL) # data preprocessing to generate metrics for outer Viterbi (hard decisions)
va_out = trellis.viterbi_s(fo,K,0,-1) # Put -1 if the Initial/Final states are not set.
fsmi2s = blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts
- dst = gr.check_lfsr_32k_s()
+ dst = blocks.check_lfsr_32k_s()
tb.connect (src,src_head,s2fsmi,enc_out,inter,enc_in,mod)
tb.connect (mod,(add,0))
diff --git a/gr-trellis/examples/python/test_sccc_soft.py b/gr-trellis/examples/python/test_sccc_soft.py
index f663c9befd..25d26e0025 100755
--- a/gr-trellis/examples/python/test_sccc_soft.py
+++ b/gr-trellis/examples/python/test_sccc_soft.py
@@ -19,8 +19,8 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,
# TX
- src = gr.lfsr_32k_source_s()
- src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts
+ src = blocks.lfsr_32k_source_s()
+ src_head = blocks.head (gr.sizeof_short,Kb/16) # packet size in shorts
s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the outer FSM input cardinality
enc_out = trellis.encoder_ss(fo,0) # initial state = 0
inter = trellis.permutation(interleaver.K(),interleaver.INTER(),1,gr.sizeof_short)
@@ -33,12 +33,12 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,
# RX
metrics_in = trellis.metrics_f(fi.O(),dimensionality,constellation,digital.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for innner Viterbi
- gnd = gr.vector_source_f([0],True);
+ gnd = blocks.vector_source_f([0],True);
siso_in = trellis.siso_f(fi,K,0,-1,True,False,trellis.TRELLIS_MIN_SUM) # Put -1 if the Initial/Final states are not set.
deinter = trellis.permutation(interleaver.K(),interleaver.DEINTER(),fi.I(),gr.sizeof_float)
va_out = trellis.viterbi_s(fo,K,0,-1) # Put -1 if the Initial/Final states are not set.
fsmi2s = blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts
- dst = gr.check_lfsr_32k_s()
+ dst = blocks.check_lfsr_32k_s()
tb.connect (src,src_head,s2fsmi,enc_out,inter,enc_in,mod)
tb.connect (mod,(add,0))
diff --git a/gr-trellis/examples/python/test_sccc_turbo.py b/gr-trellis/examples/python/test_sccc_turbo.py
index cd974e9941..08004e8a0d 100755
--- a/gr-trellis/examples/python/test_sccc_turbo.py
+++ b/gr-trellis/examples/python/test_sccc_turbo.py
@@ -17,7 +17,7 @@ except ImportError:
def make_rx(tb,fo,fi,dimensionality,constellation,K,interleaver,IT,Es,N0,type):
metrics_in = trellis.metrics_f(fi.O(),dimensionality,constellation,digital.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for innner Viterbi
scale = blocks.multiply_const_ff(1.0/N0)
- gnd = gr.vector_source_f([0],True);
+ gnd = blocks.vector_source_f([0],True);
inter=[]
deinter=[]
@@ -59,8 +59,8 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,
# TX
- src = gr.lfsr_32k_source_s()
- src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts
+ src = blocks.lfsr_32k_source_s()
+ src_head = blocks.head(gr.sizeof_short,Kb/16) # packet size in shorts
s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the outer FSM input cardinality
enc_out = trellis.encoder_ss(fo,0) # initial state = 0
inter = trellis.permutation(interleaver.K(),interleaver.INTER(),1,gr.sizeof_short)
@@ -75,7 +75,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,
(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 = blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts
- dst = gr.check_lfsr_32k_s()
+ dst = blocks.check_lfsr_32k_s()
tb.connect (src,src_head,s2fsmi,enc_out,inter,enc_in,mod)
tb.connect (mod,(add,0))
diff --git a/gr-trellis/examples/python/test_sccc_turbo1.py b/gr-trellis/examples/python/test_sccc_turbo1.py
index 93833ec7df..528a79d011 100755
--- a/gr-trellis/examples/python/test_sccc_turbo1.py
+++ b/gr-trellis/examples/python/test_sccc_turbo1.py
@@ -18,8 +18,8 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,
tb = gr.top_block ()
# TX
- src = gr.lfsr_32k_source_s()
- src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts
+ src = blocks.lfsr_32k_source_s()
+ src_head = blocks.head(gr.sizeof_short,Kb/16) # packet size in shorts
s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the outer FSM input cardinality
enc = trellis.sccc_encoder_ss(fo,0,fi,0,interleaver,K)
mod = digital.chunks_to_symbols_sf(constellation,dimensionality)
@@ -31,7 +31,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,
# RX
dec = trellis.sccc_decoder_combined_fs(fo,0,-1,fi,0,-1,interleaver,K,IT,trellis.TRELLIS_MIN_SUM,dimensionality,constellation,digital.TRELLIS_EUCLIDEAN,1.0)
fsmi2s = blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts
- dst = gr.check_lfsr_32k_s()
+ dst = blocks.check_lfsr_32k_s()
#tb.connect (src,src_head,s2fsmi,enc_out,inter,enc_in,mod)
tb.connect (src,src_head,s2fsmi,enc,mod)
diff --git a/gr-trellis/examples/python/test_sccc_turbo2.py b/gr-trellis/examples/python/test_sccc_turbo2.py
index 116a2ca6b2..d7f26c4e13 100755
--- a/gr-trellis/examples/python/test_sccc_turbo2.py
+++ b/gr-trellis/examples/python/test_sccc_turbo2.py
@@ -18,8 +18,8 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,
tb = gr.top_block ()
# TX
- src = gr.lfsr_32k_source_s()
- src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts
+ src = blocks.lfsr_32k_source_s()
+ src_head = blocks.head(gr.sizeof_short,Kb/16) # packet size in shorts
s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the outer FSM input cardinality
enc = trellis.sccc_encoder_ss(fo,0,fi,0,interleaver,K)
mod = digital.chunks_to_symbols_sf(constellation,dimensionality)
@@ -33,7 +33,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,
scale = blocks.multiply_const_ff(1.0/N0)
dec = trellis.sccc_decoder_s(fo,0,-1,fi,0,-1,interleaver,K,IT,trellis.TRELLIS_MIN_SUM)
fsmi2s = blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts
- dst = gr.check_lfsr_32k_s()
+ dst = blocks.check_lfsr_32k_s()
#tb.connect (src,src_head,s2fsmi,enc_out,inter,enc_in,mod)
tb.connect (src,src_head,s2fsmi,enc,mod)
diff --git a/gr-trellis/examples/python/test_tcm.py b/gr-trellis/examples/python/test_tcm.py
index 8a815ae12a..bf9710aa1c 100755
--- a/gr-trellis/examples/python/test_tcm.py
+++ b/gr-trellis/examples/python/test_tcm.py
@@ -24,9 +24,9 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed):
#packet = [0]*Kb
#for i in range(Kb-1*16): # last 16 bits = 0 to drive the final state to 0
#packet[i] = random.randint(0, 1) # random 0s and 1s
- #src = gr.vector_source_s(packet,False)
- src = gr.lfsr_32k_source_s()
- src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts
+ #src = blocks.vector_source_s(packet,False)
+ src = blocks.lfsr_32k_source_s()
+ src_head = blocks.head(gr.sizeof_short,Kb/16) # packet size in shorts
#b2s = blocks.unpacked_to_packed_ss(1,gr.GR_MSB_FIRST) # pack bits in shorts
s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the FSM input cardinality
enc = trellis.encoder_ss(f,0) # initial state = 0
@@ -41,8 +41,8 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed):
va = trellis.viterbi_s(f,K,0,-1) # Put -1 if the Initial/Final states are not set.
fsmi2s = blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts
#s2b = blocks.packed_to_unpacked_ss(1,gr.GR_MSB_FIRST) # unpack shorts to bits
- #dst = gr.vector_sink_s();
- dst = gr.check_lfsr_32k_s()
+ #dst = blocks.vector_sink_s();
+ dst = blocks.check_lfsr_32k_s()
tb.connect (src,src_head,s2fsmi,enc,mod)
diff --git a/gr-trellis/examples/python/test_tcm_bit.py b/gr-trellis/examples/python/test_tcm_bit.py
index 6308df1d09..7880f0ea53 100755
--- a/gr-trellis/examples/python/test_tcm_bit.py
+++ b/gr-trellis/examples/python/test_tcm_bit.py
@@ -24,9 +24,9 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed):
# this for loop is TOO slow!!!
for i in range(Kb-1*16): # last 16 bits = 0 to drive the final state to 0
packet[i] = random.randint(0, 1) # random 0s and 1s
- src = gr.vector_source_s(packet,False)
- #src = gr.lfsr_32k_source_s()
- #src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts
+ src = blocks.vector_source_s(packet,False)
+ #src = blocks.lfsr_32k_source_s()
+ #src_head = blocks.head (gr.sizeof_short,Kb/16) # packet size in shorts
b2s = blocks.unpacked_to_packed_ss(1,gr.GR_MSB_FIRST) # pack bits in shorts
s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the FSM input cardinality
enc = trellis.encoder_ss(f,0) # initial state = 0
@@ -43,8 +43,8 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed):
va = trellis.viterbi_s(f,K,0,-1) # Put -1 if the Initial/Final states are not set.
fsmi2s = blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts
s2b = blocks.packed_to_unpacked_ss(1,gr.GR_MSB_FIRST) # unpack shorts to bits
- dst = gr.vector_sink_s();
- #dst = gr.check_lfsr_32k_s();
+ dst = blocks.vector_sink_s();
+ #dst = blocks.check_lfsr_32k_s();
#tb.connect (src,src_head,s2fsmi,enc,mod)
diff --git a/gr-trellis/examples/python/test_tcm_combined.py b/gr-trellis/examples/python/test_tcm_combined.py
index 198d038ce3..697e3cc64a 100755
--- a/gr-trellis/examples/python/test_tcm_combined.py
+++ b/gr-trellis/examples/python/test_tcm_combined.py
@@ -19,8 +19,8 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed):
tb = gr.top_block ()
# TX
- src = gr.lfsr_32k_source_s()
- src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts
+ src = blocks.lfsr_32k_source_s()
+ src_head = blocks.head(gr.sizeof_short,Kb/16) # packet size in shorts
s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the FSM input cardinality
enc = trellis.encoder_ss(f,0) # initial state = 0
mod = digital.chunks_to_symbols_sf(constellation,dimensionality)
@@ -34,7 +34,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed):
# RX
va = trellis.viterbi_combined_fs(f,K,0,-1,dimensionality,constellation,digital.TRELLIS_EUCLIDEAN) # Put -1 if the Initial/Final states are not set.
fsmi2s = blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts
- dst = gr.check_lfsr_32k_s();
+ dst = blocks.check_lfsr_32k_s();
tb.connect (src,src_head,s2fsmi,enc,mod)
diff --git a/gr-trellis/examples/python/test_tcm_parallel.py b/gr-trellis/examples/python/test_tcm_parallel.py
index d2527956e9..e4456890f0 100755
--- a/gr-trellis/examples/python/test_tcm_parallel.py
+++ b/gr-trellis/examples/python/test_tcm_parallel.py
@@ -19,8 +19,8 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed,P):
tb = gr.top_block ()
# TX
- src = gr.lfsr_32k_source_s()
- src_head = gr.head (gr.sizeof_short,Kb/16*P) # packet size in shorts
+ src = blocks.lfsr_32k_source_s()
+ src_head = blocks.head(gr.sizeof_short,Kb/16*P) # packet size in shorts
s2fsmi=blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the FSM input cardinality
s2p = blocks.stream_to_streams(gr.sizeof_short,P) # serial to parallel
enc = trellis.encoder_ss(f,0) # initiali state = 0
@@ -38,7 +38,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed,P):
va = trellis.viterbi_s(f,K,0,-1) # Put -1 if the Initial/Final states are not set.
p2s = block.streams_to_stream(gr.sizeof_short,P) # parallel to serial
fsmi2s=blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts
- dst = gr.check_lfsr_32k_s()
+ dst = blocks.check_lfsr_32k_s()
tb.connect (src,src_head,s2fsmi,s2p)
for i in range(P):
diff --git a/gr-trellis/examples/python/test_turbo_equalization.py b/gr-trellis/examples/python/test_turbo_equalization.py
index 41361fd3db..b2d58a6014 100755
--- a/gr-trellis/examples/python/test_turbo_equalization.py
+++ b/gr-trellis/examples/python/test_turbo_equalization.py
@@ -16,7 +16,7 @@ except ImportError:
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,digital.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for innner SISO
scale = blocks.multiply_const_ff(1.0/N0)
- gnd = gr.vector_source_f([0],True);
+ gnd = blocks.vector_source_f([0],True);
inter=[]
deinter=[]
@@ -57,8 +57,8 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,tot_constellat
tb = gr.top_block ()
# TX
- src = gr.lfsr_32k_source_s()
- src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts
+ src = blocks.lfsr_32k_source_s()
+ src_head = blocks.head(gr.sizeof_short,Kb/16) # packet size in shorts
s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the iouter FSM input cardinality
enc_out = trellis.encoder_ss(fo,0) # initial state = 0
inter = trellis.permutation(interleaver.K(),interleaver.INTER(),1,gr.sizeof_short)
@@ -73,7 +73,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,tot_constellat
# RX
(head,tail) = make_rx(tb,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,trellis.TRELLIS_MIN_SUM)
fsmi2s = blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts
- dst = gr.check_lfsr_32k_s();
+ dst = blocks.check_lfsr_32k_s();
tb.connect (src,src_head,s2fsmi,enc_out,inter,enc_in,mod)
tb.connect (mod,(add,0))
diff --git a/gr-trellis/examples/python/test_turbo_equalization1.py b/gr-trellis/examples/python/test_turbo_equalization1.py
index ae7e3e374b..5ff21ec757 100755
--- a/gr-trellis/examples/python/test_turbo_equalization1.py
+++ b/gr-trellis/examples/python/test_turbo_equalization1.py
@@ -17,7 +17,7 @@ except ImportError:
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,digital.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for innner SISO
scale = blocks.multiply_const_ff(1.0/N0)
- gnd = gr.vector_source_f([0],True);
+ gnd = blocks.vector_source_f([0],True);
inter=[]
deinter=[]
@@ -64,7 +64,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,channel,modulation,dimensiona
random.seed(seed)
for i in range(len(packet)):
packet[i] = random.randint(0, 2**bitspersymbol - 1) # random symbols
- src = gr.vector_source_s(packet,False)
+ src = blocks.vector_source_s(packet,False)
enc_out = trellis.encoder_ss(fo,0) # initial state = 0
inter = trellis.permutation(interleaver.K(),interleaver.INTER(),1,gr.sizeof_short)
mod = digital.chunks_to_symbols_sf(modulation[1],modulation[0])
@@ -76,7 +76,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,channel,modulation,dimensiona
# RX
(head,tail) = make_rx(tb,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,trellis.TRELLIS_MIN_SUM)
- dst = gr.vector_sink_s();
+ dst = blocks.vector_sink_s();
tb.connect (src,enc_out,inter,mod)
tb.connect (mod,isi,(add,0))
diff --git a/gr-trellis/examples/python/test_turbo_equalization2.py b/gr-trellis/examples/python/test_turbo_equalization2.py
index eed5675fe5..c2af9fbfca 100755
--- a/gr-trellis/examples/python/test_turbo_equalization2.py
+++ b/gr-trellis/examples/python/test_turbo_equalization2.py
@@ -16,7 +16,7 @@ except ImportError:
def make_rx(tb,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,type):
scale = blocks.multiply_const_ff(math.sqrt(1.0/N0))
- gnd = gr.vector_source_f([0],True);
+ gnd = blocks.vector_source_f([0],True);
inter=[]
deinter=[]
@@ -62,7 +62,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,channel,modulation,dimensiona
random.seed(seed)
for i in range(len(packet)):
packet[i] = random.randint(0, 2**bitspersymbol - 1) # random symbols
- src = gr.vector_source_s(packet,False)
+ src = blocks.vector_source_s(packet,False)
enc_out = trellis.encoder_ss(fo,0) # initial state = 0
inter = trellis.permutation(interleaver.K(),interleaver.INTER(),1,gr.sizeof_short)
mod = digital.chunks_to_symbols_sf(modulation[1],modulation[0])
@@ -74,7 +74,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,channel,modulation,dimensiona
# RX
(head,tail) = make_rx(tb,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,trellis.TRELLIS_MIN_SUM)
- dst = gr.vector_sink_s();
+ dst = blocks.vector_sink_s();
tb.connect (src,enc_out,inter,mod)
tb.connect (mod,isi,(add,0))
diff --git a/gr-trellis/examples/python/test_viterbi_equalization.py b/gr-trellis/examples/python/test_viterbi_equalization.py
index f83125136c..987f171b2a 100755
--- a/gr-trellis/examples/python/test_viterbi_equalization.py
+++ b/gr-trellis/examples/python/test_viterbi_equalization.py
@@ -17,8 +17,8 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,tot_constellation,N0,seed):
tb = gr.top_block ()
# TX
- src = gr.lfsr_32k_source_s()
- src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts
+ src = blocks.lfsr_32k_source_s()
+ src_head = blocks.head (gr.sizeof_short,Kb/16) # packet size in shorts
s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the FSM input cardinality
enc = trellis.encoder_ss(f,0) # initial state = 0
# essentially here we implement the combination of modulation and channel as a memoryless modulation (the memory induced by the channel is hidden in the FSM)
@@ -32,7 +32,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,tot_constellation,N0,seed):
metrics = trellis.metrics_f(f.O(),dimensionality,tot_constellation,digital.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for Viterbi
va = trellis.viterbi_s(f,K,0,-1) # Put -1 if the Initial/Final states are not set.
fsmi2s = blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts
- dst = gr.check_lfsr_32k_s();
+ dst = blocks.check_lfsr_32k_s();
tb.connect (src,src_head,s2fsmi,enc,mod)
tb.connect (mod,(add,0))
diff --git a/gr-trellis/examples/python/test_viterbi_equalization1.py b/gr-trellis/examples/python/test_viterbi_equalization1.py
index df46046ae3..baa6a27f1b 100755
--- a/gr-trellis/examples/python/test_viterbi_equalization1.py
+++ b/gr-trellis/examples/python/test_viterbi_equalization1.py
@@ -27,7 +27,7 @@ def run_test (f,Kb,bitspersymbol,K,channel,modulation,dimensionality,tot_constel
for i in range(L): # first/last L symbols set to 0
packet[i] = 0
packet[len(packet)-i-1] = 0
- src = gr.vector_source_s(packet,False)
+ src = blocks.vector_source_s(packet,False)
mod = digital.chunks_to_symbols_sf(modulation[1],modulation[0])
# CHANNEL
@@ -36,11 +36,11 @@ def run_test (f,Kb,bitspersymbol,K,channel,modulation,dimensionality,tot_constel
noise = analog.noise_source_f(analog.GR_GAUSSIAN,math.sqrt(N0/2),seed)
# RX
- skip = gr.skiphead(gr.sizeof_float, L) # skip the first L samples since you know they are coming from the L zero symbols
+ skip = blocks.skiphead(gr.sizeof_float, L) # skip the first L samples since you know they are coming from the L zero symbols
#metrics = trellis.metrics_f(f.O(),dimensionality,tot_constellation,digital.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for Viterbi
#va = trellis.viterbi_s(f,K+L,-1,0) # Put -1 if the Initial/Final states are not set.
va = trellis.viterbi_combined_fs(f,K+L,0,0,dimensionality,tot_constellation,digital.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()
+ dst = blocks.vector_sink_s()
tb.connect (src,mod)
tb.connect (mod,isi,(add,0))