summaryrefslogtreecommitdiff
path: root/gnuradio-examples/python/channel-coding/test_sccc_turbo.py
diff options
context:
space:
mode:
Diffstat (limited to 'gnuradio-examples/python/channel-coding/test_sccc_turbo.py')
-rwxr-xr-xgnuradio-examples/python/channel-coding/test_sccc_turbo.py36
1 files changed, 20 insertions, 16 deletions
diff --git a/gnuradio-examples/python/channel-coding/test_sccc_turbo.py b/gnuradio-examples/python/channel-coding/test_sccc_turbo.py
index cdd1ad8b0..f67fb0922 100755
--- a/gnuradio-examples/python/channel-coding/test_sccc_turbo.py
+++ b/gnuradio-examples/python/channel-coding/test_sccc_turbo.py
@@ -21,29 +21,33 @@ def make_rx(fg,fo,fi,dimensionality,constellation,K,interleaver,IT,Es,N0,type):
siso_in=[]
siso_out=[]
- for it in range(IT-1):
+ # generate all blocks
+ for it in range(IT):
inter.append( trellis.permutation(interleaver.K(),interleaver.INTER(),fi.I(),gr.sizeof_float) )
- siso_in.append( trellis.siso_f(fi,K,0,3,True,False,type) )
+ siso_in.append( trellis.siso_f(fi,K,0,-1,True,False,type) )
deinter.append( trellis.permutation(interleaver.K(),interleaver.DEINTER(),fi.I(),gr.sizeof_float) )
- siso_out.append( trellis.siso_f(fo,K,0,3,False,True,type) )
- fg.connect (inter[it],(siso_in[it],0))
- fg.connect (gnd,(siso_out[it],0))
- fg.connect (siso_in[it],deinter[it],(siso_out[it],1))
-
- inter.append( trellis.permutation(interleaver.K(),interleaver.INTER(),fi.I(),gr.sizeof_float) )
- siso_in.append( trellis.siso_f(fi,K,0,-1,True,False,type) )
- deinter.append( trellis.permutation(interleaver.K(),interleaver.DEINTER(),fi.I(),gr.sizeof_float) )
- siso_out.append( trellis.viterbi_s(fo,K,0,-1) )
- fg.connect (inter[IT-1],(siso_in[IT-1],0))
- fg.connect (siso_in[IT-1],deinter[IT-1],siso_out[IT-1])
+ if it < IT-1:
+ siso_out.append( trellis.siso_f(fo,K,0,-1,False,True,type) )
+ else:
+ siso_out.append( trellis.viterbi_s(fo,K,0,-1) ) # no soft outputs needed
# connect first stage
fg.connect (gnd,inter[0])
fg.connect (metrics_in,scale)
fg.connect (scale,(siso_in[0],1))
- for it in range(IT-1):
- fg.connect (siso_out[it],inter[it+1])
- fg.connect (metrics_in,(siso_in[it+1],1))
+
+ # connect the rest
+ for it in range(IT):
+ if it < IT-1:
+ fg.connect (metrics_in,(siso_in[it+1],1))
+ fg.connect (siso_in[it],deinter[it],(siso_out[it],1))
+ fg.connect (gnd,(siso_out[it],0))
+ fg.connect (siso_out[it],inter[it+1])
+ fg.connect (inter[it],(siso_in[it],0))
+ else:
+ fg.connect (siso_in[it],deinter[it],siso_out[it])
+ fg.connect (inter[it],(siso_in[it],0))
+
return (metrics_in,siso_out[IT-1])