summaryrefslogtreecommitdiff
path: root/gnuradio-examples/python/channel-coding
diff options
context:
space:
mode:
authoranastas2006-08-11 11:37:02 +0000
committeranastas2006-08-11 11:37:02 +0000
commit5014e03e3205611c4ffb1d5ec06d3710391485e3 (patch)
treea0b7f57b9e5492db0fbe82c0900c86a652fc72e5 /gnuradio-examples/python/channel-coding
parent77d25d75e11b7d574ab7073e1054cb25e66baa12 (diff)
downloadgnuradio-5014e03e3205611c4ffb1d5ec06d3710391485e3.tar.gz
gnuradio-5014e03e3205611c4ffb1d5ec06d3710391485e3.tar.bz2
gnuradio-5014e03e3205611c4ffb1d5ec06d3710391485e3.zip
Fixed some examples in gnuradio-examples/python/channel-coding, and added a README file
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@3236 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-examples/python/channel-coding')
-rw-r--r--gnuradio-examples/python/channel-coding/Makefile.am4
-rw-r--r--gnuradio-examples/python/channel-coding/README33
-rw-r--r--gnuradio-examples/python/channel-coding/fsm_files/Makefile.am33
-rw-r--r--gnuradio-examples/python/channel-coding/fsm_files/foo17
-rwxr-xr-xgnuradio-examples/python/channel-coding/test_tcm.py2
-rwxr-xr-xgnuradio-examples/python/channel-coding/test_tcm_combined.py2
6 files changed, 36 insertions, 55 deletions
diff --git a/gnuradio-examples/python/channel-coding/Makefile.am b/gnuradio-examples/python/channel-coding/Makefile.am
index 94027dc84..03a99d582 100644
--- a/gnuradio-examples/python/channel-coding/Makefile.am
+++ b/gnuradio-examples/python/channel-coding/Makefile.am
@@ -20,12 +20,10 @@
#
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
index 000000000..abfceb429
--- /dev/null
+++ b/gnuradio-examples/python/channel-coding/README
@@ -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
index 0a931b660..000000000
--- a/gnuradio-examples/python/channel-coding/fsm_files/Makefile.am
+++ /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
index b511c2b01..000000000
--- a/gnuradio-examples/python/channel-coding/fsm_files/foo
+++ /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
diff --git a/gnuradio-examples/python/channel-coding/test_tcm.py b/gnuradio-examples/python/channel-coding/test_tcm.py
index 0ba2e3c8e..1f892ef99 100755
--- a/gnuradio-examples/python/channel-coding/test_tcm.py
+++ b/gnuradio-examples/python/channel-coding/test_tcm.py
@@ -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
diff --git a/gnuradio-examples/python/channel-coding/test_tcm_combined.py b/gnuradio-examples/python/channel-coding/test_tcm_combined.py
index 01e092a0d..ce0863183 100755
--- a/gnuradio-examples/python/channel-coding/test_tcm_combined.py
+++ b/gnuradio-examples/python/channel-coding/test_tcm_combined.py
@@ -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();