summaryrefslogtreecommitdiff
path: root/gr-trellis/src/examples/python/test_turbo_equalization.py
diff options
context:
space:
mode:
Diffstat (limited to 'gr-trellis/src/examples/python/test_turbo_equalization.py')
-rwxr-xr-xgr-trellis/src/examples/python/test_turbo_equalization.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/gr-trellis/src/examples/python/test_turbo_equalization.py b/gr-trellis/src/examples/python/test_turbo_equalization.py
index 18bfb022a9..baddd7cb50 100755
--- a/gr-trellis/src/examples/python/test_turbo_equalization.py
+++ b/gr-trellis/src/examples/python/test_turbo_equalization.py
@@ -7,6 +7,11 @@ import math
import sys
import fsm_utils
+try:
+ from gnuradio import analog
+except ImportError:
+ sys.stderr.write("Error: Program requires gr-analog.\n")
+ sys.exit(1)
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
@@ -59,11 +64,11 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,tot_constellat
inter = trellis.permutation(interleaver.K(),interleaver.INTER(),1,gr.sizeof_short)
enc_in = trellis.encoder_ss(fi,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 innner FSM)
- mod = gr.chunks_to_symbols_sf(tot_constellation,dimensionality)
+ mod = digital.chunks_to_symbols_sf(tot_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
(head,tail) = make_rx(tb,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,trellis.TRELLIS_MIN_SUM)