Fixed some examples in gnuradio-examples/python/channel-coding, and added a README...
authoranastas <anastas@221aa14e-8319-0410-a670-987f0aec2ac5>
Fri, 11 Aug 2006 11:37:02 +0000 (11:37 +0000)
committeranastas <anastas@221aa14e-8319-0410-a670-987f0aec2ac5>
Fri, 11 Aug 2006 11:37:02 +0000 (11:37 +0000)
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@3236 221aa14e-8319-0410-a670-987f0aec2ac5

config/grc_gnuradio_examples.m4
gnuradio-examples/python/Makefile.am
gnuradio-examples/python/channel-coding/Makefile.am
gnuradio-examples/python/channel-coding/README [new file with mode: 0644]
gnuradio-examples/python/channel-coding/fsm_files/Makefile.am [deleted file]
gnuradio-examples/python/channel-coding/fsm_files/foo [deleted file]
gnuradio-examples/python/channel-coding/test_tcm.py
gnuradio-examples/python/channel-coding/test_tcm_combined.py

index 18afb6827e59653a7dd61e1ac2c04d996ae47cec..649dd27a00a1be5aa0ee036ad5eb4ea208ec7ad9 100644 (file)
@@ -24,6 +24,7 @@ AC_DEFUN([GRC_GNURADIO_EXAMPLES],[
         gnuradio-examples/Makefile \
         gnuradio-examples/python/Makefile \
         gnuradio-examples/python/audio/Makefile \
+        gnuradio-examples/python/channel-coding/Makefile \
         gnuradio-examples/python/digital_voice/Makefile \
         gnuradio-examples/python/gmsk2/Makefile \
         gnuradio-examples/python/mc4020/Makefile \
index ae2c5288640a92e3a80454e2c2b3448f5b637cf4..a7c9ec8d119d04336ef26cd81ead139ad5dcca5a 100644 (file)
@@ -19,4 +19,4 @@
 # Boston, MA 02111-1307, USA.
 # 
 
-SUBDIRS = audio digital_voice gmsk2 mc4020 multi_usrp usrp channel-coding
+SUBDIRS = audio channel-coding digital_voice gmsk2 mc4020 multi_usrp usrp 
index 94027dc84adf4ae8cdc045a07c3071361b4a3b4f..03a99d5827061a086ace4c49eb4867e02126a87f 100644 (file)
 # 
 
 EXTRA_DIST =                   \
+        README                 \
        fsm_utils.py            \
        test_tcm.py             \
        test_tcm1.py            \
        test_tcm_parallel.py    \
        test_tcm_combined.py    \
        test_sccc_hard.py
-
-
-SUBDIRS = fsm_files
diff --git a/gnuradio-examples/python/channel-coding/README b/gnuradio-examples/python/channel-coding/README
new file mode 100644 (file)
index 0000000..abfceb4
--- /dev/null
@@ -0,0 +1,33 @@
+Here we have several test programs for use with the gr-trellis implementation.
+Documentation can be found in 
+http://gnuradio.utah.edu/svn/gnuradio/trunk/gr-trellis/doc/gr-trellis.html
+
+fsm_utils.py contains several useful functions.
+
+fsm_files is a directory with some FSM definitions
+
+If you just want to see what these programs do, run each of the following:
+
+./test_tcm.py fsm_files/awgn1o2_4.fsm 10.0 1000
+./test_tcm1.py fsm_files/awgn1o2_4.fsm 10.0 1000
+./test_tcm_combined.py fsm_files/awgn1o2_4.fsm 10.0 1000
+./test_tcm_parallel.py fsm_files/awgn1o2_4.fsm 10.0 1000
+./test_sccc_hard.py fsm_files/awgn1o2_4.fsm fsm_files/awgn1o2_4.fsm 10.0 1000
+
+In your terminal you will see something like this:
+
+[anastas@ernesto channel-coding]$ ./test_tcm.py fsm_files/awgn1o2_4.fsm 6.0 1000
+100 1024 1 103424 10 9.668936e-05
+200 1024 1 205824 21 1.020289e-04
+300 1024 0 308224 40 1.297757e-04
+400 1024 0 410624 1074 2.615531e-03
+500 1024 0 513024 1081 2.107114e-03
+600 1024 0 615424 1090 1.771137e-03
+700 1024 0 717824 1097 1.528230e-03
+800 1024 0 820224 1107 1.349631e-03
+900 1024 0 922624 1120 1.213929e-03
+1024000 1129 1.102539e-03
+
+1.102539e-03 is the error rate estimates by sending 1000 packets of
+1024x16 bits each using an 1/2 4-state convolutional code and QPSK
+modulation through an AWGN with Es/N0 = 6.0 dB
diff --git a/gnuradio-examples/python/channel-coding/fsm_files/Makefile.am b/gnuradio-examples/python/channel-coding/fsm_files/Makefile.am
deleted file mode 100644 (file)
index 0a931b6..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Copyright 2004 Free Software Foundation, Inc.
-# 
-# This file is part of GNU Radio
-# 
-# GNU Radio is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-# 
-# GNU Radio is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# 
-# You should have received a copy of the GNU General Public License
-# along with GNU Radio; see the file COPYING.  If not, write to
-# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-# 
-
-EXTRA_DIST =                   \
-       awgn1o2_4.fsm           \
-       awgn1o2_8.fsm           \
-       awgn1o2_16.fsm          \
-       awgn1o2_128.fsm         \
-       awgn2o3_4.fsm           \
-       awgn2o3_4_1.fsm         \
-       awgn2o3_16.fsm          \
-       awgn2o3_8.fsm           \
-       awgn2o4_4.fsm           \
-       rep3.fsm                \
-       rep5.fsm
diff --git a/gnuradio-examples/python/channel-coding/fsm_files/foo b/gnuradio-examples/python/channel-coding/fsm_files/foo
deleted file mode 100644 (file)
index b511c2b..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-" Press ? for keyboard shortcuts
-" Sorted by name (.bak,~,.o,.h,.info,.swp,.obj at end of list)
-"= /home/anastas/gnuradio_svn/gnuradio-examples/python/channel-coding/fsm_files/
-../
-.svn/
-Makefile.am
-awgn1o2_128.fsm
-awgn1o2_16.fsm
-awgn1o2_4.fsm
-awgn1o2_8.fsm
-awgn2o3_16.fsm
-awgn2o3_4.fsm
-awgn2o3_4_1.fsm
-awgn2o3_8.fsm
-awgn2o4_4.fsm
-rep3.fsm
-rep5.fsm
index 0ba2e3c8ef08d63cb5f8e5f151fe9be879eb621e..1f892ef996b0da94e2a70c817837a993f1362ede 100755 (executable)
@@ -83,7 +83,7 @@ def main(args):
 
     # system parameters
     f=trellis.fsm(fname) # get the FSM specification from a file
-    Kb=1*16  # packet size in bits (make it multiple of 16 so it can be packed in a short)
+    Kb=1024*16  # packet size in bits (make it multiple of 16 so it can be packed in a short)
     bitspersymbol = int(round(math.log(f.I())/math.log(2))) # bits per FSM input symbol
     K=Kb/bitspersymbol # packet size in trellis steps
     modulation = fsm_utils.psk4 # see fsm_utlis.py for available predefined modulations
index 01e092a0d118e3686c292420d40eb888c73cee43..ce08631831e1a649ded73ce5e5c41ee072191533 100755 (executable)
@@ -25,7 +25,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed):
 
     
     # RX
-    va = trellis.viterbi_combined_s(f,dimensionality,constellation,K/bitspersymbol,0,7,trellis.TRELLIS_EUCLIDEAN) # Put -1 if the Initial/Final states are not set.
+    va = trellis.viterbi_combined_s(f,dimensionality,constellation,K/bitspersymbol,0,-1,trellis.TRELLIS_EUCLIDEAN) # Put -1 if the Initial/Final states are not set.
     fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts
     dst = gr.check_lfsr_32k_s();