summaryrefslogtreecommitdiff
path: root/gr-trellis/examples/python
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2013-03-18 13:13:48 -0400
committerTom Rondeau <trondeau@vt.edu>2013-03-18 13:13:48 -0400
commit0183e3ed10c551fefdbb0ed095d896cf01699a54 (patch)
tree788ff905a1299f948ed6908d7076a7caad17c5f1 /gr-trellis/examples/python
parentd26514b07a5d15206687b636a2a0c51ad10684c1 (diff)
blocks: removing lfsr and friends from core; now in gr-blocks.
Diffstat (limited to 'gr-trellis/examples/python')
-rwxr-xr-xgr-trellis/examples/python/test_pccc_turbo1.py4
-rwxr-xr-xgr-trellis/examples/python/test_sccc_hard.py4
-rwxr-xr-xgr-trellis/examples/python/test_sccc_soft.py4
-rwxr-xr-xgr-trellis/examples/python/test_sccc_turbo.py4
-rwxr-xr-xgr-trellis/examples/python/test_sccc_turbo1.py4
-rwxr-xr-xgr-trellis/examples/python/test_sccc_turbo2.py4
-rwxr-xr-xgr-trellis/examples/python/test_tcm.py4
-rwxr-xr-xgr-trellis/examples/python/test_tcm_bit.py4
-rwxr-xr-xgr-trellis/examples/python/test_tcm_combined.py4
-rwxr-xr-xgr-trellis/examples/python/test_tcm_parallel.py4
-rwxr-xr-xgr-trellis/examples/python/test_turbo_equalization.py4
-rwxr-xr-xgr-trellis/examples/python/test_viterbi_equalization.py4
12 files changed, 24 insertions, 24 deletions
diff --git a/gr-trellis/examples/python/test_pccc_turbo1.py b/gr-trellis/examples/python/test_pccc_turbo1.py
index 8234726be0..7104aa5039 100755
--- a/gr-trellis/examples/python/test_pccc_turbo1.py
+++ b/gr-trellis/examples/python/test_pccc_turbo1.py
@@ -19,7 +19,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,
# TX
- src = gr.lfsr_32k_source_s()
+ 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 = blocks.vector_source_s([0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],False)
@@ -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 6cb85111a3..83393df4dc 100755
--- a/gr-trellis/examples/python/test_sccc_hard.py
+++ b/gr-trellis/examples/python/test_sccc_hard.py
@@ -19,7 +19,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,
# TX
- src = gr.lfsr_32k_source_s()
+ 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
@@ -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 782d2f9134..25d26e0025 100755
--- a/gr-trellis/examples/python/test_sccc_soft.py
+++ b/gr-trellis/examples/python/test_sccc_soft.py
@@ -19,7 +19,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,
# TX
- src = gr.lfsr_32k_source_s()
+ 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
@@ -38,7 +38,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,
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 2a1e742a3b..08004e8a0d 100755
--- a/gr-trellis/examples/python/test_sccc_turbo.py
+++ b/gr-trellis/examples/python/test_sccc_turbo.py
@@ -59,7 +59,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,
# TX
- src = gr.lfsr_32k_source_s()
+ 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
@@ -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 6c5a01d681..528a79d011 100755
--- a/gr-trellis/examples/python/test_sccc_turbo1.py
+++ b/gr-trellis/examples/python/test_sccc_turbo1.py
@@ -18,7 +18,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,
tb = gr.top_block ()
# TX
- src = gr.lfsr_32k_source_s()
+ 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)
@@ -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 40b8e03260..d7f26c4e13 100755
--- a/gr-trellis/examples/python/test_sccc_turbo2.py
+++ b/gr-trellis/examples/python/test_sccc_turbo2.py
@@ -18,7 +18,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,
tb = gr.top_block ()
# TX
- src = gr.lfsr_32k_source_s()
+ 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)
@@ -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 79e2958842..bf9710aa1c 100755
--- a/gr-trellis/examples/python/test_tcm.py
+++ b/gr-trellis/examples/python/test_tcm.py
@@ -25,7 +25,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed):
#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 = blocks.vector_source_s(packet,False)
- src = gr.lfsr_32k_source_s()
+ 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
@@ -42,7 +42,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed):
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 = blocks.vector_sink_s();
- 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_bit.py b/gr-trellis/examples/python/test_tcm_bit.py
index f921584ab9..7880f0ea53 100755
--- a/gr-trellis/examples/python/test_tcm_bit.py
+++ b/gr-trellis/examples/python/test_tcm_bit.py
@@ -25,7 +25,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed):
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 = blocks.vector_source_s(packet,False)
- #src = gr.lfsr_32k_source_s()
+ #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
@@ -44,7 +44,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed):
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 = blocks.vector_sink_s();
- #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_combined.py b/gr-trellis/examples/python/test_tcm_combined.py
index 5bce13899b..697e3cc64a 100755
--- a/gr-trellis/examples/python/test_tcm_combined.py
+++ b/gr-trellis/examples/python/test_tcm_combined.py
@@ -19,7 +19,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed):
tb = gr.top_block ()
# TX
- src = gr.lfsr_32k_source_s()
+ 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
@@ -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 f87b12c444..e4456890f0 100755
--- a/gr-trellis/examples/python/test_tcm_parallel.py
+++ b/gr-trellis/examples/python/test_tcm_parallel.py
@@ -19,7 +19,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed,P):
tb = gr.top_block ()
# TX
- src = gr.lfsr_32k_source_s()
+ 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
@@ -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 c82d8dcb41..b2d58a6014 100755
--- a/gr-trellis/examples/python/test_turbo_equalization.py
+++ b/gr-trellis/examples/python/test_turbo_equalization.py
@@ -57,7 +57,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,tot_constellat
tb = gr.top_block ()
# TX
- src = gr.lfsr_32k_source_s()
+ 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
@@ -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_viterbi_equalization.py b/gr-trellis/examples/python/test_viterbi_equalization.py
index f1e61f90cb..987f171b2a 100755
--- a/gr-trellis/examples/python/test_viterbi_equalization.py
+++ b/gr-trellis/examples/python/test_viterbi_equalization.py
@@ -17,7 +17,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,tot_constellation,N0,seed):
tb = gr.top_block ()
# TX
- src = gr.lfsr_32k_source_s()
+ 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
@@ -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))