summaryrefslogtreecommitdiff
path: root/gnuradio-examples/python/channel-coding/test_sccc_turbo.py
diff options
context:
space:
mode:
authoranastas2006-08-30 18:24:23 +0000
committeranastas2006-08-30 18:24:23 +0000
commit2dd336e418b5459558e7590e2d72347b1b689522 (patch)
tree4203e6ba335799098874d51f56c36396ef4a8588 /gnuradio-examples/python/channel-coding/test_sccc_turbo.py
parentea554bd9003efc6fe32619f49962fd18ec65b9f2 (diff)
downloadgnuradio-2dd336e418b5459558e7590e2d72347b1b689522.tar.gz
gnuradio-2dd336e418b5459558e7590e2d72347b1b689522.tar.bz2
gnuradio-2dd336e418b5459558e7590e2d72347b1b689522.zip
More turbo equalization examples
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@3451 221aa14e-8319-0410-a670-987f0aec2ac5
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])