diff options
author | Tom Rondeau <trondeau@vt.edu> | 2013-03-17 12:24:38 -0400 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2013-03-17 15:40:32 -0400 |
commit | d4f6b86a9bdea09c2c158b9982559a727f8c6a0b (patch) | |
tree | 60b452d387bd494b461ee78b2b0faec1fbf6e5fe /gr-trellis/examples/python | |
parent | ee2b700f72503d6e7f62adbfb7dff9997b9cb003 (diff) |
blocks: converting references to vector source/sink, null source/sink, nop, copy, head, skiphead, vector_map, and annotator blocks to use gr-blocks.
Diffstat (limited to 'gr-trellis/examples/python')
-rwxr-xr-x | gr-trellis/examples/python/test_cpm.py | 14 | ||||
-rwxr-xr-x | gr-trellis/examples/python/test_pccc_turbo1.py | 6 | ||||
-rwxr-xr-x | gr-trellis/examples/python/test_sccc_hard.py | 2 | ||||
-rwxr-xr-x | gr-trellis/examples/python/test_sccc_soft.py | 4 | ||||
-rwxr-xr-x | gr-trellis/examples/python/test_sccc_turbo.py | 4 | ||||
-rwxr-xr-x | gr-trellis/examples/python/test_sccc_turbo1.py | 2 | ||||
-rwxr-xr-x | gr-trellis/examples/python/test_sccc_turbo2.py | 2 | ||||
-rwxr-xr-x | gr-trellis/examples/python/test_tcm.py | 6 | ||||
-rwxr-xr-x | gr-trellis/examples/python/test_tcm_bit.py | 6 | ||||
-rwxr-xr-x | gr-trellis/examples/python/test_tcm_combined.py | 2 | ||||
-rwxr-xr-x | gr-trellis/examples/python/test_tcm_parallel.py | 2 | ||||
-rwxr-xr-x | gr-trellis/examples/python/test_turbo_equalization.py | 4 | ||||
-rwxr-xr-x | gr-trellis/examples/python/test_turbo_equalization1.py | 6 | ||||
-rwxr-xr-x | gr-trellis/examples/python/test_turbo_equalization2.py | 6 | ||||
-rwxr-xr-x | gr-trellis/examples/python/test_viterbi_equalization.py | 2 | ||||
-rwxr-xr-x | gr-trellis/examples/python/test_viterbi_equalization1.py | 6 |
16 files changed, 37 insertions, 37 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..8234726be0 100755 --- a/gr-trellis/examples/python/test_pccc_turbo1.py +++ b/gr-trellis/examples/python/test_pccc_turbo1.py @@ -20,11 +20,11 @@ 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_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 diff --git a/gr-trellis/examples/python/test_sccc_hard.py b/gr-trellis/examples/python/test_sccc_hard.py index ec1fdd1bc5..6cb85111a3 100755 --- a/gr-trellis/examples/python/test_sccc_hard.py +++ b/gr-trellis/examples/python/test_sccc_hard.py @@ -20,7 +20,7 @@ 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_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) diff --git a/gr-trellis/examples/python/test_sccc_soft.py b/gr-trellis/examples/python/test_sccc_soft.py index f663c9befd..782d2f9134 100755 --- a/gr-trellis/examples/python/test_sccc_soft.py +++ b/gr-trellis/examples/python/test_sccc_soft.py @@ -20,7 +20,7 @@ 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_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,7 +33,7 @@ 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. diff --git a/gr-trellis/examples/python/test_sccc_turbo.py b/gr-trellis/examples/python/test_sccc_turbo.py index cd974e9941..2a1e742a3b 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=[] @@ -60,7 +60,7 @@ 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_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) diff --git a/gr-trellis/examples/python/test_sccc_turbo1.py b/gr-trellis/examples/python/test_sccc_turbo1.py index 93833ec7df..6c5a01d681 100755 --- a/gr-trellis/examples/python/test_sccc_turbo1.py +++ b/gr-trellis/examples/python/test_sccc_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_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts + 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) diff --git a/gr-trellis/examples/python/test_sccc_turbo2.py b/gr-trellis/examples/python/test_sccc_turbo2.py index 116a2ca6b2..40b8e03260 100755 --- a/gr-trellis/examples/python/test_sccc_turbo2.py +++ b/gr-trellis/examples/python/test_sccc_turbo2.py @@ -19,7 +19,7 @@ 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_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) diff --git a/gr-trellis/examples/python/test_tcm.py b/gr-trellis/examples/python/test_tcm.py index 8a815ae12a..79e2958842 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 = blocks.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_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,7 +41,7 @@ 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 = blocks.vector_sink_s(); dst = gr.check_lfsr_32k_s() diff --git a/gr-trellis/examples/python/test_tcm_bit.py b/gr-trellis/examples/python/test_tcm_bit.py index 6308df1d09..f921584ab9 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 = blocks.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_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,7 +43,7 @@ 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 = blocks.vector_sink_s(); #dst = gr.check_lfsr_32k_s(); diff --git a/gr-trellis/examples/python/test_tcm_combined.py b/gr-trellis/examples/python/test_tcm_combined.py index 198d038ce3..5bce13899b 100755 --- a/gr-trellis/examples/python/test_tcm_combined.py +++ b/gr-trellis/examples/python/test_tcm_combined.py @@ -20,7 +20,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): # TX src = gr.lfsr_32k_source_s() - src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts + 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) diff --git a/gr-trellis/examples/python/test_tcm_parallel.py b/gr-trellis/examples/python/test_tcm_parallel.py index d2527956e9..f87b12c444 100755 --- a/gr-trellis/examples/python/test_tcm_parallel.py +++ b/gr-trellis/examples/python/test_tcm_parallel.py @@ -20,7 +20,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed,P): # TX src = gr.lfsr_32k_source_s() - src_head = gr.head (gr.sizeof_short,Kb/16*P) # packet size in shorts + 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 diff --git a/gr-trellis/examples/python/test_turbo_equalization.py b/gr-trellis/examples/python/test_turbo_equalization.py index 41361fd3db..c82d8dcb41 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=[] @@ -58,7 +58,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,tot_constellat # TX src = gr.lfsr_32k_source_s() - src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts + 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) 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..f1e61f90cb 100755 --- a/gr-trellis/examples/python/test_viterbi_equalization.py +++ b/gr-trellis/examples/python/test_viterbi_equalization.py @@ -18,7 +18,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,tot_constellation,N0,seed): # TX src = gr.lfsr_32k_source_s() - src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts + 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) 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)) |