diff options
Diffstat (limited to 'gr-trellis/src/examples/python/test_sccc_turbo1.py')
-rwxr-xr-x | gr-trellis/src/examples/python/test_sccc_turbo1.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gr-trellis/src/examples/python/test_sccc_turbo1.py b/gr-trellis/src/examples/python/test_sccc_turbo1.py index 187a75185f..60188e4d3b 100755 --- a/gr-trellis/src/examples/python/test_sccc_turbo1.py +++ b/gr-trellis/src/examples/python/test_sccc_turbo1.py @@ -8,6 +8,11 @@ import sys import random import fsm_utils +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,Es,N0,IT,seed): tb = gr.top_block () @@ -17,11 +22,11 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts s2fsmi = gr.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 = gr.chunks_to_symbols_sf(constellation,dimensionality) + mod = digital.chunks_to_symbols_sf(constellation,dimensionality) # CHANNEL add = gr.add_ff() - noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) + noise = analog.noise_source_f(analog.GR_GAUSSIAN,math.sqrt(N0/2),seed) # 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) |