diff options
Diffstat (limited to 'gr-trellis/src')
103 files changed, 7003 insertions, 2172 deletions
diff --git a/gr-trellis/src/.gitignore b/gr-trellis/src/.gitignore deleted file mode 100644 index bb3f27777..000000000 --- a/gr-trellis/src/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -/Makefile -/Makefile.in -/.la -/.lo -/.deps -/.libs -/*.la -/*.lo -/howto.cc -/howto.py diff --git a/gr-trellis/src/examples/.gitignore b/gr-trellis/src/examples/.gitignore deleted file mode 100644 index c400497f5..000000000 --- a/gr-trellis/src/examples/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -/Makefile -/Makefile.in -/.la -/.lo -/.deps -/.libs -/*.la -/*.lo -/*.pyc -/*.pyo diff --git a/gr-trellis/src/examples/Makefile.am b/gr-trellis/src/examples/Makefile.am deleted file mode 100644 index 92aeadfad..000000000 --- a/gr-trellis/src/examples/Makefile.am +++ /dev/null @@ -1,43 +0,0 @@ -# -# Copyright 2004,2009 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 3, 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., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -include $(top_srcdir)/Makefile.common - -SUBDIRS = fsm_files - -ourdatadir = $(exampledir)/trellis - -dist_ourdata_DATA = \ - README - -dist_ourdata_SCRIPTS = \ - fsm_utils.py \ - test_tcm.py \ - test_tcm_parallel.py \ - test_tcm_combined.py \ - test_sccc_hard.py \ - test_sccc_soft.py \ - test_sccc_turbo.py \ - test_viterbi_equalization1.py \ - test_viterbi_equalization.py \ - test_turbo_equalization.py \ - test_turbo_equalization1.py \ - test_turbo_equalization2.py diff --git a/gr-trellis/src/examples/fsm_files/.gitignore b/gr-trellis/src/examples/fsm_files/.gitignore deleted file mode 100644 index b336cc7ce..000000000 --- a/gr-trellis/src/examples/fsm_files/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/Makefile -/Makefile.in diff --git a/gr-trellis/src/examples/fsm_files/Makefile.am b/gr-trellis/src/examples/fsm_files/Makefile.am deleted file mode 100644 index c4cbb2e93..000000000 --- a/gr-trellis/src/examples/fsm_files/Makefile.am +++ /dev/null @@ -1,40 +0,0 @@ -# -# Copyright 2004,2009 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 3, 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., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -include $(top_srcdir)/Makefile.common - -ourdatadir = $(exampledir)/trellis/fsm_files - -dist_ourdata_DATA = \ - awgn1o2_128.fsm \ - awgn1o2_16.fsm \ - awgn1o2_4.fsm \ - awgn1o2_8.fsm \ - awgn2o3_16.fsm \ - awgn2o3_4.fsm \ - awgn2o3_4_msb.fsm \ - awgn2o3_4_msbG.fsm \ - awgn2o3_8.fsm \ - awgn2o4_4.fsm \ - disconnected.fsm \ - rep3.fsm \ - rep5.fsm \ - simple.fsm diff --git a/gr-trellis/src/examples/fsm_files/awgn1o2_128.fsm b/gr-trellis/src/examples/fsm_files/awgn1o2_128.fsm deleted file mode 100644 index bb79c59da..000000000 --- a/gr-trellis/src/examples/fsm_files/awgn1o2_128.fsm +++ /dev/null @@ -1,265 +0,0 @@ -2 128 4 - -0 64 -0 64 -1 65 -1 65 -2 66 -2 66 -3 67 -3 67 -4 68 -4 68 -5 69 -5 69 -6 70 -6 70 -7 71 -7 71 -8 72 -8 72 -9 73 -9 73 -10 74 -10 74 -11 75 -11 75 -12 76 -12 76 -13 77 -13 77 -14 78 -14 78 -15 79 -15 79 -16 80 -16 80 -17 81 -17 81 -18 82 -18 82 -19 83 -19 83 -20 84 -20 84 -21 85 -21 85 -22 86 -22 86 -23 87 -23 87 -24 88 -24 88 -25 89 -25 89 -26 90 -26 90 -27 91 -27 91 -28 92 -28 92 -29 93 -29 93 -30 94 -30 94 -31 95 -31 95 -32 96 -32 96 -33 97 -33 97 -34 98 -34 98 -35 99 -35 99 -36 100 -36 100 -37 101 -37 101 -38 102 -38 102 -39 103 -39 103 -40 104 -40 104 -41 105 -41 105 -42 106 -42 106 -43 107 -43 107 -44 108 -44 108 -45 109 -45 109 -46 110 -46 110 -47 111 -47 111 -48 112 -48 112 -49 113 -49 113 -50 114 -50 114 -51 115 -51 115 -52 116 -52 116 -53 117 -53 117 -54 118 -54 118 -55 119 -55 119 -56 120 -56 120 -57 121 -57 121 -58 122 -58 122 -59 123 -59 123 -60 124 -60 124 -61 125 -61 125 -62 126 -62 126 -63 127 -63 127 - -0 3 -3 0 -1 2 -2 1 -3 0 -0 3 -2 1 -1 2 -1 2 -2 1 -0 3 -3 0 -2 1 -1 2 -3 0 -0 3 -1 2 -2 1 -0 3 -3 0 -2 1 -1 2 -3 0 -0 3 -0 3 -3 0 -1 2 -2 1 -3 0 -0 3 -2 1 -1 2 -2 1 -1 2 -3 0 -0 3 -1 2 -2 1 -0 3 -3 0 -3 0 -0 3 -2 1 -1 2 -0 3 -3 0 -1 2 -2 1 -3 0 -0 3 -2 1 -1 2 -0 3 -3 0 -1 2 -2 1 -2 1 -1 2 -3 0 -0 3 -1 2 -2 1 -0 3 -3 0 -2 1 -1 2 -3 0 -0 3 -1 2 -2 1 -0 3 -3 0 -3 0 -0 3 -2 1 -1 2 -0 3 -3 0 -1 2 -2 1 -3 0 -0 3 -2 1 -1 2 -0 3 -3 0 -1 2 -2 1 -2 1 -1 2 -3 0 -0 3 -1 2 -2 1 -0 3 -3 0 -0 3 -3 0 -1 2 -2 1 -3 0 -0 3 -2 1 -1 2 -1 2 -2 1 -0 3 -3 0 -2 1 -1 2 -3 0 -0 3 -1 2 -2 1 -0 3 -3 0 -2 1 -1 2 -3 0 -0 3 -0 3 -3 0 -1 2 -2 1 -3 0 -0 3 -2 1 -1 2 - - - -GM1o2_128=[1+D+D^2+D^5+D^7 1+D^3+D^4+D^5+D^6+D^7] - =[11100101 10011111] - =[229 159] diff --git a/gr-trellis/src/examples/fsm_files/joint_16_16.fsm b/gr-trellis/src/examples/fsm_files/joint_16_16.fsm deleted file mode 100644 index 3dae314b6..000000000 --- a/gr-trellis/src/examples/fsm_files/joint_16_16.fsm +++ /dev/null @@ -1,523 +0,0 @@ -4 256 16 - -0 8 128 136 -0 8 128 136 -1 9 129 137 -1 9 129 137 -2 10 130 138 -2 10 130 138 -3 11 131 139 -3 11 131 139 -4 12 132 140 -4 12 132 140 -5 13 133 141 -5 13 133 141 -6 14 134 142 -6 14 134 142 -7 15 135 143 -7 15 135 143 -0 8 128 136 -0 8 128 136 -1 9 129 137 -1 9 129 137 -2 10 130 138 -2 10 130 138 -3 11 131 139 -3 11 131 139 -4 12 132 140 -4 12 132 140 -5 13 133 141 -5 13 133 141 -6 14 134 142 -6 14 134 142 -7 15 135 143 -7 15 135 143 -16 24 144 152 -16 24 144 152 -17 25 145 153 -17 25 145 153 -18 26 146 154 -18 26 146 154 -19 27 147 155 -19 27 147 155 -20 28 148 156 -20 28 148 156 -21 29 149 157 -21 29 149 157 -22 30 150 158 -22 30 150 158 -23 31 151 159 -23 31 151 159 -16 24 144 152 -16 24 144 152 -17 25 145 153 -17 25 145 153 -18 26 146 154 -18 26 146 154 -19 27 147 155 -19 27 147 155 -20 28 148 156 -20 28 148 156 -21 29 149 157 -21 29 149 157 -22 30 150 158 -22 30 150 158 -23 31 151 159 -23 31 151 159 -32 40 160 168 -32 40 160 168 -33 41 161 169 -33 41 161 169 -34 42 162 170 -34 42 162 170 -35 43 163 171 -35 43 163 171 -36 44 164 172 -36 44 164 172 -37 45 165 173 -37 45 165 173 -38 46 166 174 -38 46 166 174 -39 47 167 175 -39 47 167 175 -32 40 160 168 -32 40 160 168 -33 41 161 169 -33 41 161 169 -34 42 162 170 -34 42 162 170 -35 43 163 171 -35 43 163 171 -36 44 164 172 -36 44 164 172 -37 45 165 173 -37 45 165 173 -38 46 166 174 -38 46 166 174 -39 47 167 175 -39 47 167 175 -48 56 176 184 -48 56 176 184 -49 57 177 185 -49 57 177 185 -50 58 178 186 -50 58 178 186 -51 59 179 187 -51 59 179 187 -52 60 180 188 -52 60 180 188 -53 61 181 189 -53 61 181 189 -54 62 182 190 -54 62 182 190 -55 63 183 191 -55 63 183 191 -48 56 176 184 -48 56 176 184 -49 57 177 185 -49 57 177 185 -50 58 178 186 -50 58 178 186 -51 59 179 187 -51 59 179 187 -52 60 180 188 -52 60 180 188 -53 61 181 189 -53 61 181 189 -54 62 182 190 -54 62 182 190 -55 63 183 191 -55 63 183 191 -64 72 192 200 -64 72 192 200 -65 73 193 201 -65 73 193 201 -66 74 194 202 -66 74 194 202 -67 75 195 203 -67 75 195 203 -68 76 196 204 -68 76 196 204 -69 77 197 205 -69 77 197 205 -70 78 198 206 -70 78 198 206 -71 79 199 207 -71 79 199 207 -64 72 192 200 -64 72 192 200 -65 73 193 201 -65 73 193 201 -66 74 194 202 -66 74 194 202 -67 75 195 203 -67 75 195 203 -68 76 196 204 -68 76 196 204 -69 77 197 205 -69 77 197 205 -70 78 198 206 -70 78 198 206 -71 79 199 207 -71 79 199 207 -80 88 208 216 -80 88 208 216 -81 89 209 217 -81 89 209 217 -82 90 210 218 -82 90 210 218 -83 91 211 219 -83 91 211 219 -84 92 212 220 -84 92 212 220 -85 93 213 221 -85 93 213 221 -86 94 214 222 -86 94 214 222 -87 95 215 223 -87 95 215 223 -80 88 208 216 -80 88 208 216 -81 89 209 217 -81 89 209 217 -82 90 210 218 -82 90 210 218 -83 91 211 219 -83 91 211 219 -84 92 212 220 -84 92 212 220 -85 93 213 221 -85 93 213 221 -86 94 214 222 -86 94 214 222 -87 95 215 223 -87 95 215 223 -96 104 224 232 -96 104 224 232 -97 105 225 233 -97 105 225 233 -98 106 226 234 -98 106 226 234 -99 107 227 235 -99 107 227 235 -100 108 228 236 -100 108 228 236 -101 109 229 237 -101 109 229 237 -102 110 230 238 -102 110 230 238 -103 111 231 239 -103 111 231 239 -96 104 224 232 -96 104 224 232 -97 105 225 233 -97 105 225 233 -98 106 226 234 -98 106 226 234 -99 107 227 235 -99 107 227 235 -100 108 228 236 -100 108 228 236 -101 109 229 237 -101 109 229 237 -102 110 230 238 -102 110 230 238 -103 111 231 239 -103 111 231 239 -112 120 240 248 -112 120 240 248 -113 121 241 249 -113 121 241 249 -114 122 242 250 -114 122 242 250 -115 123 243 251 -115 123 243 251 -116 124 244 252 -116 124 244 252 -117 125 245 253 -117 125 245 253 -118 126 246 254 -118 126 246 254 -119 127 247 255 -119 127 247 255 -112 120 240 248 -112 120 240 248 -113 121 241 249 -113 121 241 249 -114 122 242 250 -114 122 242 250 -115 123 243 251 -115 123 243 251 -116 124 244 252 -116 124 244 252 -117 125 245 253 -117 125 245 253 -118 126 246 254 -118 126 246 254 -119 127 247 255 -119 127 247 255 - -0 3 12 15 -3 0 15 12 -1 2 13 14 -2 1 14 13 -1 2 13 14 -2 1 14 13 -0 3 12 15 -3 0 15 12 -2 1 14 13 -1 2 13 14 -3 0 15 12 -0 3 12 15 -3 0 15 12 -0 3 12 15 -2 1 14 13 -1 2 13 14 -12 15 0 3 -15 12 3 0 -13 14 1 2 -14 13 2 1 -13 14 1 2 -14 13 2 1 -12 15 0 3 -15 12 3 0 -14 13 2 1 -13 14 1 2 -15 12 3 0 -12 15 0 3 -15 12 3 0 -12 15 0 3 -14 13 2 1 -13 14 1 2 -4 7 8 11 -7 4 11 8 -5 6 9 10 -6 5 10 9 -5 6 9 10 -6 5 10 9 -4 7 8 11 -7 4 11 8 -6 5 10 9 -5 6 9 10 -7 4 11 8 -4 7 8 11 -7 4 11 8 -4 7 8 11 -6 5 10 9 -5 6 9 10 -8 11 4 7 -11 8 7 4 -9 10 5 6 -10 9 6 5 -9 10 5 6 -10 9 6 5 -8 11 4 7 -11 8 7 4 -10 9 6 5 -9 10 5 6 -11 8 7 4 -8 11 4 7 -11 8 7 4 -8 11 4 7 -10 9 6 5 -9 10 5 6 -4 7 8 11 -7 4 11 8 -5 6 9 10 -6 5 10 9 -5 6 9 10 -6 5 10 9 -4 7 8 11 -7 4 11 8 -6 5 10 9 -5 6 9 10 -7 4 11 8 -4 7 8 11 -7 4 11 8 -4 7 8 11 -6 5 10 9 -5 6 9 10 -8 11 4 7 -11 8 7 4 -9 10 5 6 -10 9 6 5 -9 10 5 6 -10 9 6 5 -8 11 4 7 -11 8 7 4 -10 9 6 5 -9 10 5 6 -11 8 7 4 -8 11 4 7 -11 8 7 4 -8 11 4 7 -10 9 6 5 -9 10 5 6 -0 3 12 15 -3 0 15 12 -1 2 13 14 -2 1 14 13 -1 2 13 14 -2 1 14 13 -0 3 12 15 -3 0 15 12 -2 1 14 13 -1 2 13 14 -3 0 15 12 -0 3 12 15 -3 0 15 12 -0 3 12 15 -2 1 14 13 -1 2 13 14 -12 15 0 3 -15 12 3 0 -13 14 1 2 -14 13 2 1 -13 14 1 2 -14 13 2 1 -12 15 0 3 -15 12 3 0 -14 13 2 1 -13 14 1 2 -15 12 3 0 -12 15 0 3 -15 12 3 0 -12 15 0 3 -14 13 2 1 -13 14 1 2 -8 11 4 7 -11 8 7 4 -9 10 5 6 -10 9 6 5 -9 10 5 6 -10 9 6 5 -8 11 4 7 -11 8 7 4 -10 9 6 5 -9 10 5 6 -11 8 7 4 -8 11 4 7 -11 8 7 4 -8 11 4 7 -10 9 6 5 -9 10 5 6 -4 7 8 11 -7 4 11 8 -5 6 9 10 -6 5 10 9 -5 6 9 10 -6 5 10 9 -4 7 8 11 -7 4 11 8 -6 5 10 9 -5 6 9 10 -7 4 11 8 -4 7 8 11 -7 4 11 8 -4 7 8 11 -6 5 10 9 -5 6 9 10 -12 15 0 3 -15 12 3 0 -13 14 1 2 -14 13 2 1 -13 14 1 2 -14 13 2 1 -12 15 0 3 -15 12 3 0 -14 13 2 1 -13 14 1 2 -15 12 3 0 -12 15 0 3 -15 12 3 0 -12 15 0 3 -14 13 2 1 -13 14 1 2 -0 3 12 15 -3 0 15 12 -1 2 13 14 -2 1 14 13 -1 2 13 14 -2 1 14 13 -0 3 12 15 -3 0 15 12 -2 1 14 13 -1 2 13 14 -3 0 15 12 -0 3 12 15 -3 0 15 12 -0 3 12 15 -2 1 14 13 -1 2 13 14 -12 15 0 3 -15 12 3 0 -13 14 1 2 -14 13 2 1 -13 14 1 2 -14 13 2 1 -12 15 0 3 -15 12 3 0 -14 13 2 1 -13 14 1 2 -15 12 3 0 -12 15 0 3 -15 12 3 0 -12 15 0 3 -14 13 2 1 -13 14 1 2 -0 3 12 15 -3 0 15 12 -1 2 13 14 -2 1 14 13 -1 2 13 14 -2 1 14 13 -0 3 12 15 -3 0 15 12 -2 1 14 13 -1 2 13 14 -3 0 15 12 -0 3 12 15 -3 0 15 12 -0 3 12 15 -2 1 14 13 -1 2 13 14 -8 11 4 7 -11 8 7 4 -9 10 5 6 -10 9 6 5 -9 10 5 6 -10 9 6 5 -8 11 4 7 -11 8 7 4 -10 9 6 5 -9 10 5 6 -11 8 7 4 -8 11 4 7 -11 8 7 4 -8 11 4 7 -10 9 6 5 -9 10 5 6 -4 7 8 11 -7 4 11 8 -5 6 9 10 -6 5 10 9 -5 6 9 10 -6 5 10 9 -4 7 8 11 -7 4 11 8 -6 5 10 9 -5 6 9 10 -7 4 11 8 -4 7 8 11 -7 4 11 8 -4 7 8 11 -6 5 10 9 -5 6 9 10 - -This is the joint trellis of two trellises described in awgn1o2_16.fsm -It is useful for application of joint decoding... -It can be generated in python as follows: -> import trellis -> f1=trellis.fsm('awgn1o2_16.fsm') -> f=trellis.fsm(f1,f1) -> f.write_fsm_txt('joint_16_16.fsm') diff --git a/gr-trellis/src/examples/fsm_files/joint_4_16.fsm b/gr-trellis/src/examples/fsm_files/joint_4_16.fsm deleted file mode 100644 index 8f2cdab81..000000000 --- a/gr-trellis/src/examples/fsm_files/joint_4_16.fsm +++ /dev/null @@ -1,141 +0,0 @@ -4 64 16 - -0 8 32 40 -0 8 32 40 -1 9 33 41 -1 9 33 41 -2 10 34 42 -2 10 34 42 -3 11 35 43 -3 11 35 43 -4 12 36 44 -4 12 36 44 -5 13 37 45 -5 13 37 45 -6 14 38 46 -6 14 38 46 -7 15 39 47 -7 15 39 47 -0 8 32 40 -0 8 32 40 -1 9 33 41 -1 9 33 41 -2 10 34 42 -2 10 34 42 -3 11 35 43 -3 11 35 43 -4 12 36 44 -4 12 36 44 -5 13 37 45 -5 13 37 45 -6 14 38 46 -6 14 38 46 -7 15 39 47 -7 15 39 47 -16 24 48 56 -16 24 48 56 -17 25 49 57 -17 25 49 57 -18 26 50 58 -18 26 50 58 -19 27 51 59 -19 27 51 59 -20 28 52 60 -20 28 52 60 -21 29 53 61 -21 29 53 61 -22 30 54 62 -22 30 54 62 -23 31 55 63 -23 31 55 63 -16 24 48 56 -16 24 48 56 -17 25 49 57 -17 25 49 57 -18 26 50 58 -18 26 50 58 -19 27 51 59 -19 27 51 59 -20 28 52 60 -20 28 52 60 -21 29 53 61 -21 29 53 61 -22 30 54 62 -22 30 54 62 -23 31 55 63 -23 31 55 63 - -0 3 12 15 -3 0 15 12 -1 2 13 14 -2 1 14 13 -1 2 13 14 -2 1 14 13 -0 3 12 15 -3 0 15 12 -2 1 14 13 -1 2 13 14 -3 0 15 12 -0 3 12 15 -3 0 15 12 -0 3 12 15 -2 1 14 13 -1 2 13 14 -12 15 0 3 -15 12 3 0 -13 14 1 2 -14 13 2 1 -13 14 1 2 -14 13 2 1 -12 15 0 3 -15 12 3 0 -14 13 2 1 -13 14 1 2 -15 12 3 0 -12 15 0 3 -15 12 3 0 -12 15 0 3 -14 13 2 1 -13 14 1 2 -4 7 8 11 -7 4 11 8 -5 6 9 10 -6 5 10 9 -5 6 9 10 -6 5 10 9 -4 7 8 11 -7 4 11 8 -6 5 10 9 -5 6 9 10 -7 4 11 8 -4 7 8 11 -7 4 11 8 -4 7 8 11 -6 5 10 9 -5 6 9 10 -8 11 4 7 -11 8 7 4 -9 10 5 6 -10 9 6 5 -9 10 5 6 -10 9 6 5 -8 11 4 7 -11 8 7 4 -10 9 6 5 -9 10 5 6 -11 8 7 4 -8 11 4 7 -11 8 7 4 -8 11 4 7 -10 9 6 5 -9 10 5 6 - -This is the joint trellis of two trellises described in awgn1o2_4.fsm and awgn1o2_16.fsm -It is useful for application of joint decoding... -It can be generated in python as follows: -> import trellis -> f1=trellis.fsm('awgn1o2_4.fsm') -> f2=trellis.fsm('awgn1o2_16.fsm') -> f=trellis.fsm(f1,f2) -> f.write_fsm_txt('joint_4_16.fsm') - diff --git a/gr-trellis/src/Makefile.am b/gr-trellis/src/examples/grc/CMakeLists.txt index 79e9d626a..46b825d88 100644 --- a/gr-trellis/src/Makefile.am +++ b/gr-trellis/src/examples/grc/CMakeLists.txt @@ -1,25 +1,30 @@ +# Copyright 2012 Free Software Foundation, Inc. # -# 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 3, 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., 51 Franklin Street, # Boston, MA 02110-1301, USA. -# -SUBDIRS = lib -if PYTHON -SUBDIRS += python examples -endif +install( + FILES + interference_cancellation.grc + pccc1.grc + pccc.grc + sccc1.grc + sccc.grc + readme.txt + DESTINATION ${GR_PKG_TRELLIS_EXAMPLES_DIR} + COMPONENT "trellis-examples" +) diff --git a/gr-trellis/src/examples/grc/interference_cancellation.grc b/gr-trellis/src/examples/grc/interference_cancellation.grc new file mode 100644 index 000000000..7674b4bf1 --- /dev/null +++ b/gr-trellis/src/examples/grc/interference_cancellation.grc @@ -0,0 +1,2177 @@ +<?xml version='1.0' encoding='ASCII'?> +<flow_graph> + <timestamp>Wed Aug 31 17:40:25 2011</timestamp> + <block> + <key>options</key> + <param> + <key>id</key> + <value>int_cancellation</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value>Superposition Coding</value> + </param> + <param> + <key>author</key> + <value>AA</value> + </param> + <param> + <key>description</key> + <value>gnuradio flow graph</value> + </param> + <param> + <key>window_size</key> + <value>2048, 2048</value> + </param> + <param> + <key>generate_options</key> + <value>wx_gui</value> + </param> + <param> + <key>category</key> + <value>Custom</value> + </param> + <param> + <key>run_options</key> + <value>prompt</value> + </param> + <param> + <key>run</key> + <value>True</value> + </param> + <param> + <key>realtime_scheduling</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_slider</key> + <param> + <key>id</key> + <value>alpha</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>P1/P</value> + </param> + <param> + <key>value</key> + <value>0.6</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>1.0</value> + </param> + <param> + <key>num_steps</key> + <value>100</value> + </param> + <param> + <key>style</key> + <value>wx.SL_HORIZONTAL</value> + </param> + <param> + <key>converver</key> + <value>float_converter</value> + </param> + <param> + <key>grid_pos</key> + <value></value> + </param> + <param> + <key>notebook</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(243, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_slider</key> + <param> + <key>id</key> + <value>snr_db</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>P/sigma^2 (dB)</value> + </param> + <param> + <key>value</key> + <value>16</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>20</value> + </param> + <param> + <key>num_steps</key> + <value>100</value> + </param> + <param> + <key>style</key> + <value>wx.SL_HORIZONTAL</value> + </param> + <param> + <key>converver</key> + <value>float_converter</value> + </param> + <param> + <key>grid_pos</key> + <value></value> + </param> + <param> + <key>notebook</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(447, 14)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>noisevar</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>10**(-snr_db/10)</value> + </param> + <param> + <key>_coordinate</key> + <value>(637, 13)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>random_source_x</key> + <param> + <key>id</key> + <value>random_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>2</value> + </param> + <param> + <key>num_samps</key> + <value>1000</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(21, 170)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_multiply_const_vxx</key> + <param> + <key>id</key> + <value>gr_multiply_const_vxx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>const</key> + <value>alpha**0.5</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(988, 196)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>random_source_x</key> + <param> + <key>id</key> + <value>random_source_x_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>2</value> + </param> + <param> + <key>num_samps</key> + <value>1000</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(25, 291)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_chunks_to_symbols_xx</key> + <param> + <key>id</key> + <value>gr_chunks_to_symbols_xx_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>in_type</key> + <value>short</value> + </param> + <param> + <key>out_type</key> + <value>complex</value> + </param> + <param> + <key>symbol_table</key> + <value>1,1j,-1j,-1</value> + </param> + <param> + <key>dimension</key> + <value>1</value> + </param> + <param> + <key>num_ports</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(660, 311)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_multiply_const_vxx</key> + <param> + <key>id</key> + <value>gr_multiply_const_vxx_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>const</key> + <value>(1-alpha)**0.5</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(994, 319)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_add_xx</key> + <param> + <key>id</key> + <value>gr_add_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(1224, 244)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_noise_source_x</key> + <param> + <key>id</key> + <value>gr_noise_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>noise_type</key> + <value>gr.GR_GAUSSIAN</value> + </param> + <param> + <key>amp</key> + <value>noisevar</value> + </param> + <param> + <key>seed</key> + <value>42</value> + </param> + <param> + <key>_coordinate</key> + <value>(1146, 369)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_sub_xx</key> + <param> + <key>id</key> + <value>gr_sub_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>_coordinate</key> + <value>(536, 529)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_multiply_xx</key> + <param> + <key>id</key> + <value>gr_multiply_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(771, 525)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_short_to_float</key> + <param> + <key>id</key> + <value>gr_short_to_float_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(994, 545)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_sub_xx</key> + <param> + <key>id</key> + <value>gr_sub_xx_3</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>_coordinate</key> + <value>(535, 792)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_multiply_xx</key> + <param> + <key>id</key> + <value>gr_multiply_xx_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(785, 779)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_short_to_float</key> + <param> + <key>id</key> + <value>gr_short_to_float_2</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(1005, 798)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_chunks_to_symbols_xx</key> + <param> + <key>id</key> + <value>gr_chunks_to_symbols_xx_2</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>in_type</key> + <value>short</value> + </param> + <param> + <key>out_type</key> + <value>complex</value> + </param> + <param> + <key>symbol_table</key> + <value>1,1j,-1j,-1</value> + </param> + <param> + <key>dimension</key> + <value>1</value> + </param> + <param> + <key>num_ports</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(405, 998)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_multiply_const_vxx</key> + <param> + <key>id</key> + <value>gr_multiply_const_vxx_2</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>const</key> + <value>alpha**0.5</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(710, 1008)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_sub_xx</key> + <param> + <key>id</key> + <value>gr_sub_xx_2</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>_coordinate</key> + <value>(944, 978)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_sub_xx</key> + <param> + <key>id</key> + <value>gr_sub_xx_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>_coordinate</key> + <value>(540, 1141)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_multiply_xx</key> + <param> + <key>id</key> + <value>gr_multiply_xx_2</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(796, 1136)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_short_to_float</key> + <param> + <key>id</key> + <value>gr_short_to_float_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(1009, 1156)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_chunks_to_symbols_xx</key> + <param> + <key>id</key> + <value>gr_chunks_to_symbols_xx_2_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>in_type</key> + <value>short</value> + </param> + <param> + <key>out_type</key> + <value>complex</value> + </param> + <param> + <key>symbol_table</key> + <value>1,1j,-1j,-1</value> + </param> + <param> + <key>dimension</key> + <value>1</value> + </param> + <param> + <key>num_ports</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(420, 1368)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_multiply_const_vxx</key> + <param> + <key>id</key> + <value>gr_multiply_const_vxx_2_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>const</key> + <value>(1-alpha)**0.5</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(733, 1374)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_sub_xx</key> + <param> + <key>id</key> + <value>gr_sub_xx_2_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>_coordinate</key> + <value>(975, 1342)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_sub_xx</key> + <param> + <key>id</key> + <value>gr_sub_xx_1_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>_coordinate</key> + <value>(559, 1536)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_multiply_xx</key> + <param> + <key>id</key> + <value>gr_multiply_xx_2_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(771, 1530)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_short_to_float</key> + <param> + <key>id</key> + <value>gr_short_to_float_1_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(1010, 1551)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>trellis_encoder_xx</key> + <param> + <key>id</key> + <value>trellis_encoder_xx_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>ss</value> + </param> + <param> + <key>fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_16.fsm"</value> + </param> + <param> + <key>init_state</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(336, 311)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>trellis_viterbi_combined_xx</key> + <param> + <key>id</key> + <value>trellis_viterbi_combined_xx_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>c</value> + </param> + <param> + <key>out_type</key> + <value>s</value> + </param> + <param> + <key>fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_16.fsm"</value> + </param> + <param> + <key>block_size</key> + <value>1000</value> + </param> + <param> + <key>init_state</key> + <value>-1</value> + </param> + <param> + <key>final_state</key> + <value>-1</value> + </param> + <param> + <key>dim</key> + <value>1</value> + </param> + <param> + <key>table</key> + <value>alpha**0.5*1,alpha**0.5*1j,alpha**0.5*(-1j),alpha**0.5*(-1)</value> + </param> + <param> + <key>metric_type</key> + <value>trellis.TRELLIS_EUCLIDEAN</value> + </param> + <param> + <key>_coordinate</key> + <value>(79, 501)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>trellis_viterbi_combined_xx</key> + <param> + <key>id</key> + <value>trellis_viterbi_combined_xx_2</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>c</value> + </param> + <param> + <key>out_type</key> + <value>s</value> + </param> + <param> + <key>fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_16.fsm"</value> + </param> + <param> + <key>block_size</key> + <value>1000</value> + </param> + <param> + <key>init_state</key> + <value>-1</value> + </param> + <param> + <key>final_state</key> + <value>-1</value> + </param> + <param> + <key>dim</key> + <value>1</value> + </param> + <param> + <key>table</key> + <value>(1-alpha)**0.5*1,(1-alpha)**0.5*1j,(1-alpha)**0.5*(-1j),(1-alpha)**0.5*(-1)</value> + </param> + <param> + <key>metric_type</key> + <value>trellis.TRELLIS_EUCLIDEAN</value> + </param> + <param> + <key>_coordinate</key> + <value>(82, 766)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>trellis_encoder_xx</key> + <param> + <key>id</key> + <value>trellis_encoder_xx_2</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>ss</value> + </param> + <param> + <key>fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_16.fsm"</value> + </param> + <param> + <key>init_state</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(89, 998)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>trellis_viterbi_combined_xx</key> + <param> + <key>id</key> + <value>trellis_viterbi_combined_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>c</value> + </param> + <param> + <key>out_type</key> + <value>s</value> + </param> + <param> + <key>fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_16.fsm"</value> + </param> + <param> + <key>block_size</key> + <value>1000</value> + </param> + <param> + <key>init_state</key> + <value>-1</value> + </param> + <param> + <key>final_state</key> + <value>-1</value> + </param> + <param> + <key>dim</key> + <value>1</value> + </param> + <param> + <key>table</key> + <value>(1-alpha)**0.5*1,(1-alpha)**0.5*1j,(1-alpha)**0.5*(-1j),(1-alpha)**0.5*(-1)</value> + </param> + <param> + <key>metric_type</key> + <value>trellis.TRELLIS_EUCLIDEAN</value> + </param> + <param> + <key>_coordinate</key> + <value>(83, 1111)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>trellis_encoder_xx</key> + <param> + <key>id</key> + <value>trellis_encoder_xx_2_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>ss</value> + </param> + <param> + <key>fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_16.fsm"</value> + </param> + <param> + <key>init_state</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(105, 1367)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>trellis_viterbi_combined_xx</key> + <param> + <key>id</key> + <value>trellis_viterbi_combined_xx_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>c</value> + </param> + <param> + <key>out_type</key> + <value>s</value> + </param> + <param> + <key>fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_16.fsm"</value> + </param> + <param> + <key>block_size</key> + <value>1000</value> + </param> + <param> + <key>init_state</key> + <value>-1</value> + </param> + <param> + <key>final_state</key> + <value>-1</value> + </param> + <param> + <key>dim</key> + <value>1</value> + </param> + <param> + <key>table</key> + <value>alpha**0.5*1,alpha**0.5*1j,alpha**0.5*(-1j),alpha**0.5*(-1)</value> + </param> + <param> + <key>metric_type</key> + <value>trellis.TRELLIS_EUCLIDEAN</value> + </param> + <param> + <key>_coordinate</key> + <value>(75, 1495)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_add_xx</key> + <param> + <key>id</key> + <value>gr_add_xx_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(1400, 262)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>wxgui_scopesink2</key> + <param> + <key>id</key> + <value>wxgui_scopesink2_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>title</key> + <value>Scope Plot</value> + </param> + <param> + <key>samp_rate</key> + <value>R</value> + </param> + <param> + <key>v_scale</key> + <value>0</value> + </param> + <param> + <key>v_offset</key> + <value>0</value> + </param> + <param> + <key>t_scale</key> + <value>0</value> + </param> + <param> + <key>ac_couple</key> + <value>False</value> + </param> + <param> + <key>xy_mode</key> + <value>True</value> + </param> + <param> + <key>num_inputs</key> + <value>1</value> + </param> + <param> + <key>win_size</key> + <value></value> + </param> + <param> + <key>grid_pos</key> + <value></value> + </param> + <param> + <key>notebook</key> + <value></value> + </param> + <param> + <key>trig_mode</key> + <value>gr.gr_TRIG_MODE_AUTO</value> + </param> + <param> + <key>y_axis_label</key> + <value>Counts</value> + </param> + <param> + <key>_coordinate</key> + <value>(1533, 149)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>prefix</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"/n/harrisville/x/anastas/gnuradio_trunk/"</value> + </param> + <param> + <key>_coordinate</key> + <value>(871, 14)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>trellis_encoder_xx</key> + <param> + <key>id</key> + <value>trellis_encoder_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>ss</value> + </param> + <param> + <key>fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_16.fsm"</value> + </param> + <param> + <key>init_state</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(340, 187)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_throttle</key> + <param> + <key>id</key> + <value>gr_throttle_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>samples_per_second</key> + <value>R</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(534, 149)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_chunks_to_symbols_xx</key> + <param> + <key>id</key> + <value>gr_chunks_to_symbols_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>in_type</key> + <value>short</value> + </param> + <param> + <key>out_type</key> + <value>complex</value> + </param> + <param> + <key>symbol_table</key> + <value>1,1j,-1j,-1</value> + </param> + <param> + <key>dimension</key> + <value>1</value> + </param> + <param> + <key>num_ports</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(682, 186)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>R</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>100e3</value> + </param> + <param> + <key>_coordinate</key> + <value>(748, 12)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>wxgui_numbersink2</key> + <param> + <key>id</key> + <value>wxgui_numbersink2_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>title</key> + <value>BER 1 (raw)</value> + </param> + <param> + <key>units</key> + <value>BER</value> + </param> + <param> + <key>samp_rate</key> + <value>R</value> + </param> + <param> + <key>min_value</key> + <value>0</value> + </param> + <param> + <key>max_value</key> + <value>1</value> + </param> + <param> + <key>factor</key> + <value>1.0</value> + </param> + <param> + <key>decimal_places</key> + <value>6</value> + </param> + <param> + <key>ref_level</key> + <value>0</value> + </param> + <param> + <key>number_rate</key> + <value>15</value> + </param> + <param> + <key>peak_hold</key> + <value>False</value> + </param> + <param> + <key>average</key> + <value>True</value> + </param> + <param> + <key>avg_alpha</key> + <value>0.001</value> + </param> + <param> + <key>show_gauge</key> + <value>True</value> + </param> + <param> + <key>win_size</key> + <value></value> + </param> + <param> + <key>grid_pos</key> + <value>0,0,1,1</value> + </param> + <param> + <key>notebook</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(1267, 410)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>wxgui_numbersink2</key> + <param> + <key>id</key> + <value>wxgui_numbersink2_2</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>title</key> + <value>BER 2 (raw)</value> + </param> + <param> + <key>units</key> + <value>BER</value> + </param> + <param> + <key>samp_rate</key> + <value>R</value> + </param> + <param> + <key>min_value</key> + <value>0</value> + </param> + <param> + <key>max_value</key> + <value>1.0</value> + </param> + <param> + <key>factor</key> + <value>1.0</value> + </param> + <param> + <key>decimal_places</key> + <value>6</value> + </param> + <param> + <key>ref_level</key> + <value>0</value> + </param> + <param> + <key>number_rate</key> + <value>15</value> + </param> + <param> + <key>peak_hold</key> + <value>False</value> + </param> + <param> + <key>average</key> + <value>True</value> + </param> + <param> + <key>avg_alpha</key> + <value>0.001</value> + </param> + <param> + <key>show_gauge</key> + <value>True</value> + </param> + <param> + <key>win_size</key> + <value></value> + </param> + <param> + <key>grid_pos</key> + <value>0,1,1,1</value> + </param> + <param> + <key>notebook</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(1260, 659)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>wxgui_numbersink2</key> + <param> + <key>id</key> + <value>wxgui_numbersink2_3</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>title</key> + <value>BER 2 (after cancelling user 1)</value> + </param> + <param> + <key>units</key> + <value>BER</value> + </param> + <param> + <key>samp_rate</key> + <value>R</value> + </param> + <param> + <key>min_value</key> + <value>0</value> + </param> + <param> + <key>max_value</key> + <value>1.0</value> + </param> + <param> + <key>factor</key> + <value>1.0</value> + </param> + <param> + <key>decimal_places</key> + <value>6</value> + </param> + <param> + <key>ref_level</key> + <value>0</value> + </param> + <param> + <key>number_rate</key> + <value>15</value> + </param> + <param> + <key>peak_hold</key> + <value>False</value> + </param> + <param> + <key>average</key> + <value>True</value> + </param> + <param> + <key>avg_alpha</key> + <value>0.001</value> + </param> + <param> + <key>show_gauge</key> + <value>True</value> + </param> + <param> + <key>win_size</key> + <value></value> + </param> + <param> + <key>grid_pos</key> + <value>1,1,1,1</value> + </param> + <param> + <key>notebook</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(1262, 1020)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>wxgui_numbersink2</key> + <param> + <key>id</key> + <value>wxgui_numbersink2_3_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>title</key> + <value>BER 1 (after cancelling user 2)</value> + </param> + <param> + <key>units</key> + <value>BER</value> + </param> + <param> + <key>samp_rate</key> + <value>R</value> + </param> + <param> + <key>min_value</key> + <value>0</value> + </param> + <param> + <key>max_value</key> + <value>1.0</value> + </param> + <param> + <key>factor</key> + <value>1.0</value> + </param> + <param> + <key>decimal_places</key> + <value>6</value> + </param> + <param> + <key>ref_level</key> + <value>0</value> + </param> + <param> + <key>number_rate</key> + <value>15</value> + </param> + <param> + <key>peak_hold</key> + <value>False</value> + </param> + <param> + <key>average</key> + <value>True</value> + </param> + <param> + <key>avg_alpha</key> + <value>0.001</value> + </param> + <param> + <key>show_gauge</key> + <value>True</value> + </param> + <param> + <key>win_size</key> + <value></value> + </param> + <param> + <key>grid_pos</key> + <value>1,0,1,1</value> + </param> + <param> + <key>notebook</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(1269, 1417)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <connection> + <source_block_id>random_source_x_1</source_block_id> + <sink_block_id>trellis_encoder_xx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>trellis_encoder_xx_1</source_block_id> + <sink_block_id>gr_chunks_to_symbols_xx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_chunks_to_symbols_xx_0</source_block_id> + <sink_block_id>gr_multiply_const_vxx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_multiply_const_vxx_0</source_block_id> + <sink_block_id>gr_add_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_add_xx_0</source_block_id> + <sink_block_id>gr_add_xx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_noise_source_x_0</source_block_id> + <sink_block_id>gr_add_xx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>gr_chunks_to_symbols_xx_1</source_block_id> + <sink_block_id>gr_multiply_const_vxx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_multiply_const_vxx_1</source_block_id> + <sink_block_id>gr_add_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>gr_sub_xx_0</source_block_id> + <sink_block_id>gr_multiply_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_sub_xx_0</source_block_id> + <sink_block_id>gr_multiply_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>gr_multiply_xx_0</source_block_id> + <sink_block_id>gr_short_to_float_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_short_to_float_0</source_block_id> + <sink_block_id>wxgui_numbersink2_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_multiply_xx_2</source_block_id> + <sink_block_id>gr_short_to_float_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>random_source_x_0</source_block_id> + <sink_block_id>trellis_encoder_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_add_xx_1</source_block_id> + <sink_block_id>trellis_viterbi_combined_xx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>random_source_x_0</source_block_id> + <sink_block_id>gr_sub_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>trellis_viterbi_combined_xx_1</source_block_id> + <sink_block_id>gr_sub_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>trellis_viterbi_combined_xx_0</source_block_id> + <sink_block_id>gr_sub_xx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>random_source_x_1</source_block_id> + <sink_block_id>gr_sub_xx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_sub_xx_1</source_block_id> + <sink_block_id>gr_multiply_xx_2</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_sub_xx_1</source_block_id> + <sink_block_id>gr_multiply_xx_2</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>gr_sub_xx_2</source_block_id> + <sink_block_id>trellis_viterbi_combined_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_add_xx_1</source_block_id> + <sink_block_id>gr_sub_xx_2</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>trellis_encoder_xx_2</source_block_id> + <sink_block_id>gr_chunks_to_symbols_xx_2</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_chunks_to_symbols_xx_2</source_block_id> + <sink_block_id>gr_multiply_const_vxx_2</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_multiply_const_vxx_2</source_block_id> + <sink_block_id>gr_sub_xx_2</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>trellis_viterbi_combined_xx_1</source_block_id> + <sink_block_id>trellis_encoder_xx_2</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_multiply_xx_1</source_block_id> + <sink_block_id>gr_short_to_float_2</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_short_to_float_2</source_block_id> + <sink_block_id>wxgui_numbersink2_2</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>trellis_viterbi_combined_xx_2</source_block_id> + <sink_block_id>gr_sub_xx_3</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>gr_sub_xx_3</source_block_id> + <sink_block_id>gr_multiply_xx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_sub_xx_3</source_block_id> + <sink_block_id>gr_multiply_xx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>gr_add_xx_1</source_block_id> + <sink_block_id>trellis_viterbi_combined_xx_2</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>random_source_x_1</source_block_id> + <sink_block_id>gr_sub_xx_3</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_short_to_float_1</source_block_id> + <sink_block_id>wxgui_numbersink2_3</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>trellis_encoder_xx_2_0</source_block_id> + <sink_block_id>gr_chunks_to_symbols_xx_2_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_chunks_to_symbols_xx_2_0</source_block_id> + <sink_block_id>gr_multiply_const_vxx_2_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>trellis_viterbi_combined_xx_2</source_block_id> + <sink_block_id>trellis_encoder_xx_2_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_multiply_xx_2_0</source_block_id> + <sink_block_id>gr_short_to_float_1_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>trellis_viterbi_combined_xx_0_0</source_block_id> + <sink_block_id>gr_sub_xx_1_0</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>gr_sub_xx_1_0</source_block_id> + <sink_block_id>gr_multiply_xx_2_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_sub_xx_1_0</source_block_id> + <sink_block_id>gr_multiply_xx_2_0</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>gr_sub_xx_2_0</source_block_id> + <sink_block_id>trellis_viterbi_combined_xx_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_short_to_float_1_0</source_block_id> + <sink_block_id>wxgui_numbersink2_3_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_add_xx_1</source_block_id> + <sink_block_id>gr_sub_xx_2_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>random_source_x_0</source_block_id> + <sink_block_id>gr_sub_xx_1_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_multiply_const_vxx_2_0</source_block_id> + <sink_block_id>gr_sub_xx_2_0</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>gr_add_xx_1</source_block_id> + <sink_block_id>wxgui_scopesink2_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>trellis_encoder_xx_0</source_block_id> + <sink_block_id>gr_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_throttle_0</source_block_id> + <sink_block_id>gr_chunks_to_symbols_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> +</flow_graph> diff --git a/gr-trellis/src/examples/grc/pccc.grc b/gr-trellis/src/examples/grc/pccc.grc new file mode 100644 index 000000000..c3111c321 --- /dev/null +++ b/gr-trellis/src/examples/grc/pccc.grc @@ -0,0 +1,832 @@ +<?xml version='1.0' encoding='ASCII'?> +<flow_graph> + <timestamp>Thu Sep 1 12:53:13 2011</timestamp> + <block> + <key>options</key> + <param> + <key>id</key> + <value>sccc1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value>Serially Concatenated Convolutional Code</value> + </param> + <param> + <key>author</key> + <value>AA</value> + </param> + <param> + <key>description</key> + <value>gnuradio flow graph</value> + </param> + <param> + <key>window_size</key> + <value>2048, 2048</value> + </param> + <param> + <key>generate_options</key> + <value>wx_gui</value> + </param> + <param> + <key>category</key> + <value>Custom</value> + </param> + <param> + <key>run_options</key> + <value>prompt</value> + </param> + <param> + <key>run</key> + <value>True</value> + </param> + <param> + <key>realtime_scheduling</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>noisevar</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>10**(-snr_db/10)</value> + </param> + <param> + <key>_coordinate</key> + <value>(389, 15)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>prefix</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"/n/harrisville/x/anastas/gnuradio_trunk/"</value> + </param> + <param> + <key>_coordinate</key> + <value>(590, 15)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>block</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>1000</value> + </param> + <param> + <key>_coordinate</key> + <value>(764, 16)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_slider</key> + <param> + <key>id</key> + <value>snr_db</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>SNR (dB)</value> + </param> + <param> + <key>value</key> + <value>5</value> + </param> + <param> + <key>min</key> + <value>-10</value> + </param> + <param> + <key>max</key> + <value>10</value> + </param> + <param> + <key>num_steps</key> + <value>100</value> + </param> + <param> + <key>style</key> + <value>wx.SL_HORIZONTAL</value> + </param> + <param> + <key>converver</key> + <value>float_converter</value> + </param> + <param> + <key>grid_pos</key> + <value></value> + </param> + <param> + <key>notebook</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(229, 13)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_multiply_xx</key> + <param> + <key>id</key> + <value>gr_multiply_xx_2_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(392, 591)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_short_to_float</key> + <param> + <key>id</key> + <value>gr_short_to_float_1_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(535, 609)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>wxgui_numbersink2</key> + <param> + <key>id</key> + <value>wxgui_numbersink2_3_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>title</key> + <value>BER</value> + </param> + <param> + <key>units</key> + <value>BER</value> + </param> + <param> + <key>samp_rate</key> + <value>R</value> + </param> + <param> + <key>min_value</key> + <value>0</value> + </param> + <param> + <key>max_value</key> + <value>1.0</value> + </param> + <param> + <key>factor</key> + <value>1.0</value> + </param> + <param> + <key>decimal_places</key> + <value>6</value> + </param> + <param> + <key>ref_level</key> + <value>0</value> + </param> + <param> + <key>number_rate</key> + <value>15</value> + </param> + <param> + <key>peak_hold</key> + <value>False</value> + </param> + <param> + <key>average</key> + <value>True</value> + </param> + <param> + <key>avg_alpha</key> + <value>0.001</value> + </param> + <param> + <key>show_gauge</key> + <value>True</value> + </param> + <param> + <key>win_size</key> + <value></value> + </param> + <param> + <key>grid_pos</key> + <value>1,0,1,1</value> + </param> + <param> + <key>notebook</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(713, 426)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_noise_source_x</key> + <param> + <key>id</key> + <value>gr_noise_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>noise_type</key> + <value>gr.GR_GAUSSIAN</value> + </param> + <param> + <key>amp</key> + <value>noisevar</value> + </param> + <param> + <key>seed</key> + <value>42</value> + </param> + <param> + <key>_coordinate</key> + <value>(672, 290)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>wxgui_scopesink2</key> + <param> + <key>id</key> + <value>wxgui_scopesink2_0</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>title</key> + <value>Scope Plot</value> + </param> + <param> + <key>samp_rate</key> + <value>R</value> + </param> + <param> + <key>v_scale</key> + <value>0</value> + </param> + <param> + <key>v_offset</key> + <value>0</value> + </param> + <param> + <key>t_scale</key> + <value>0</value> + </param> + <param> + <key>ac_couple</key> + <value>False</value> + </param> + <param> + <key>xy_mode</key> + <value>False</value> + </param> + <param> + <key>num_inputs</key> + <value>1</value> + </param> + <param> + <key>win_size</key> + <value></value> + </param> + <param> + <key>grid_pos</key> + <value></value> + </param> + <param> + <key>notebook</key> + <value></value> + </param> + <param> + <key>trig_mode</key> + <value>gr.gr_TRIG_MODE_AUTO</value> + </param> + <param> + <key>y_axis_label</key> + <value>Counts</value> + </param> + <param> + <key>_coordinate</key> + <value>(952, 73)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>random_source_x</key> + <param> + <key>id</key> + <value>random_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>2</value> + </param> + <param> + <key>num_samps</key> + <value>1000</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(21, 170)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_throttle</key> + <param> + <key>id</key> + <value>gr_throttle_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>samples_per_second</key> + <value>R</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(517, 103)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_chunks_to_symbols_xx</key> + <param> + <key>id</key> + <value>gr_chunks_to_symbols_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>in_type</key> + <value>short</value> + </param> + <param> + <key>out_type</key> + <value>float</value> + </param> + <param> + <key>symbol_table</key> + <value>-7,0, -5,0, -3,0, -1,0, 1,0, 3,0, 5,0, 7,0, 0,-7,0, -5,0, -3,0, -1,0, 1,0, 3,0, 5,0, 7</value> + </param> + <param> + <key>dimension</key> + <value>2</value> + </param> + <param> + <key>num_ports</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(551, 184)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>trellis_pccc_encoder_xx</key> + <param> + <key>id</key> + <value>trellis_pccc_encoder_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>ss</value> + </param> + <param> + <key>o_fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_4.fsm"</value> + </param> + <param> + <key>o_init_state</key> + <value>0</value> + </param> + <param> + <key>i_fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_4.fsm"</value> + </param> + <param> + <key>i_init_state</key> + <value>0</value> + </param> + <param> + <key>interleaver_args</key> + <value>trellis.interleaver(block,666)</value> + </param> + <param> + <key>bl</key> + <value>block</value> + </param> + <param> + <key>_coordinate</key> + <value>(236, 147)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>R</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>100e3</value> + </param> + <param> + <key>_coordinate</key> + <value>(482, 17)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_add_xx</key> + <param> + <key>id</key> + <value>gr_add_xx_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(951, 256)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>trellis_pccc_decoder_combined_xx</key> + <param> + <key>id</key> + <value>trellis_pccc_decoder_combined_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>f</value> + </param> + <param> + <key>out_type</key> + <value>s</value> + </param> + <param> + <key>o_fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_4.fsm"</value> + </param> + <param> + <key>o_init_state</key> + <value>0</value> + </param> + <param> + <key>o_final_state</key> + <value>-1</value> + </param> + <param> + <key>i_fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_4.fsm"</value> + </param> + <param> + <key>i_init_state</key> + <value>0</value> + </param> + <param> + <key>i_final_state</key> + <value>-1</value> + </param> + <param> + <key>interleaver</key> + <value>trellis.interleaver(block,666)</value> + </param> + <param> + <key>block_size</key> + <value>block</value> + </param> + <param> + <key>iterations</key> + <value>10</value> + </param> + <param> + <key>dim</key> + <value>2</value> + </param> + <param> + <key>table</key> + <value>-7,0, -5,0, -3,0, -1,0, 1,0, 3,0, 5,0, 7,0, 0,-7,0, -5,0, -3,0, -1,0, 1,0, 3,0, 5,0, 7</value> + </param> + <param> + <key>metric_type</key> + <value>trellis.TRELLIS_EUCLIDEAN</value> + </param> + <param> + <key>siso_type</key> + <value>trellis.TRELLIS_MIN_SUM</value> + </param> + <param> + <key>scaling</key> + <value>1.0</value> + </param> + <param> + <key>_coordinate</key> + <value>(196, 274)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_sub_xx</key> + <param> + <key>id</key> + <value>gr_sub_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>_coordinate</key> + <value>(217, 597)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <connection> + <source_block_id>random_source_x_0</source_block_id> + <sink_block_id>gr_sub_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_throttle_0</source_block_id> + <sink_block_id>gr_chunks_to_symbols_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_add_xx_1</source_block_id> + <sink_block_id>wxgui_scopesink2_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_noise_source_x_0</source_block_id> + <sink_block_id>gr_add_xx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>gr_chunks_to_symbols_xx_0</source_block_id> + <sink_block_id>gr_add_xx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_multiply_xx_2_0</source_block_id> + <sink_block_id>gr_short_to_float_1_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_short_to_float_1_0</source_block_id> + <sink_block_id>wxgui_numbersink2_3_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_sub_xx_0</source_block_id> + <sink_block_id>gr_multiply_xx_2_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_sub_xx_0</source_block_id> + <sink_block_id>gr_multiply_xx_2_0</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>random_source_x_0</source_block_id> + <sink_block_id>trellis_pccc_encoder_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>trellis_pccc_encoder_xx_0</source_block_id> + <sink_block_id>gr_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_add_xx_1</source_block_id> + <sink_block_id>trellis_pccc_decoder_combined_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>trellis_pccc_decoder_combined_xx_0</source_block_id> + <sink_block_id>gr_sub_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> +</flow_graph> diff --git a/gr-trellis/src/examples/grc/pccc1.grc b/gr-trellis/src/examples/grc/pccc1.grc new file mode 100644 index 000000000..15a63707e --- /dev/null +++ b/gr-trellis/src/examples/grc/pccc1.grc @@ -0,0 +1,857 @@ +<?xml version='1.0' encoding='ASCII'?> +<flow_graph> + <timestamp>Wed Aug 31 20:34:39 2011</timestamp> + <block> + <key>options</key> + <param> + <key>id</key> + <value>sccc1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value>Serially Concatenated Convolutional Code</value> + </param> + <param> + <key>author</key> + <value>AA</value> + </param> + <param> + <key>description</key> + <value>gnuradio flow graph</value> + </param> + <param> + <key>window_size</key> + <value>2048, 2048</value> + </param> + <param> + <key>generate_options</key> + <value>wx_gui</value> + </param> + <param> + <key>category</key> + <value>Custom</value> + </param> + <param> + <key>run_options</key> + <value>prompt</value> + </param> + <param> + <key>run</key> + <value>True</value> + </param> + <param> + <key>realtime_scheduling</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>noisevar</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>10**(-snr_db/10)</value> + </param> + <param> + <key>_coordinate</key> + <value>(389, 15)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>prefix</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"/n/harrisville/x/anastas/gnuradio_trunk/"</value> + </param> + <param> + <key>_coordinate</key> + <value>(590, 15)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>block</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>1000</value> + </param> + <param> + <key>_coordinate</key> + <value>(764, 16)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_slider</key> + <param> + <key>id</key> + <value>snr_db</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>SNR (dB)</value> + </param> + <param> + <key>value</key> + <value>5</value> + </param> + <param> + <key>min</key> + <value>-10</value> + </param> + <param> + <key>max</key> + <value>10</value> + </param> + <param> + <key>num_steps</key> + <value>100</value> + </param> + <param> + <key>style</key> + <value>wx.SL_HORIZONTAL</value> + </param> + <param> + <key>converver</key> + <value>float_converter</value> + </param> + <param> + <key>grid_pos</key> + <value></value> + </param> + <param> + <key>notebook</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(229, 13)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_multiply_xx</key> + <param> + <key>id</key> + <value>gr_multiply_xx_2_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(392, 591)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_short_to_float</key> + <param> + <key>id</key> + <value>gr_short_to_float_1_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(535, 609)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>wxgui_numbersink2</key> + <param> + <key>id</key> + <value>wxgui_numbersink2_3_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>title</key> + <value>BER</value> + </param> + <param> + <key>units</key> + <value>BER</value> + </param> + <param> + <key>samp_rate</key> + <value>R</value> + </param> + <param> + <key>min_value</key> + <value>0</value> + </param> + <param> + <key>max_value</key> + <value>1.0</value> + </param> + <param> + <key>factor</key> + <value>1.0</value> + </param> + <param> + <key>decimal_places</key> + <value>6</value> + </param> + <param> + <key>ref_level</key> + <value>0</value> + </param> + <param> + <key>number_rate</key> + <value>15</value> + </param> + <param> + <key>peak_hold</key> + <value>False</value> + </param> + <param> + <key>average</key> + <value>True</value> + </param> + <param> + <key>avg_alpha</key> + <value>0.001</value> + </param> + <param> + <key>show_gauge</key> + <value>True</value> + </param> + <param> + <key>win_size</key> + <value></value> + </param> + <param> + <key>grid_pos</key> + <value>1,0,1,1</value> + </param> + <param> + <key>notebook</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(713, 426)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_noise_source_x</key> + <param> + <key>id</key> + <value>gr_noise_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>noise_type</key> + <value>gr.GR_GAUSSIAN</value> + </param> + <param> + <key>amp</key> + <value>noisevar</value> + </param> + <param> + <key>seed</key> + <value>42</value> + </param> + <param> + <key>_coordinate</key> + <value>(672, 290)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_add_xx</key> + <param> + <key>id</key> + <value>gr_add_xx_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(951, 256)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>wxgui_scopesink2</key> + <param> + <key>id</key> + <value>wxgui_scopesink2_0</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>title</key> + <value>Scope Plot</value> + </param> + <param> + <key>samp_rate</key> + <value>R</value> + </param> + <param> + <key>v_scale</key> + <value>0</value> + </param> + <param> + <key>v_offset</key> + <value>0</value> + </param> + <param> + <key>t_scale</key> + <value>0</value> + </param> + <param> + <key>ac_couple</key> + <value>False</value> + </param> + <param> + <key>xy_mode</key> + <value>False</value> + </param> + <param> + <key>num_inputs</key> + <value>1</value> + </param> + <param> + <key>win_size</key> + <value></value> + </param> + <param> + <key>grid_pos</key> + <value></value> + </param> + <param> + <key>notebook</key> + <value></value> + </param> + <param> + <key>trig_mode</key> + <value>gr.gr_TRIG_MODE_AUTO</value> + </param> + <param> + <key>y_axis_label</key> + <value>Counts</value> + </param> + <param> + <key>_coordinate</key> + <value>(952, 73)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>random_source_x</key> + <param> + <key>id</key> + <value>random_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>2</value> + </param> + <param> + <key>num_samps</key> + <value>1000</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(21, 170)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_throttle</key> + <param> + <key>id</key> + <value>gr_throttle_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>samples_per_second</key> + <value>R</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(517, 103)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_sub_xx</key> + <param> + <key>id</key> + <value>gr_sub_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>_coordinate</key> + <value>(217, 597)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_chunks_to_symbols_xx</key> + <param> + <key>id</key> + <value>gr_chunks_to_symbols_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>in_type</key> + <value>short</value> + </param> + <param> + <key>out_type</key> + <value>float</value> + </param> + <param> + <key>symbol_table</key> + <value>-7,0, -5,0, -3,0, -1,0, 1,0, 3,0, 5,0, 7,0, 0,-7,0, -5,0, -3,0, -1,0, 1,0, 3,0, 5,0, 7</value> + </param> + <param> + <key>dimension</key> + <value>2</value> + </param> + <param> + <key>num_ports</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(551, 184)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>trellis_pccc_encoder_xx</key> + <param> + <key>id</key> + <value>trellis_pccc_encoder_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>ss</value> + </param> + <param> + <key>o_fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_4.fsm"</value> + </param> + <param> + <key>o_init_state</key> + <value>0</value> + </param> + <param> + <key>i_fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_4.fsm"</value> + </param> + <param> + <key>i_init_state</key> + <value>0</value> + </param> + <param> + <key>interleaver_args</key> + <value>trellis.interleaver(block,666)</value> + </param> + <param> + <key>bl</key> + <value>block</value> + </param> + <param> + <key>_coordinate</key> + <value>(236, 147)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>trellis_pccc_decoder_x</key> + <param> + <key>id</key> + <value>trellis_pccc_decoder_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>out_type</key> + <value>s</value> + </param> + <param> + <key>o_fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_4.fsm"</value> + </param> + <param> + <key>o_init_state</key> + <value>0</value> + </param> + <param> + <key>o_final_state</key> + <value>-1</value> + </param> + <param> + <key>i_fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_4.fsm"</value> + </param> + <param> + <key>i_init_state</key> + <value>0</value> + </param> + <param> + <key>i_final_state</key> + <value>-1</value> + </param> + <param> + <key>interleaver</key> + <value>trellis.interleaver(block,666)</value> + </param> + <param> + <key>block_size</key> + <value>block</value> + </param> + <param> + <key>iterations</key> + <value>10</value> + </param> + <param> + <key>siso_type</key> + <value>trellis.TRELLIS_MIN_SUM</value> + </param> + <param> + <key>_coordinate</key> + <value>(357, 304)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>trellis_metrics_x</key> + <param> + <key>id</key> + <value>trellis_metrics_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>f</value> + </param> + <param> + <key>card</key> + <value>16</value> + </param> + <param> + <key>dim</key> + <value>2</value> + </param> + <param> + <key>table</key> + <value>-7,0, -5,0, -3,0, -1,0, 1,0, 3,0, 5,0, 7,0, 0,-7,0, -5,0, -3,0, -1,0, 1,0, 3,0, 5,0, 7</value> + </param> + <param> + <key>metric_type</key> + <value>trellis.TRELLIS_EUCLIDEAN</value> + </param> + <param> + <key>_coordinate</key> + <value>(58, 354)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>R</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>100e3</value> + </param> + <param> + <key>_coordinate</key> + <value>(482, 17)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <connection> + <source_block_id>random_source_x_0</source_block_id> + <sink_block_id>gr_sub_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_throttle_0</source_block_id> + <sink_block_id>gr_chunks_to_symbols_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_add_xx_1</source_block_id> + <sink_block_id>wxgui_scopesink2_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_noise_source_x_0</source_block_id> + <sink_block_id>gr_add_xx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>gr_chunks_to_symbols_xx_0</source_block_id> + <sink_block_id>gr_add_xx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_multiply_xx_2_0</source_block_id> + <sink_block_id>gr_short_to_float_1_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_short_to_float_1_0</source_block_id> + <sink_block_id>wxgui_numbersink2_3_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_sub_xx_0</source_block_id> + <sink_block_id>gr_multiply_xx_2_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_sub_xx_0</source_block_id> + <sink_block_id>gr_multiply_xx_2_0</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>gr_add_xx_1</source_block_id> + <sink_block_id>trellis_metrics_x_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>random_source_x_0</source_block_id> + <sink_block_id>trellis_pccc_encoder_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>trellis_pccc_encoder_xx_0</source_block_id> + <sink_block_id>gr_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>trellis_metrics_x_0</source_block_id> + <sink_block_id>trellis_pccc_decoder_x_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>trellis_pccc_decoder_x_0</source_block_id> + <sink_block_id>gr_sub_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> +</flow_graph> diff --git a/gr-trellis/src/examples/grc/readme.txt b/gr-trellis/src/examples/grc/readme.txt new file mode 100644 index 000000000..a5261ac0b --- /dev/null +++ b/gr-trellis/src/examples/grc/readme.txt @@ -0,0 +1,32 @@ +These are examples of using gr-trellis in grc. + +INTERFERENCE CANCELLATION +------------------------- +Two users are transmitting simultaneously using convolutionally encoded QPSK, each with power P1=alpha*P and P2=(1-alpha)*P. +The combined signal is observed in noise and four different receivers are considered: +1) A viterbi decoder decoding user 1 assuming user 2 is noise +2) A viterbi decoder decoding user 2 assuming user 1 is noise +3) A viterbi decoder decoding user 1 first + and then reencoding this signal, subtracting it from the observation + and then running a Viterbi decoder decoding user 2 +4) A viterbi decoder decoding user 2 first + and then reencoding this signal, subtracting it from the observation + and then running a Viterbi decoder decoding user 1 + +You can change the signal to noise ratio P/sigma^2 and the allocation of power to the two users, alpha. + + +Serially Concatenated Convolutional Codes +----------------------------------------- +An SCCC can be defined by an outer and an inner FSM together with an interleaver +and a modulation type. You can change the SNR and observe the estimated BER. +In sccc.grc the decoding and metric calculation are combined; in sccc1.grc they are separate. + +Parallel Concatenated Convolutional Codes +----------------------------------------- +A PCCC can be defined by two FSMs together with an interleaver +and a modulation type. You can change the SNR and observe the estimated BER. +In pccc1.grc the decoding and metric calculation are separate. + + +Enjoy. diff --git a/gr-trellis/src/examples/grc/sccc.grc b/gr-trellis/src/examples/grc/sccc.grc new file mode 100644 index 000000000..e8f656f63 --- /dev/null +++ b/gr-trellis/src/examples/grc/sccc.grc @@ -0,0 +1,832 @@ +<?xml version='1.0' encoding='ASCII'?> +<flow_graph> + <timestamp>Wed Aug 31 19:57:09 2011</timestamp> + <block> + <key>options</key> + <param> + <key>id</key> + <value>sccc</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value>Serially Concatenated Convolutional Code</value> + </param> + <param> + <key>author</key> + <value>AA</value> + </param> + <param> + <key>description</key> + <value>gnuradio flow graph</value> + </param> + <param> + <key>window_size</key> + <value>2048, 2048</value> + </param> + <param> + <key>generate_options</key> + <value>wx_gui</value> + </param> + <param> + <key>category</key> + <value>Custom</value> + </param> + <param> + <key>run_options</key> + <value>prompt</value> + </param> + <param> + <key>run</key> + <value>True</value> + </param> + <param> + <key>realtime_scheduling</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>noisevar</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>10**(-snr_db/10)</value> + </param> + <param> + <key>_coordinate</key> + <value>(389, 15)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>random_source_x</key> + <param> + <key>id</key> + <value>random_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>2</value> + </param> + <param> + <key>num_samps</key> + <value>1000</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(21, 170)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>prefix</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"/n/harrisville/x/anastas/gnuradio_trunk/"</value> + </param> + <param> + <key>_coordinate</key> + <value>(590, 15)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>block</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>1000</value> + </param> + <param> + <key>_coordinate</key> + <value>(764, 16)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_add_xx</key> + <param> + <key>id</key> + <value>gr_add_xx_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(951, 256)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_sub_xx</key> + <param> + <key>id</key> + <value>gr_sub_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>_coordinate</key> + <value>(445, 517)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_multiply_xx</key> + <param> + <key>id</key> + <value>gr_multiply_xx_2_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(228.25, 798.39170361874085)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_short_to_float</key> + <param> + <key>id</key> + <value>gr_short_to_float_1_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(416, 815)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_slider</key> + <param> + <key>id</key> + <value>snr_db</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>SNR (dB)</value> + </param> + <param> + <key>value</key> + <value>5</value> + </param> + <param> + <key>min</key> + <value>-10</value> + </param> + <param> + <key>max</key> + <value>10</value> + </param> + <param> + <key>num_steps</key> + <value>100</value> + </param> + <param> + <key>style</key> + <value>wx.SL_HORIZONTAL</value> + </param> + <param> + <key>converver</key> + <value>float_converter</value> + </param> + <param> + <key>grid_pos</key> + <value></value> + </param> + <param> + <key>notebook</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(229, 13)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>R</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>10e3</value> + </param> + <param> + <key>_coordinate</key> + <value>(482, 17)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>wxgui_scopesink2</key> + <param> + <key>id</key> + <value>wxgui_scopesink2_0</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>title</key> + <value>Scope Plot</value> + </param> + <param> + <key>samp_rate</key> + <value>R</value> + </param> + <param> + <key>v_scale</key> + <value>0</value> + </param> + <param> + <key>v_offset</key> + <value>0</value> + </param> + <param> + <key>t_scale</key> + <value>0</value> + </param> + <param> + <key>ac_couple</key> + <value>False</value> + </param> + <param> + <key>xy_mode</key> + <value>True</value> + </param> + <param> + <key>num_inputs</key> + <value>1</value> + </param> + <param> + <key>win_size</key> + <value></value> + </param> + <param> + <key>grid_pos</key> + <value></value> + </param> + <param> + <key>notebook</key> + <value></value> + </param> + <param> + <key>trig_mode</key> + <value>gr.gr_TRIG_MODE_AUTO</value> + </param> + <param> + <key>y_axis_label</key> + <value>Counts</value> + </param> + <param> + <key>_coordinate</key> + <value>(952, 73)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_throttle</key> + <param> + <key>id</key> + <value>gr_throttle_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>samples_per_second</key> + <value>R</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(514, 105)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_chunks_to_symbols_xx</key> + <param> + <key>id</key> + <value>gr_chunks_to_symbols_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>in_type</key> + <value>short</value> + </param> + <param> + <key>out_type</key> + <value>complex</value> + </param> + <param> + <key>symbol_table</key> + <value>1,0,1j,0,-1j,0,-1,0, 0,1,0,1j,0,-1j,0,-1</value> + </param> + <param> + <key>dimension</key> + <value>2</value> + </param> + <param> + <key>num_ports</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(551, 184)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_noise_source_x</key> + <param> + <key>id</key> + <value>gr_noise_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>noise_type</key> + <value>gr.GR_GAUSSIAN</value> + </param> + <param> + <key>amp</key> + <value>noisevar</value> + </param> + <param> + <key>seed</key> + <value>42</value> + </param> + <param> + <key>_coordinate</key> + <value>(672, 290)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>trellis_sccc_encoder_xx</key> + <param> + <key>id</key> + <value>trellis_sccc_encoder_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>ss</value> + </param> + <param> + <key>o_fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_4.fsm"</value> + </param> + <param> + <key>o_init_state</key> + <value>0</value> + </param> + <param> + <key>i_fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn2o3_4.fsm"</value> + </param> + <param> + <key>i_init_state</key> + <value>0</value> + </param> + <param> + <key>interleaver_args</key> + <value>trellis.interleaver(block,666)</value> + </param> + <param> + <key>bl</key> + <value>block</value> + </param> + <param> + <key>_coordinate</key> + <value>(242, 154)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>wxgui_numbersink2</key> + <param> + <key>id</key> + <value>wxgui_numbersink2_3_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>title</key> + <value>BER</value> + </param> + <param> + <key>units</key> + <value>BER</value> + </param> + <param> + <key>samp_rate</key> + <value>R</value> + </param> + <param> + <key>min_value</key> + <value>0</value> + </param> + <param> + <key>max_value</key> + <value>1.0</value> + </param> + <param> + <key>factor</key> + <value>1.0</value> + </param> + <param> + <key>decimal_places</key> + <value>6</value> + </param> + <param> + <key>ref_level</key> + <value>0</value> + </param> + <param> + <key>number_rate</key> + <value>15</value> + </param> + <param> + <key>peak_hold</key> + <value>False</value> + </param> + <param> + <key>average</key> + <value>True</value> + </param> + <param> + <key>avg_alpha</key> + <value>0.001</value> + </param> + <param> + <key>show_gauge</key> + <value>True</value> + </param> + <param> + <key>win_size</key> + <value></value> + </param> + <param> + <key>grid_pos</key> + <value>1,0,1,1</value> + </param> + <param> + <key>notebook</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(688, 572)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>trellis_sccc_decoder_combined_xx</key> + <param> + <key>id</key> + <value>trellis_sccc_decoder_combined_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>c</value> + </param> + <param> + <key>out_type</key> + <value>s</value> + </param> + <param> + <key>o_fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_4.fsm"</value> + </param> + <param> + <key>o_init_state</key> + <value>0</value> + </param> + <param> + <key>o_final_state</key> + <value>-1</value> + </param> + <param> + <key>i_fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn2o3_4.fsm"</value> + </param> + <param> + <key>i_init_state</key> + <value>0</value> + </param> + <param> + <key>i_final_state</key> + <value>-1</value> + </param> + <param> + <key>interleaver</key> + <value>trellis.interleaver(block,666)</value> + </param> + <param> + <key>block_size</key> + <value>block</value> + </param> + <param> + <key>iterations</key> + <value>5</value> + </param> + <param> + <key>dim</key> + <value>2</value> + </param> + <param> + <key>table</key> + <value>1,0,1j,0,-1j,0,-1,0, 0,1,0,1j,0,-1j,0,-1</value> + </param> + <param> + <key>metric_type</key> + <value>trellis.TRELLIS_EUCLIDEAN</value> + </param> + <param> + <key>siso_type</key> + <value>trellis.TRELLIS_SUM_PRODUCT</value> + </param> + <param> + <key>scaling</key> + <value>1.0</value> + </param> + <param> + <key>_coordinate</key> + <value>(159, 335)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <connection> + <source_block_id>random_source_x_0</source_block_id> + <sink_block_id>gr_sub_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_throttle_0</source_block_id> + <sink_block_id>gr_chunks_to_symbols_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_add_xx_1</source_block_id> + <sink_block_id>wxgui_scopesink2_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_noise_source_x_0</source_block_id> + <sink_block_id>gr_add_xx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>gr_chunks_to_symbols_xx_0</source_block_id> + <sink_block_id>gr_add_xx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>random_source_x_0</source_block_id> + <sink_block_id>trellis_sccc_encoder_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>trellis_sccc_encoder_xx_0</source_block_id> + <sink_block_id>gr_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_add_xx_1</source_block_id> + <sink_block_id>trellis_sccc_decoder_combined_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>trellis_sccc_decoder_combined_xx_0</source_block_id> + <sink_block_id>gr_sub_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>gr_multiply_xx_2_0</source_block_id> + <sink_block_id>gr_short_to_float_1_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_short_to_float_1_0</source_block_id> + <sink_block_id>wxgui_numbersink2_3_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_sub_xx_0</source_block_id> + <sink_block_id>gr_multiply_xx_2_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_sub_xx_0</source_block_id> + <sink_block_id>gr_multiply_xx_2_0</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> +</flow_graph> diff --git a/gr-trellis/src/examples/grc/sccc1.grc b/gr-trellis/src/examples/grc/sccc1.grc new file mode 100644 index 000000000..0be59d0c4 --- /dev/null +++ b/gr-trellis/src/examples/grc/sccc1.grc @@ -0,0 +1,857 @@ +<?xml version='1.0' encoding='ASCII'?> +<flow_graph> + <timestamp>Wed Aug 31 20:09:23 2011</timestamp> + <block> + <key>options</key> + <param> + <key>id</key> + <value>sccc1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value>Serially Concatenated Convolutional Code</value> + </param> + <param> + <key>author</key> + <value>AA</value> + </param> + <param> + <key>description</key> + <value>gnuradio flow graph</value> + </param> + <param> + <key>window_size</key> + <value>2048, 2048</value> + </param> + <param> + <key>generate_options</key> + <value>wx_gui</value> + </param> + <param> + <key>category</key> + <value>Custom</value> + </param> + <param> + <key>run_options</key> + <value>prompt</value> + </param> + <param> + <key>run</key> + <value>True</value> + </param> + <param> + <key>realtime_scheduling</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>noisevar</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>10**(-snr_db/10)</value> + </param> + <param> + <key>_coordinate</key> + <value>(389, 15)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>random_source_x</key> + <param> + <key>id</key> + <value>random_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>2</value> + </param> + <param> + <key>num_samps</key> + <value>1000</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(21, 170)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>prefix</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"/n/harrisville/x/anastas/gnuradio_trunk/"</value> + </param> + <param> + <key>_coordinate</key> + <value>(590, 15)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>block</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>1000</value> + </param> + <param> + <key>_coordinate</key> + <value>(764, 16)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_slider</key> + <param> + <key>id</key> + <value>snr_db</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>SNR (dB)</value> + </param> + <param> + <key>value</key> + <value>5</value> + </param> + <param> + <key>min</key> + <value>-10</value> + </param> + <param> + <key>max</key> + <value>10</value> + </param> + <param> + <key>num_steps</key> + <value>100</value> + </param> + <param> + <key>style</key> + <value>wx.SL_HORIZONTAL</value> + </param> + <param> + <key>converver</key> + <value>float_converter</value> + </param> + <param> + <key>grid_pos</key> + <value></value> + </param> + <param> + <key>notebook</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(229, 13)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>R</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>10e3</value> + </param> + <param> + <key>_coordinate</key> + <value>(482, 17)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>trellis_sccc_encoder_xx</key> + <param> + <key>id</key> + <value>trellis_sccc_encoder_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>ss</value> + </param> + <param> + <key>o_fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_4.fsm"</value> + </param> + <param> + <key>o_init_state</key> + <value>0</value> + </param> + <param> + <key>i_fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn2o3_4.fsm"</value> + </param> + <param> + <key>i_init_state</key> + <value>0</value> + </param> + <param> + <key>interleaver_args</key> + <value>trellis.interleaver(block,666)</value> + </param> + <param> + <key>bl</key> + <value>block</value> + </param> + <param> + <key>_coordinate</key> + <value>(242, 154)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>trellis_sccc_decoder_x</key> + <param> + <key>id</key> + <value>trellis_sccc_decoder_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>out_type</key> + <value>s</value> + </param> + <param> + <key>o_fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_4.fsm"</value> + </param> + <param> + <key>o_init_state</key> + <value>0</value> + </param> + <param> + <key>o_final_state</key> + <value>-1</value> + </param> + <param> + <key>i_fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn2o3_4.fsm"</value> + </param> + <param> + <key>i_init_state</key> + <value>0</value> + </param> + <param> + <key>i_final_state</key> + <value>-1</value> + </param> + <param> + <key>interleaver</key> + <value>trellis.interleaver(block,666)</value> + </param> + <param> + <key>block_size</key> + <value>block</value> + </param> + <param> + <key>iterations</key> + <value>10</value> + </param> + <param> + <key>siso_type</key> + <value>trellis.TRELLIS_MIN_SUM</value> + </param> + <param> + <key>_coordinate</key> + <value>(333, 305)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_sub_xx</key> + <param> + <key>id</key> + <value>gr_sub_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>_coordinate</key> + <value>(217, 597)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_multiply_xx</key> + <param> + <key>id</key> + <value>gr_multiply_xx_2_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(392, 591)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_short_to_float</key> + <param> + <key>id</key> + <value>gr_short_to_float_1_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(535, 609)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>wxgui_numbersink2</key> + <param> + <key>id</key> + <value>wxgui_numbersink2_3_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>title</key> + <value>BER</value> + </param> + <param> + <key>units</key> + <value>BER</value> + </param> + <param> + <key>samp_rate</key> + <value>R</value> + </param> + <param> + <key>min_value</key> + <value>0</value> + </param> + <param> + <key>max_value</key> + <value>1.0</value> + </param> + <param> + <key>factor</key> + <value>1.0</value> + </param> + <param> + <key>decimal_places</key> + <value>6</value> + </param> + <param> + <key>ref_level</key> + <value>0</value> + </param> + <param> + <key>number_rate</key> + <value>15</value> + </param> + <param> + <key>peak_hold</key> + <value>False</value> + </param> + <param> + <key>average</key> + <value>True</value> + </param> + <param> + <key>avg_alpha</key> + <value>0.001</value> + </param> + <param> + <key>show_gauge</key> + <value>True</value> + </param> + <param> + <key>win_size</key> + <value></value> + </param> + <param> + <key>grid_pos</key> + <value>1,0,1,1</value> + </param> + <param> + <key>notebook</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(713, 426)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_noise_source_x</key> + <param> + <key>id</key> + <value>gr_noise_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>noise_type</key> + <value>gr.GR_GAUSSIAN</value> + </param> + <param> + <key>amp</key> + <value>noisevar</value> + </param> + <param> + <key>seed</key> + <value>42</value> + </param> + <param> + <key>_coordinate</key> + <value>(672, 290)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_add_xx</key> + <param> + <key>id</key> + <value>gr_add_xx_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(951, 256)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>trellis_metrics_x</key> + <param> + <key>id</key> + <value>trellis_metrics_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>f</value> + </param> + <param> + <key>card</key> + <value>8</value> + </param> + <param> + <key>dim</key> + <value>1</value> + </param> + <param> + <key>table</key> + <value>-7, -5, -3, -1, 1, 3, 5, 7</value> + </param> + <param> + <key>metric_type</key> + <value>trellis.TRELLIS_EUCLIDEAN</value> + </param> + <param> + <key>_coordinate</key> + <value>(58, 354)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_throttle</key> + <param> + <key>id</key> + <value>gr_throttle_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>samples_per_second</key> + <value>R</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(517, 103)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>wxgui_scopesink2</key> + <param> + <key>id</key> + <value>wxgui_scopesink2_0</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>title</key> + <value>Scope Plot</value> + </param> + <param> + <key>samp_rate</key> + <value>R</value> + </param> + <param> + <key>v_scale</key> + <value>0</value> + </param> + <param> + <key>v_offset</key> + <value>0</value> + </param> + <param> + <key>t_scale</key> + <value>0</value> + </param> + <param> + <key>ac_couple</key> + <value>False</value> + </param> + <param> + <key>xy_mode</key> + <value>False</value> + </param> + <param> + <key>num_inputs</key> + <value>1</value> + </param> + <param> + <key>win_size</key> + <value></value> + </param> + <param> + <key>grid_pos</key> + <value></value> + </param> + <param> + <key>notebook</key> + <value></value> + </param> + <param> + <key>trig_mode</key> + <value>gr.gr_TRIG_MODE_AUTO</value> + </param> + <param> + <key>y_axis_label</key> + <value>Counts</value> + </param> + <param> + <key>_coordinate</key> + <value>(952, 73)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_chunks_to_symbols_xx</key> + <param> + <key>id</key> + <value>gr_chunks_to_symbols_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>in_type</key> + <value>short</value> + </param> + <param> + <key>out_type</key> + <value>float</value> + </param> + <param> + <key>symbol_table</key> + <value>-7, -5, -3, -1, 1, 3, 5, 7</value> + </param> + <param> + <key>dimension</key> + <value>1</value> + </param> + <param> + <key>num_ports</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(551, 184)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <connection> + <source_block_id>random_source_x_0</source_block_id> + <sink_block_id>gr_sub_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_throttle_0</source_block_id> + <sink_block_id>gr_chunks_to_symbols_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_add_xx_1</source_block_id> + <sink_block_id>wxgui_scopesink2_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_noise_source_x_0</source_block_id> + <sink_block_id>gr_add_xx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>gr_chunks_to_symbols_xx_0</source_block_id> + <sink_block_id>gr_add_xx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>random_source_x_0</source_block_id> + <sink_block_id>trellis_sccc_encoder_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>trellis_sccc_encoder_xx_0</source_block_id> + <sink_block_id>gr_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_multiply_xx_2_0</source_block_id> + <sink_block_id>gr_short_to_float_1_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_short_to_float_1_0</source_block_id> + <sink_block_id>wxgui_numbersink2_3_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_sub_xx_0</source_block_id> + <sink_block_id>gr_multiply_xx_2_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_sub_xx_0</source_block_id> + <sink_block_id>gr_multiply_xx_2_0</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>gr_add_xx_1</source_block_id> + <sink_block_id>trellis_metrics_x_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>trellis_metrics_x_0</source_block_id> + <sink_block_id>trellis_sccc_decoder_x_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>trellis_sccc_decoder_x_0</source_block_id> + <sink_block_id>gr_sub_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> +</flow_graph> diff --git a/gr-trellis/src/examples/CMakeLists.txt b/gr-trellis/src/examples/python/CMakeLists.txt index 0d9589908..e2c7e70ff 100644 --- a/gr-trellis/src/examples/CMakeLists.txt +++ b/gr-trellis/src/examples/python/CMakeLists.txt @@ -33,7 +33,7 @@ GR_PYTHON_INSTALL( test_turbo_equalization.py test_turbo_equalization1.py test_turbo_equalization2.py - DESTINATION ${GR_PKG_DATA_DIR}/examples/trellis + DESTINATION ${GR_PKG_TRELLIS_EXAMPLES_DIR} COMPONENT "trellis_examples" ) @@ -59,6 +59,6 @@ install( fsm_files/rep3.fsm fsm_files/rep5.fsm fsm_files/simple.fsm - DESTINATION ${GR_PKG_DATA_DIR}/examples/trellis/fsm_files + DESTINATION ${GR_PKG_TRELLIS_EXAMPLES_DIR}/fsm_files COMPONENT "trellis_examples" ) diff --git a/gr-trellis/src/examples/README b/gr-trellis/src/examples/python/README index bd28e3d61..d51f231ac 100644 --- a/gr-trellis/src/examples/README +++ b/gr-trellis/src/examples/python/README @@ -1,5 +1,5 @@ Here we have several test programs for use with the gr-trellis implementation. -Documentation can be found in +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. @@ -28,8 +28,8 @@ number of packets in error estimated packet error rate number of transmitted shorts (or symbols, or bits, depending on the specific program) number of shorts (or symbols, or bits) in error -estimated short (or symbol, or bit) error rate +estimated short (or symbol, or bit) error rate -for instance, the final number 1.10e-03 is the error rate estimate by sending 1000 -packets of 1024 shorts each, using an 1/2 4-state convolutional code +for instance, the final number 1.10e-03 is the error rate estimate by sending 1000 +packets of 1024 shorts each, using an 1/2 4-state convolutional code and QPSK modulation through an AWGN with Es/N0 = 6.0 dB diff --git a/gr-trellis/src/examples/python/fsm_files/awgn1o2_128.fsm b/gr-trellis/src/examples/python/fsm_files/awgn1o2_128.fsm new file mode 100644 index 000000000..4b47007c5 --- /dev/null +++ b/gr-trellis/src/examples/python/fsm_files/awgn1o2_128.fsm @@ -0,0 +1,265 @@ +2 128 4 + +0 64 +0 64 +1 65 +1 65 +2 66 +2 66 +3 67 +3 67 +4 68 +4 68 +5 69 +5 69 +6 70 +6 70 +7 71 +7 71 +8 72 +8 72 +9 73 +9 73 +10 74 +10 74 +11 75 +11 75 +12 76 +12 76 +13 77 +13 77 +14 78 +14 78 +15 79 +15 79 +16 80 +16 80 +17 81 +17 81 +18 82 +18 82 +19 83 +19 83 +20 84 +20 84 +21 85 +21 85 +22 86 +22 86 +23 87 +23 87 +24 88 +24 88 +25 89 +25 89 +26 90 +26 90 +27 91 +27 91 +28 92 +28 92 +29 93 +29 93 +30 94 +30 94 +31 95 +31 95 +32 96 +32 96 +33 97 +33 97 +34 98 +34 98 +35 99 +35 99 +36 100 +36 100 +37 101 +37 101 +38 102 +38 102 +39 103 +39 103 +40 104 +40 104 +41 105 +41 105 +42 106 +42 106 +43 107 +43 107 +44 108 +44 108 +45 109 +45 109 +46 110 +46 110 +47 111 +47 111 +48 112 +48 112 +49 113 +49 113 +50 114 +50 114 +51 115 +51 115 +52 116 +52 116 +53 117 +53 117 +54 118 +54 118 +55 119 +55 119 +56 120 +56 120 +57 121 +57 121 +58 122 +58 122 +59 123 +59 123 +60 124 +60 124 +61 125 +61 125 +62 126 +62 126 +63 127 +63 127 + +0 3 +3 0 +1 2 +2 1 +3 0 +0 3 +2 1 +1 2 +1 2 +2 1 +0 3 +3 0 +2 1 +1 2 +3 0 +0 3 +1 2 +2 1 +0 3 +3 0 +2 1 +1 2 +3 0 +0 3 +0 3 +3 0 +1 2 +2 1 +3 0 +0 3 +2 1 +1 2 +2 1 +1 2 +3 0 +0 3 +1 2 +2 1 +0 3 +3 0 +3 0 +0 3 +2 1 +1 2 +0 3 +3 0 +1 2 +2 1 +3 0 +0 3 +2 1 +1 2 +0 3 +3 0 +1 2 +2 1 +2 1 +1 2 +3 0 +0 3 +1 2 +2 1 +0 3 +3 0 +2 1 +1 2 +3 0 +0 3 +1 2 +2 1 +0 3 +3 0 +3 0 +0 3 +2 1 +1 2 +0 3 +3 0 +1 2 +2 1 +3 0 +0 3 +2 1 +1 2 +0 3 +3 0 +1 2 +2 1 +2 1 +1 2 +3 0 +0 3 +1 2 +2 1 +0 3 +3 0 +0 3 +3 0 +1 2 +2 1 +3 0 +0 3 +2 1 +1 2 +1 2 +2 1 +0 3 +3 0 +2 1 +1 2 +3 0 +0 3 +1 2 +2 1 +0 3 +3 0 +2 1 +1 2 +3 0 +0 3 +0 3 +3 0 +1 2 +2 1 +3 0 +0 3 +2 1 +1 2 + + + +GM1o2_128=[1+D+D^2+D^5+D^7 1+D^3+D^4+D^5+D^6+D^7] + =[11100101 10011111] + =[229 159] diff --git a/gr-trellis/src/examples/fsm_files/awgn1o2_16.fsm b/gr-trellis/src/examples/python/fsm_files/awgn1o2_16.fsm index cdab41359..cdab41359 100644 --- a/gr-trellis/src/examples/fsm_files/awgn1o2_16.fsm +++ b/gr-trellis/src/examples/python/fsm_files/awgn1o2_16.fsm diff --git a/gr-trellis/src/examples/fsm_files/awgn1o2_4.fsm b/gr-trellis/src/examples/python/fsm_files/awgn1o2_4.fsm index fb316b5ef..fb316b5ef 100644 --- a/gr-trellis/src/examples/fsm_files/awgn1o2_4.fsm +++ b/gr-trellis/src/examples/python/fsm_files/awgn1o2_4.fsm diff --git a/gr-trellis/src/examples/fsm_files/awgn1o2_8.fsm b/gr-trellis/src/examples/python/fsm_files/awgn1o2_8.fsm index 604bac6c2..604bac6c2 100644 --- a/gr-trellis/src/examples/fsm_files/awgn1o2_8.fsm +++ b/gr-trellis/src/examples/python/fsm_files/awgn1o2_8.fsm diff --git a/gr-trellis/src/examples/fsm_files/awgn2o3_16.fsm b/gr-trellis/src/examples/python/fsm_files/awgn2o3_16.fsm index 9630cd9af..9630cd9af 100644 --- a/gr-trellis/src/examples/fsm_files/awgn2o3_16.fsm +++ b/gr-trellis/src/examples/python/fsm_files/awgn2o3_16.fsm diff --git a/gr-trellis/src/examples/fsm_files/awgn2o3_4.fsm b/gr-trellis/src/examples/python/fsm_files/awgn2o3_4.fsm index 3ac57be18..3ac57be18 100644 --- a/gr-trellis/src/examples/fsm_files/awgn2o3_4.fsm +++ b/gr-trellis/src/examples/python/fsm_files/awgn2o3_4.fsm diff --git a/gr-trellis/src/examples/fsm_files/awgn2o3_4_msb.fsm b/gr-trellis/src/examples/python/fsm_files/awgn2o3_4_msb.fsm index 551b71101..d834c5271 100644 --- a/gr-trellis/src/examples/fsm_files/awgn2o3_4_msb.fsm +++ b/gr-trellis/src/examples/python/fsm_files/awgn2o3_4_msb.fsm @@ -8,7 +8,7 @@ 0 5 3 6 4 1 7 2 7 2 4 1 -3 6 0 5 +3 6 0 5 This is generated by the 1/2 AWGN code (5 7) operated twice, ie, diff --git a/gr-trellis/src/examples/fsm_files/awgn2o3_4_msbG.fsm b/gr-trellis/src/examples/python/fsm_files/awgn2o3_4_msbG.fsm index 8956c53da..8956c53da 100644 --- a/gr-trellis/src/examples/fsm_files/awgn2o3_4_msbG.fsm +++ b/gr-trellis/src/examples/python/fsm_files/awgn2o3_4_msbG.fsm diff --git a/gr-trellis/src/examples/fsm_files/awgn2o3_8.fsm b/gr-trellis/src/examples/python/fsm_files/awgn2o3_8.fsm index 34deeb68c..34deeb68c 100644 --- a/gr-trellis/src/examples/fsm_files/awgn2o3_8.fsm +++ b/gr-trellis/src/examples/python/fsm_files/awgn2o3_8.fsm diff --git a/gr-trellis/src/examples/fsm_files/awgn2o4_4.fsm b/gr-trellis/src/examples/python/fsm_files/awgn2o4_4.fsm index a895be896..a895be896 100644 --- a/gr-trellis/src/examples/fsm_files/awgn2o4_4.fsm +++ b/gr-trellis/src/examples/python/fsm_files/awgn2o4_4.fsm diff --git a/gr-trellis/src/examples/fsm_files/disconnected.fsm b/gr-trellis/src/examples/python/fsm_files/disconnected.fsm index 847963e7b..847963e7b 100644 --- a/gr-trellis/src/examples/fsm_files/disconnected.fsm +++ b/gr-trellis/src/examples/python/fsm_files/disconnected.fsm diff --git a/gr-trellis/src/examples/fsm_files/irregular.fsm b/gr-trellis/src/examples/python/fsm_files/irregular.fsm index 80b82b889..80b82b889 100644 --- a/gr-trellis/src/examples/fsm_files/irregular.fsm +++ b/gr-trellis/src/examples/python/fsm_files/irregular.fsm diff --git a/gr-trellis/src/examples/python/fsm_files/joint_16_16.fsm b/gr-trellis/src/examples/python/fsm_files/joint_16_16.fsm new file mode 100644 index 000000000..293ff4e7c --- /dev/null +++ b/gr-trellis/src/examples/python/fsm_files/joint_16_16.fsm @@ -0,0 +1,523 @@ +4 256 16 + +0 8 128 136 +0 8 128 136 +1 9 129 137 +1 9 129 137 +2 10 130 138 +2 10 130 138 +3 11 131 139 +3 11 131 139 +4 12 132 140 +4 12 132 140 +5 13 133 141 +5 13 133 141 +6 14 134 142 +6 14 134 142 +7 15 135 143 +7 15 135 143 +0 8 128 136 +0 8 128 136 +1 9 129 137 +1 9 129 137 +2 10 130 138 +2 10 130 138 +3 11 131 139 +3 11 131 139 +4 12 132 140 +4 12 132 140 +5 13 133 141 +5 13 133 141 +6 14 134 142 +6 14 134 142 +7 15 135 143 +7 15 135 143 +16 24 144 152 +16 24 144 152 +17 25 145 153 +17 25 145 153 +18 26 146 154 +18 26 146 154 +19 27 147 155 +19 27 147 155 +20 28 148 156 +20 28 148 156 +21 29 149 157 +21 29 149 157 +22 30 150 158 +22 30 150 158 +23 31 151 159 +23 31 151 159 +16 24 144 152 +16 24 144 152 +17 25 145 153 +17 25 145 153 +18 26 146 154 +18 26 146 154 +19 27 147 155 +19 27 147 155 +20 28 148 156 +20 28 148 156 +21 29 149 157 +21 29 149 157 +22 30 150 158 +22 30 150 158 +23 31 151 159 +23 31 151 159 +32 40 160 168 +32 40 160 168 +33 41 161 169 +33 41 161 169 +34 42 162 170 +34 42 162 170 +35 43 163 171 +35 43 163 171 +36 44 164 172 +36 44 164 172 +37 45 165 173 +37 45 165 173 +38 46 166 174 +38 46 166 174 +39 47 167 175 +39 47 167 175 +32 40 160 168 +32 40 160 168 +33 41 161 169 +33 41 161 169 +34 42 162 170 +34 42 162 170 +35 43 163 171 +35 43 163 171 +36 44 164 172 +36 44 164 172 +37 45 165 173 +37 45 165 173 +38 46 166 174 +38 46 166 174 +39 47 167 175 +39 47 167 175 +48 56 176 184 +48 56 176 184 +49 57 177 185 +49 57 177 185 +50 58 178 186 +50 58 178 186 +51 59 179 187 +51 59 179 187 +52 60 180 188 +52 60 180 188 +53 61 181 189 +53 61 181 189 +54 62 182 190 +54 62 182 190 +55 63 183 191 +55 63 183 191 +48 56 176 184 +48 56 176 184 +49 57 177 185 +49 57 177 185 +50 58 178 186 +50 58 178 186 +51 59 179 187 +51 59 179 187 +52 60 180 188 +52 60 180 188 +53 61 181 189 +53 61 181 189 +54 62 182 190 +54 62 182 190 +55 63 183 191 +55 63 183 191 +64 72 192 200 +64 72 192 200 +65 73 193 201 +65 73 193 201 +66 74 194 202 +66 74 194 202 +67 75 195 203 +67 75 195 203 +68 76 196 204 +68 76 196 204 +69 77 197 205 +69 77 197 205 +70 78 198 206 +70 78 198 206 +71 79 199 207 +71 79 199 207 +64 72 192 200 +64 72 192 200 +65 73 193 201 +65 73 193 201 +66 74 194 202 +66 74 194 202 +67 75 195 203 +67 75 195 203 +68 76 196 204 +68 76 196 204 +69 77 197 205 +69 77 197 205 +70 78 198 206 +70 78 198 206 +71 79 199 207 +71 79 199 207 +80 88 208 216 +80 88 208 216 +81 89 209 217 +81 89 209 217 +82 90 210 218 +82 90 210 218 +83 91 211 219 +83 91 211 219 +84 92 212 220 +84 92 212 220 +85 93 213 221 +85 93 213 221 +86 94 214 222 +86 94 214 222 +87 95 215 223 +87 95 215 223 +80 88 208 216 +80 88 208 216 +81 89 209 217 +81 89 209 217 +82 90 210 218 +82 90 210 218 +83 91 211 219 +83 91 211 219 +84 92 212 220 +84 92 212 220 +85 93 213 221 +85 93 213 221 +86 94 214 222 +86 94 214 222 +87 95 215 223 +87 95 215 223 +96 104 224 232 +96 104 224 232 +97 105 225 233 +97 105 225 233 +98 106 226 234 +98 106 226 234 +99 107 227 235 +99 107 227 235 +100 108 228 236 +100 108 228 236 +101 109 229 237 +101 109 229 237 +102 110 230 238 +102 110 230 238 +103 111 231 239 +103 111 231 239 +96 104 224 232 +96 104 224 232 +97 105 225 233 +97 105 225 233 +98 106 226 234 +98 106 226 234 +99 107 227 235 +99 107 227 235 +100 108 228 236 +100 108 228 236 +101 109 229 237 +101 109 229 237 +102 110 230 238 +102 110 230 238 +103 111 231 239 +103 111 231 239 +112 120 240 248 +112 120 240 248 +113 121 241 249 +113 121 241 249 +114 122 242 250 +114 122 242 250 +115 123 243 251 +115 123 243 251 +116 124 244 252 +116 124 244 252 +117 125 245 253 +117 125 245 253 +118 126 246 254 +118 126 246 254 +119 127 247 255 +119 127 247 255 +112 120 240 248 +112 120 240 248 +113 121 241 249 +113 121 241 249 +114 122 242 250 +114 122 242 250 +115 123 243 251 +115 123 243 251 +116 124 244 252 +116 124 244 252 +117 125 245 253 +117 125 245 253 +118 126 246 254 +118 126 246 254 +119 127 247 255 +119 127 247 255 + +0 3 12 15 +3 0 15 12 +1 2 13 14 +2 1 14 13 +1 2 13 14 +2 1 14 13 +0 3 12 15 +3 0 15 12 +2 1 14 13 +1 2 13 14 +3 0 15 12 +0 3 12 15 +3 0 15 12 +0 3 12 15 +2 1 14 13 +1 2 13 14 +12 15 0 3 +15 12 3 0 +13 14 1 2 +14 13 2 1 +13 14 1 2 +14 13 2 1 +12 15 0 3 +15 12 3 0 +14 13 2 1 +13 14 1 2 +15 12 3 0 +12 15 0 3 +15 12 3 0 +12 15 0 3 +14 13 2 1 +13 14 1 2 +4 7 8 11 +7 4 11 8 +5 6 9 10 +6 5 10 9 +5 6 9 10 +6 5 10 9 +4 7 8 11 +7 4 11 8 +6 5 10 9 +5 6 9 10 +7 4 11 8 +4 7 8 11 +7 4 11 8 +4 7 8 11 +6 5 10 9 +5 6 9 10 +8 11 4 7 +11 8 7 4 +9 10 5 6 +10 9 6 5 +9 10 5 6 +10 9 6 5 +8 11 4 7 +11 8 7 4 +10 9 6 5 +9 10 5 6 +11 8 7 4 +8 11 4 7 +11 8 7 4 +8 11 4 7 +10 9 6 5 +9 10 5 6 +4 7 8 11 +7 4 11 8 +5 6 9 10 +6 5 10 9 +5 6 9 10 +6 5 10 9 +4 7 8 11 +7 4 11 8 +6 5 10 9 +5 6 9 10 +7 4 11 8 +4 7 8 11 +7 4 11 8 +4 7 8 11 +6 5 10 9 +5 6 9 10 +8 11 4 7 +11 8 7 4 +9 10 5 6 +10 9 6 5 +9 10 5 6 +10 9 6 5 +8 11 4 7 +11 8 7 4 +10 9 6 5 +9 10 5 6 +11 8 7 4 +8 11 4 7 +11 8 7 4 +8 11 4 7 +10 9 6 5 +9 10 5 6 +0 3 12 15 +3 0 15 12 +1 2 13 14 +2 1 14 13 +1 2 13 14 +2 1 14 13 +0 3 12 15 +3 0 15 12 +2 1 14 13 +1 2 13 14 +3 0 15 12 +0 3 12 15 +3 0 15 12 +0 3 12 15 +2 1 14 13 +1 2 13 14 +12 15 0 3 +15 12 3 0 +13 14 1 2 +14 13 2 1 +13 14 1 2 +14 13 2 1 +12 15 0 3 +15 12 3 0 +14 13 2 1 +13 14 1 2 +15 12 3 0 +12 15 0 3 +15 12 3 0 +12 15 0 3 +14 13 2 1 +13 14 1 2 +8 11 4 7 +11 8 7 4 +9 10 5 6 +10 9 6 5 +9 10 5 6 +10 9 6 5 +8 11 4 7 +11 8 7 4 +10 9 6 5 +9 10 5 6 +11 8 7 4 +8 11 4 7 +11 8 7 4 +8 11 4 7 +10 9 6 5 +9 10 5 6 +4 7 8 11 +7 4 11 8 +5 6 9 10 +6 5 10 9 +5 6 9 10 +6 5 10 9 +4 7 8 11 +7 4 11 8 +6 5 10 9 +5 6 9 10 +7 4 11 8 +4 7 8 11 +7 4 11 8 +4 7 8 11 +6 5 10 9 +5 6 9 10 +12 15 0 3 +15 12 3 0 +13 14 1 2 +14 13 2 1 +13 14 1 2 +14 13 2 1 +12 15 0 3 +15 12 3 0 +14 13 2 1 +13 14 1 2 +15 12 3 0 +12 15 0 3 +15 12 3 0 +12 15 0 3 +14 13 2 1 +13 14 1 2 +0 3 12 15 +3 0 15 12 +1 2 13 14 +2 1 14 13 +1 2 13 14 +2 1 14 13 +0 3 12 15 +3 0 15 12 +2 1 14 13 +1 2 13 14 +3 0 15 12 +0 3 12 15 +3 0 15 12 +0 3 12 15 +2 1 14 13 +1 2 13 14 +12 15 0 3 +15 12 3 0 +13 14 1 2 +14 13 2 1 +13 14 1 2 +14 13 2 1 +12 15 0 3 +15 12 3 0 +14 13 2 1 +13 14 1 2 +15 12 3 0 +12 15 0 3 +15 12 3 0 +12 15 0 3 +14 13 2 1 +13 14 1 2 +0 3 12 15 +3 0 15 12 +1 2 13 14 +2 1 14 13 +1 2 13 14 +2 1 14 13 +0 3 12 15 +3 0 15 12 +2 1 14 13 +1 2 13 14 +3 0 15 12 +0 3 12 15 +3 0 15 12 +0 3 12 15 +2 1 14 13 +1 2 13 14 +8 11 4 7 +11 8 7 4 +9 10 5 6 +10 9 6 5 +9 10 5 6 +10 9 6 5 +8 11 4 7 +11 8 7 4 +10 9 6 5 +9 10 5 6 +11 8 7 4 +8 11 4 7 +11 8 7 4 +8 11 4 7 +10 9 6 5 +9 10 5 6 +4 7 8 11 +7 4 11 8 +5 6 9 10 +6 5 10 9 +5 6 9 10 +6 5 10 9 +4 7 8 11 +7 4 11 8 +6 5 10 9 +5 6 9 10 +7 4 11 8 +4 7 8 11 +7 4 11 8 +4 7 8 11 +6 5 10 9 +5 6 9 10 + +This is the joint trellis of two trellises described in awgn1o2_16.fsm +It is useful for application of joint decoding... +It can be generated in python as follows: +> import trellis +> f1=trellis.fsm('awgn1o2_16.fsm') +> f=trellis.fsm(f1,f1) +> f.write_fsm_txt('joint_16_16.fsm') diff --git a/gr-trellis/src/examples/python/fsm_files/joint_4_16.fsm b/gr-trellis/src/examples/python/fsm_files/joint_4_16.fsm new file mode 100644 index 000000000..427a18207 --- /dev/null +++ b/gr-trellis/src/examples/python/fsm_files/joint_4_16.fsm @@ -0,0 +1,141 @@ +4 64 16 + +0 8 32 40 +0 8 32 40 +1 9 33 41 +1 9 33 41 +2 10 34 42 +2 10 34 42 +3 11 35 43 +3 11 35 43 +4 12 36 44 +4 12 36 44 +5 13 37 45 +5 13 37 45 +6 14 38 46 +6 14 38 46 +7 15 39 47 +7 15 39 47 +0 8 32 40 +0 8 32 40 +1 9 33 41 +1 9 33 41 +2 10 34 42 +2 10 34 42 +3 11 35 43 +3 11 35 43 +4 12 36 44 +4 12 36 44 +5 13 37 45 +5 13 37 45 +6 14 38 46 +6 14 38 46 +7 15 39 47 +7 15 39 47 +16 24 48 56 +16 24 48 56 +17 25 49 57 +17 25 49 57 +18 26 50 58 +18 26 50 58 +19 27 51 59 +19 27 51 59 +20 28 52 60 +20 28 52 60 +21 29 53 61 +21 29 53 61 +22 30 54 62 +22 30 54 62 +23 31 55 63 +23 31 55 63 +16 24 48 56 +16 24 48 56 +17 25 49 57 +17 25 49 57 +18 26 50 58 +18 26 50 58 +19 27 51 59 +19 27 51 59 +20 28 52 60 +20 28 52 60 +21 29 53 61 +21 29 53 61 +22 30 54 62 +22 30 54 62 +23 31 55 63 +23 31 55 63 + +0 3 12 15 +3 0 15 12 +1 2 13 14 +2 1 14 13 +1 2 13 14 +2 1 14 13 +0 3 12 15 +3 0 15 12 +2 1 14 13 +1 2 13 14 +3 0 15 12 +0 3 12 15 +3 0 15 12 +0 3 12 15 +2 1 14 13 +1 2 13 14 +12 15 0 3 +15 12 3 0 +13 14 1 2 +14 13 2 1 +13 14 1 2 +14 13 2 1 +12 15 0 3 +15 12 3 0 +14 13 2 1 +13 14 1 2 +15 12 3 0 +12 15 0 3 +15 12 3 0 +12 15 0 3 +14 13 2 1 +13 14 1 2 +4 7 8 11 +7 4 11 8 +5 6 9 10 +6 5 10 9 +5 6 9 10 +6 5 10 9 +4 7 8 11 +7 4 11 8 +6 5 10 9 +5 6 9 10 +7 4 11 8 +4 7 8 11 +7 4 11 8 +4 7 8 11 +6 5 10 9 +5 6 9 10 +8 11 4 7 +11 8 7 4 +9 10 5 6 +10 9 6 5 +9 10 5 6 +10 9 6 5 +8 11 4 7 +11 8 7 4 +10 9 6 5 +9 10 5 6 +11 8 7 4 +8 11 4 7 +11 8 7 4 +8 11 4 7 +10 9 6 5 +9 10 5 6 + +This is the joint trellis of two trellises described in awgn1o2_4.fsm and awgn1o2_16.fsm +It is useful for application of joint decoding... +It can be generated in python as follows: +> import trellis +> f1=trellis.fsm('awgn1o2_4.fsm') +> f2=trellis.fsm('awgn1o2_16.fsm') +> f=trellis.fsm(f1,f2) +> f.write_fsm_txt('joint_4_16.fsm') + diff --git a/gr-trellis/src/examples/fsm_files/rep3.fsm b/gr-trellis/src/examples/python/fsm_files/rep3.fsm index ef1bd1f02..ef1bd1f02 100644 --- a/gr-trellis/src/examples/fsm_files/rep3.fsm +++ b/gr-trellis/src/examples/python/fsm_files/rep3.fsm diff --git a/gr-trellis/src/examples/fsm_files/rep5.fsm b/gr-trellis/src/examples/python/fsm_files/rep5.fsm index 2aa5d77cf..2aa5d77cf 100644 --- a/gr-trellis/src/examples/fsm_files/rep5.fsm +++ b/gr-trellis/src/examples/python/fsm_files/rep5.fsm diff --git a/gr-trellis/src/examples/fsm_files/simple.fsm b/gr-trellis/src/examples/python/fsm_files/simple.fsm index f27f6b4b0..f27f6b4b0 100644 --- a/gr-trellis/src/examples/fsm_files/simple.fsm +++ b/gr-trellis/src/examples/python/fsm_files/simple.fsm diff --git a/gr-trellis/src/examples/fsm_utils.py b/gr-trellis/src/examples/python/fsm_utils.py index e9243f899..06855ea77 100755 --- a/gr-trellis/src/examples/fsm_utils.py +++ b/gr-trellis/src/examples/python/fsm_utils.py @@ -72,7 +72,7 @@ def base2dec(s,base): # to channel inputs corresponding to a channel 'channel' and a modulation # 'mod'. Optional normalization of channel to unit energy. # This table is used by the 'metrics' block to translate -# channel outputs to metrics for use with the Viterbi algorithm. +# channel outputs to metrics for use with the Viterbi algorithm. # Limitations: currently supports only one-dimensional modulations. ###################################################################### def make_isi_lookup(mod,channel,normalize): @@ -102,7 +102,7 @@ def make_isi_lookup(mod,channel,normalize): ###################################################################### # Automatically generate the signals appropriate for CPM -# decomposition. +# decomposition. # This decomposition is based on the paper by B. Rimoldi # "A decomposition approach to CPM", IEEE Trans. Info Theory, March 1988 # See also my own notes at http://www.eecs.umich.edu/~anastas/docs/cpm.pdf @@ -118,7 +118,7 @@ def make_cpm_signals(K,P,M,L,q,frac): for m in range(L): qq=qq + q[m*Q:m*Q+Q] w=math.pi*h*(M-1)*t-2*math.pi*h*(M-1)*qq+math.pi*h*(L-1)*(M-1) - + X=(M**L)*P PSI=numpy.empty((X,Q)) for x in range(X): @@ -133,9 +133,9 @@ def make_cpm_signals(K,P,M,L,q,frac): PSI = numpy.transpose(PSI) SS=numpy.exp(1j*PSI) # contains all signals as columns #print SS - - # Now we need to orthogonalize the signals + + # Now we need to orthogonalize the signals F = scipy.linalg.orth(SS) # find an orthonormal basis for SS #print numpy.dot(numpy.transpose(F.conjugate()),F) # check for orthonormality S = numpy.dot(numpy.transpose(F.conjugate()),SS) @@ -162,11 +162,11 @@ def make_cpm_signals(K,P,M,L,q,frac): #print Ff Sf = S[Esi[0:v0+1]] #print Sf - + return (f0,SS,S,F,Sf,Ff,N) #return f0 - + diff --git a/gr-trellis/src/examples/test_cpm.py b/gr-trellis/src/examples/python/test_cpm.py index 06d54b1a6..5342e57e8 100755 --- a/gr-trellis/src/examples/test_cpm.py +++ b/gr-trellis/src/examples/python/test_cpm.py @@ -82,7 +82,7 @@ def run_test(seed,blocksize): data[i]=0 for i in range(tail+1): data[-i]=0 - + ################################################## @@ -125,7 +125,7 @@ def run_test(seed,blocksize): tb.connect((gr_streams_to_stream_0, 0), (gr_skiphead_0, 0)) tb.connect((gr_skiphead_0, 0), (viterbi, 0)) tb.connect((viterbi, 0), (gr_vector_sink_x_0, 0)) - + tb.run() dataest = gr_vector_sink_x_0.data() diff --git a/gr-trellis/src/examples/test_pccc_turbo1.py b/gr-trellis/src/examples/python/test_pccc_turbo1.py index 7f1ea26ae..0655b972d 100755 --- a/gr-trellis/src/examples/test_pccc_turbo1.py +++ b/gr-trellis/src/examples/python/test_pccc_turbo1.py @@ -30,10 +30,10 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, metrics_in = trellis.metrics_f(fi.O()*fo.O(),dimensionality,constellation,digital.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for innner SISO scale = gr.multiply_const_ff(1.0/N0) dec = trellis.pccc_decoder_s(fo,0,-1,fi,0,-1,interleaver,K,IT,trellis.TRELLIS_MIN_SUM) - + fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts dst = gr.check_lfsr_32k_s() - + tb.connect (src,src_head,s2fsmi,enc,mod) #tb.connect (src,enc,mod) #tb.connect(enc,code) @@ -42,9 +42,9 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, tb.connect (add,metrics_in,scale,dec,fsmi2s,dst) tb.run() - + #print code.data() - + ntotal = dst.ntotal () nright = dst.nright () runlength = dst.runlength () @@ -100,7 +100,7 @@ def main(args): Es = Es + constellation[i]**2 Es = Es / (len(constellation)/dimensionality) N0=Es/pow(10.0,esn0_db/10.0); # calculate noise variance - + tot_s=0 # total number of transmitted shorts terr_s=0 # total number of shorts in error terr_p=0 # total number of packets in error diff --git a/gr-trellis/src/examples/test_sccc_hard.py b/gr-trellis/src/examples/python/test_sccc_hard.py index e732ac2c0..4eeb94a12 100755 --- a/gr-trellis/src/examples/test_sccc_hard.py +++ b/gr-trellis/src/examples/python/test_sccc_hard.py @@ -33,7 +33,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, va_out = trellis.viterbi_s(fo,K,0,-1) # 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() - + tb.connect (src,src_head,s2fsmi,enc_out,inter,enc_in,mod) tb.connect (mod,(add,0)) tb.connect (noise,(add,1)) @@ -41,7 +41,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, tb.connect (metrics_in,va_in,deinter,metrics_out,va_out,fsmi2s,dst) tb.run() - + ntotal = dst.ntotal () nright = dst.nright () runlength = dst.runlength () @@ -71,7 +71,7 @@ def main(args): interleaver=trellis.interleaver(K,666) # construct a random interleaver modulation = fsm_utils.psk8 # see fsm_utlis.py for available predefined modulations dimensionality = modulation[0] - constellation = modulation[1] + constellation = modulation[1] if len(constellation)/dimensionality != fi.O(): sys.stderr.write ('Incompatible FSM output cardinality and modulation size.\n') sys.exit (1) @@ -81,7 +81,7 @@ def main(args): Es = Es + constellation[i]**2 Es = Es / (len(constellation)/dimensionality) N0=Es/pow(10.0,esn0_db/10.0); # calculate noise variance - + tot_s=0 # total number of transmitted shorts terr_s=0 # total number of shorts in error terr_p=0 # total number of packets in error diff --git a/gr-trellis/src/examples/test_sccc_soft.py b/gr-trellis/src/examples/python/test_sccc_soft.py index 1c71e4ca7..10c28419a 100755 --- a/gr-trellis/src/examples/test_sccc_soft.py +++ b/gr-trellis/src/examples/python/test_sccc_soft.py @@ -36,7 +36,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, va_out = trellis.viterbi_s(fo,K,0,-1) # 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() - + tb.connect (src,src_head,s2fsmi,enc_out,inter,enc_in,mod) tb.connect (mod,(add,0)) tb.connect (noise,(add,1)) @@ -46,7 +46,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, tb.connect (siso_in,deinter,va_out,fsmi2s,dst) tb.run() - + ntotal = dst.ntotal () nright = dst.nright () runlength = dst.runlength () @@ -76,7 +76,7 @@ def main(args): interleaver=trellis.interleaver(K,666) # construct a random interleaver modulation = fsm_utils.psk8 # see fsm_utlis.py for available predefined modulations dimensionality = modulation[0] - constellation = modulation[1] + constellation = modulation[1] if len(constellation)/dimensionality != fi.O(): sys.stderr.write ('Incompatible FSM output cardinality and modulation size.\n') sys.exit (1) @@ -100,7 +100,7 @@ def main(args): print i+1,terr_p, '%.2e' % ((1.0*terr_p)/(i+1)),tot_s,terr_s, '%.2e' % ((1.0*terr_s)/tot_s) # estimate of the (short or bit) error rate print rep,terr_p, '%.2e' % ((1.0*terr_p)/(i+1)),tot_s,terr_s, '%.2e' % ((1.0*terr_s)/tot_s) - + if __name__ == '__main__': diff --git a/gr-trellis/src/examples/test_sccc_turbo.py b/gr-trellis/src/examples/python/test_sccc_turbo.py index b1007a864..762a93ba5 100755 --- a/gr-trellis/src/examples/test_sccc_turbo.py +++ b/gr-trellis/src/examples/python/test_sccc_turbo.py @@ -72,7 +72,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, #(head,tail) = make_rx(tb,fo,fi,dimensionality,constellation,K,interleaver,IT,Es,N0,trellis.TRELLIS_SUM_PRODUCT) fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts dst = gr.check_lfsr_32k_s() - + tb.connect (src,src_head,s2fsmi,enc_out,inter,enc_in,mod) tb.connect (mod,(add,0)) tb.connect (noise,(add,1)) @@ -80,9 +80,9 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, tb.connect (tail,fsmi2s,dst) tb.run() - + #print enc_out.ST(), enc_in.ST() - + ntotal = dst.ntotal () nright = dst.nright () runlength = dst.runlength () @@ -113,7 +113,7 @@ def main(args): interleaver=trellis.interleaver(K,666) # construct a random interleaver modulation = fsm_utils.psk8 # see fsm_utlis.py for available predefined modulations dimensionality = modulation[0] - constellation = modulation[1] + constellation = modulation[1] if len(constellation)/dimensionality != fi.O(): sys.stderr.write ('Incompatible FSM output cardinality and modulation size.\n') sys.exit (1) @@ -123,7 +123,7 @@ def main(args): Es = Es + constellation[i]**2 Es = Es / (len(constellation)/dimensionality) N0=Es/pow(10.0,esn0_db/10.0); # calculate noise variance - + tot_s=0 # total number of transmitted shorts terr_s=0 # total number of shorts in error terr_p=0 # total number of packets in error diff --git a/gr-trellis/src/examples/test_sccc_turbo1.py b/gr-trellis/src/examples/python/test_sccc_turbo1.py index ad2ed6bf9..187a75185 100755 --- a/gr-trellis/src/examples/test_sccc_turbo1.py +++ b/gr-trellis/src/examples/python/test_sccc_turbo1.py @@ -27,7 +27,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, dec = trellis.sccc_decoder_combined_fs(fo,0,-1,fi,0,-1,interleaver,K,IT,trellis.TRELLIS_MIN_SUM,dimensionality,constellation,digital.TRELLIS_EUCLIDEAN,1.0) fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts dst = gr.check_lfsr_32k_s() - + #tb.connect (src,src_head,s2fsmi,enc_out,inter,enc_in,mod) tb.connect (src,src_head,s2fsmi,enc,mod) tb.connect (mod,(add,0)) @@ -37,9 +37,9 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, tb.connect (add,dec,fsmi2s,dst) tb.run() - + #print enc_out.ST(), enc_in.ST() - + ntotal = dst.ntotal () nright = dst.nright () runlength = dst.runlength () @@ -70,7 +70,7 @@ def main(args): interleaver=trellis.interleaver(K,666) # construct a random interleaver modulation = fsm_utils.psk8 # see fsm_utlis.py for available predefined modulations dimensionality = modulation[0] - constellation = modulation[1] + constellation = modulation[1] if len(constellation)/dimensionality != fi.O(): sys.stderr.write ('Incompatible FSM output cardinality and modulation size.\n') sys.exit (1) @@ -80,7 +80,7 @@ def main(args): Es = Es + constellation[i]**2 Es = Es / (len(constellation)/dimensionality) N0=Es/pow(10.0,esn0_db/10.0); # calculate noise variance - + tot_s=0 # total number of transmitted shorts terr_s=0 # total number of shorts in error terr_p=0 # total number of packets in error diff --git a/gr-trellis/src/examples/test_sccc_turbo2.py b/gr-trellis/src/examples/python/test_sccc_turbo2.py index fdb92adc8..dff1ba93c 100755 --- a/gr-trellis/src/examples/test_sccc_turbo2.py +++ b/gr-trellis/src/examples/python/test_sccc_turbo2.py @@ -29,7 +29,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, dec = trellis.sccc_decoder_s(fo,0,-1,fi,0,-1,interleaver,K,IT,trellis.TRELLIS_MIN_SUM) fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts dst = gr.check_lfsr_32k_s() - + #tb.connect (src,src_head,s2fsmi,enc_out,inter,enc_in,mod) tb.connect (src,src_head,s2fsmi,enc,mod) tb.connect (mod,(add,0)) @@ -39,9 +39,9 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, tb.connect (add,metrics_in,scale,dec,fsmi2s,dst) tb.run() - + #print enc_out.ST(), enc_in.ST() - + ntotal = dst.ntotal () nright = dst.nright () runlength = dst.runlength () @@ -72,7 +72,7 @@ def main(args): interleaver=trellis.interleaver(K,666) # construct a random interleaver modulation = fsm_utils.psk8 # see fsm_utlis.py for available predefined modulations dimensionality = modulation[0] - constellation = modulation[1] + constellation = modulation[1] if len(constellation)/dimensionality != fi.O(): sys.stderr.write ('Incompatible FSM output cardinality and modulation size.\n') sys.exit (1) @@ -82,7 +82,7 @@ def main(args): Es = Es + constellation[i]**2 Es = Es / (len(constellation)/dimensionality) N0=Es/pow(10.0,esn0_db/10.0); # calculate noise variance - + tot_s=0 # total number of transmitted shorts terr_s=0 # total number of shorts in error terr_p=0 # total number of packets in error diff --git a/gr-trellis/src/examples/test_tcm.py b/gr-trellis/src/examples/python/test_tcm.py index 62fd5135e..a7d6a02d0 100755 --- a/gr-trellis/src/examples/test_tcm.py +++ b/gr-trellis/src/examples/python/test_tcm.py @@ -35,9 +35,9 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): va = trellis.viterbi_s(f,K,0,-1) # 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 #s2b = gr.packed_to_unpacked_ss(1,gr.GR_MSB_FIRST) # unpack shorts to bits - #dst = gr.vector_sink_s(); + #dst = gr.vector_sink_s(); dst = gr.check_lfsr_32k_s() - + tb.connect (src,src_head,s2fsmi,enc,mod) #tb.connect (src,b2s,s2fsmi,enc,mod) @@ -46,11 +46,11 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): tb.connect (add,metrics) tb.connect (metrics,va,fsmi2s,dst) #tb.connect (metrics,va,fsmi2s,s2b,dst) - + tb.run() - - # A bit of cheating: run the program once and print the + + # A bit of cheating: run the program once and print the # final encoder state.. # Then put it as the last argument in the viterbi block #print "final state = " , enc.ST() @@ -90,13 +90,13 @@ def main(): # system parameters f=trellis.fsm(fname) # get the FSM specification from a file # alternatively you can specify the fsm from its generator matrix - #f=trellis.fsm(1,2,[5,7]) + #f=trellis.fsm(1,2,[5,7]) 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 dimensionality = modulation[0] - constellation = modulation[1] + constellation = modulation[1] if len(constellation)/dimensionality != f.O(): sys.stderr.write ('Incompatible FSM output cardinality and modulation size.\n') sys.exit (1) @@ -106,7 +106,7 @@ def main(): Es = Es + constellation[i]**2 Es = Es / (len(constellation)/dimensionality) N0=Es/pow(10.0,esn0_db/10.0); # calculate noise variance - + tot_s=0 # total number of transmitted shorts terr_s=0 # total number of shorts in error terr_p=0 # total number of packets in error diff --git a/gr-trellis/src/examples/test_tcm_bit.py b/gr-trellis/src/examples/python/test_tcm_bit.py index cc5caefbc..7f69c0e29 100755 --- a/gr-trellis/src/examples/test_tcm_bit.py +++ b/gr-trellis/src/examples/python/test_tcm_bit.py @@ -27,7 +27,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): enc = trellis.encoder_ss(f,0) # initial state = 0 mod = gr.chunks_to_symbols_sf(constellation,dimensionality) - + # CHANNEL add = gr.add_ff() noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) @@ -38,9 +38,9 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): va = trellis.viterbi_s(f,K,0,-1) # 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 s2b = gr.packed_to_unpacked_ss(1,gr.GR_MSB_FIRST) # unpack shorts to bits - dst = gr.vector_sink_s(); - #dst = gr.check_lfsr_32k_s(); - + dst = gr.vector_sink_s(); + #dst = gr.check_lfsr_32k_s(); + #tb.connect (src,src_head,s2fsmi,enc,mod) tb.connect (src,b2s,s2fsmi,enc,mod) @@ -49,11 +49,11 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): tb.connect (add,metrics) #tb.connect (metrics,va,fsmi2s,dst) tb.connect (metrics,va,fsmi2s,s2b,dst) - + tb.run() - - # A bit of cheating: run the program once and print the + + # A bit of cheating: run the program once and print the # final encoder state.. # Then put it as the last argument in the viterbi block #print "final state = " , enc.ST() @@ -99,7 +99,7 @@ def main(): K=Kb/bitspersymbol # packet size in trellis steps modulation = fsm_utils.psk4 # see fsm_utlis.py for available predefined modulations dimensionality = modulation[0] - constellation = modulation[1] + constellation = modulation[1] if len(constellation)/dimensionality != f.O(): sys.stderr.write ('Incompatible FSM output cardinality and modulation size.\n') sys.exit (1) @@ -109,7 +109,7 @@ def main(): Es = Es + constellation[i]**2 Es = Es / (len(constellation)/dimensionality) N0=Es/pow(10.0,esn0_db/10.0); # calculate noise variance - + tot_s=0 # total number of transmitted shorts terr_s=0 # total number of shorts in error terr_p=0 # total number of packets in error diff --git a/gr-trellis/src/examples/test_tcm_combined.py b/gr-trellis/src/examples/python/test_tcm_combined.py index 55a3043b8..d98e36e27 100755 --- a/gr-trellis/src/examples/test_tcm_combined.py +++ b/gr-trellis/src/examples/python/test_tcm_combined.py @@ -25,22 +25,22 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): add = gr.add_ff() noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) - + # RX va = trellis.viterbi_combined_fs(f,K,0,-1,dimensionality,constellation,digital.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(); - + dst = gr.check_lfsr_32k_s(); + tb.connect (src,src_head,s2fsmi,enc,mod) tb.connect (mod,(add,0)) tb.connect (noise,(add,1)) tb.connect (add,va,fsmi2s,dst) - + tb.run() - - # A bit of cheating: run the program once and print the + + # A bit of cheating: run the program once and print the # final encoder state.. # Then put it as the last argument in the viterbi block #print "final state = " , enc.ST() @@ -48,7 +48,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): ntotal = dst.ntotal () nright = dst.nright () runlength = dst.runlength () - + return (ntotal,ntotal-nright) @@ -76,7 +76,7 @@ def main(): K=Kb/bitspersymbol # packet size in trellis steps modulation = fsm_utils.psk4 # see fsm_utils.py for available predefined modulations dimensionality = modulation[0] - constellation = modulation[1] + constellation = modulation[1] if len(constellation)/dimensionality != f.O(): sys.stderr.write ('Incompatible FSM output cardinality and modulation size.\n') sys.exit (1) diff --git a/gr-trellis/src/examples/test_tcm_parallel.py b/gr-trellis/src/examples/python/test_tcm_parallel.py index 2b722c09e..0372351aa 100755 --- a/gr-trellis/src/examples/test_tcm_parallel.py +++ b/gr-trellis/src/examples/python/test_tcm_parallel.py @@ -43,11 +43,11 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed,P): tb.connect (add[i],(metrics,i)) tb.connect ((metrics,i),(va,i),(p2s,i)) tb.connect (p2s,fsmi2s,dst) - + tb.run() - - # A bit of cheating: run the program once and print the + + # A bit of cheating: run the program once and print the # final encoder state. # Then put it as the last argument in the viterbi block #print "final state = " , enc.ST() @@ -55,7 +55,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed,P): ntotal = dst.ntotal () nright = dst.nright () runlength = dst.runlength () - + return (ntotal,ntotal-nright) diff --git a/gr-trellis/src/examples/test_turbo_equalization.py b/gr-trellis/src/examples/python/test_turbo_equalization.py index 6fa6749f0..18bfb022a 100755 --- a/gr-trellis/src/examples/test_turbo_equalization.py +++ b/gr-trellis/src/examples/python/test_turbo_equalization.py @@ -44,7 +44,7 @@ def make_rx(tb,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,typ else: tb.connect (siso_in[it],deinter[it],siso_out[it]) tb.connect (inter[it],(siso_in[it],0)) - + return (metrics_in,siso_out[IT-1]) @@ -64,25 +64,25 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,tot_constellat # CHANNEL add = gr.add_ff() noise = gr.noise_source_f(gr.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) + (head,tail) = make_rx(tb,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,trellis.TRELLIS_MIN_SUM) fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts - dst = gr.check_lfsr_32k_s(); - + dst = gr.check_lfsr_32k_s(); + tb.connect (src,src_head,s2fsmi,enc_out,inter,enc_in,mod) tb.connect (mod,(add,0)) tb.connect (noise,(add,1)) tb.connect (add,head) tb.connect (tail,fsmi2s,dst) - + tb.run() ntotal = dst.ntotal () nright = dst.nright () runlength = dst.runlength () - #print ntotal,nright,runlength - + #print ntotal,nright,runlength + return (ntotal,ntotal-nright) diff --git a/gr-trellis/src/examples/test_turbo_equalization1.py b/gr-trellis/src/examples/python/test_turbo_equalization1.py index 15a8f6809..17ad43023 100755 --- a/gr-trellis/src/examples/test_turbo_equalization1.py +++ b/gr-trellis/src/examples/python/test_turbo_equalization1.py @@ -67,17 +67,17 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,channel,modulation,dimensiona isi = gr.fir_filter_fff(1,channel) add = gr.add_ff() noise = gr.noise_source_f(gr.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) - dst = gr.vector_sink_s(); - + (head,tail) = make_rx(tb,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,trellis.TRELLIS_MIN_SUM) + dst = gr.vector_sink_s(); + tb.connect (src,enc_out,inter,mod) tb.connect (mod,isi,(add,0)) tb.connect (noise,(add,1)) tb.connect (add,head) tb.connect (tail,dst) - + tb.run() data = dst.data() @@ -88,7 +88,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,channel,modulation,dimensiona nright=nright+1 #else: #print "Error in ", i - + return (ntotal,ntotal-nright) diff --git a/gr-trellis/src/examples/test_turbo_equalization2.py b/gr-trellis/src/examples/python/test_turbo_equalization2.py index 7e4341cba..5a6c77e9d 100755 --- a/gr-trellis/src/examples/test_turbo_equalization2.py +++ b/gr-trellis/src/examples/python/test_turbo_equalization2.py @@ -65,17 +65,17 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,channel,modulation,dimensiona isi = gr.fir_filter_fff(1,channel) add = gr.add_ff() noise = gr.noise_source_f(gr.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) - dst = gr.vector_sink_s(); - + (head,tail) = make_rx(tb,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,trellis.TRELLIS_MIN_SUM) + dst = gr.vector_sink_s(); + tb.connect (src,enc_out,inter,mod) tb.connect (mod,isi,(add,0)) tb.connect (noise,(add,1)) tb.connect (add,head) tb.connect (tail,dst) - + tb.run() data = dst.data() @@ -86,7 +86,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,channel,modulation,dimensiona nright=nright+1 #else: #print "Error in ", i - + return (ntotal,ntotal-nright) @@ -117,7 +117,7 @@ def main(args): tot_channel = fsm_utils.make_isi_lookup(modulation,channel,True) # generate the lookup table (normalize energy to 1) dimensionality = tot_channel[0] N0=pow(10.0,-esn0_db/10.0); # noise variance - tot_constellation =[0]*len(tot_channel[1]) + tot_constellation =[0]*len(tot_channel[1]) for i in range(len(tot_channel[1])): tot_constellation[i] = tot_channel[1][i] * math.sqrt(1.0/N0) if len(tot_constellation)/dimensionality != fi.O(): diff --git a/gr-trellis/src/examples/test_viterbi_equalization.py b/gr-trellis/src/examples/python/test_viterbi_equalization.py index d290a0d0a..9f3f7e391 100755 --- a/gr-trellis/src/examples/test_viterbi_equalization.py +++ b/gr-trellis/src/examples/python/test_viterbi_equalization.py @@ -21,26 +21,26 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,tot_constellation,N0,seed): # CHANNEL add = gr.add_ff() noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) - + # RX metrics = trellis.metrics_f(f.O(),dimensionality,tot_constellation,digital.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for Viterbi va = trellis.viterbi_s(f,K,0,-1) # 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(); - + dst = gr.check_lfsr_32k_s(); + tb.connect (src,src_head,s2fsmi,enc,mod) tb.connect (mod,(add,0)) tb.connect (noise,(add,1)) tb.connect (add,metrics) tb.connect (metrics,va,fsmi2s,dst) - + tb.run() ntotal = dst.ntotal () nright = dst.nright () runlength = dst.runlength () - #print ntotal,nright,runlength - + #print ntotal,nright,runlength + return (ntotal,ntotal-nright) diff --git a/gr-trellis/src/examples/test_viterbi_equalization1.py b/gr-trellis/src/examples/python/test_viterbi_equalization1.py index 41f777551..90eb4790e 100755 --- a/gr-trellis/src/examples/test_viterbi_equalization1.py +++ b/gr-trellis/src/examples/python/test_viterbi_equalization1.py @@ -28,7 +28,7 @@ def run_test (f,Kb,bitspersymbol,K,channel,modulation,dimensionality,tot_constel isi = gr.fir_filter_fff(1,channel) add = gr.add_ff() noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) - + # RX skip = gr.skiphead(gr.sizeof_float, L) # skip the first L samples since you know they are coming from the L zero symbols #metrics = trellis.metrics_f(f.O(),dimensionality,tot_constellation,digital.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for Viterbi @@ -45,7 +45,7 @@ def run_test (f,Kb,bitspersymbol,K,channel,modulation,dimensionality,tot_constel tb.run() - data = dst.data() + data = dst.data() ntotal = len(data) - L nright=0 for i in range(ntotal): @@ -53,7 +53,7 @@ def run_test (f,Kb,bitspersymbol,K,channel,modulation,dimensionality,tot_constel nright=nright+1 #else: #print "Error in ", i - + return (ntotal,ntotal-nright) diff --git a/gr-trellis/src/lib/.gitignore b/gr-trellis/src/lib/.gitignore deleted file mode 100644 index 7a866aead..000000000 --- a/gr-trellis/src/lib/.gitignore +++ /dev/null @@ -1,193 +0,0 @@ -/Makefile -/Makefile.in -/.la -/.lo -/.deps -/.libs -/*.la -/*.lo -/*.pyc -/trellis.cc -/trellis.py -/wip -/trellis_encoder_bs.cc -/trellis_metrics_c.h -/trellis_metrics_c.i -/trellis_metrics_f.cc -/trellis_viterbi_i.h -/trellis_viterbi_combined_i.h -/trellis_viterbi_i.i -/trellis_viterbi_combined_i.i -/trellis_metrics_i.h -/trellis_metrics_i.i -/trellis_encoder_bb.cc -/trellis_encoder_ss.cc -/trellis_viterbi_combined_s.h -/trellis_viterbi_s.h -/trellis_viterbi_combined_s.i -/trellis_viterbi_s.i -/trellis_metrics_s.h -/trellis_metrics_s.i -/trellis_encoder_si.h -/trellis_encoder_si.i -/trellis_metrics_i.cc -/trellis_viterbi_s.cc -/trellis_viterbi_combined_s.cc -/trellis_encoder_ss.h -/trellis_encoder_ss.i -/trellis_encoder_bi.cc -/trellis_encoder_bi.h -/trellis_encoder_bi.i -/trellis_encoder_ii.cc -/trellis_viterbi_combined_b.cc -/trellis_viterbi_b.cc -/trellis_encoder_bs.h -/trellis_encoder_bs.i -/trellis_viterbi_combined_b.h -/trellis_viterbi_b.h -/trellis_viterbi_combined_b.i -/trellis_viterbi_b.i -/trellis_encoder_si.cc -/trellis_metrics_f.h -/trellis_metrics_f.i -/trellis_encoder_ii.h -/trellis_encoder_ii.i -/trellis_metrics_c.cc -/trellis_viterbi_combined_i.cc -/trellis_viterbi_i.cc -/trellis_encoder_bb.h -/trellis_encoder_bb.i -/trellis_sccc_encoder_bb.cc -/trellis_sccc_encoder_bb.h -/trellis_sccc_encoder_bb.i -/trellis_sccc_encoder_bi.cc -/trellis_sccc_encoder_bi.h -/trellis_sccc_encoder_bi.i -/trellis_sccc_encoder_bs.cc -/trellis_sccc_encoder_bs.h -/trellis_sccc_encoder_bs.i -/trellis_sccc_encoder_ii.cc -/trellis_sccc_encoder_ii.h -/trellis_sccc_encoder_ii.i -/trellis_sccc_encoder_si.cc -/trellis_sccc_encoder_si.h -/trellis_sccc_encoder_si.i -/trellis_sccc_encoder_ss.cc -/trellis_sccc_encoder_ss.h -/trellis_sccc_encoder_ss.i -/trellis_metrics_s.cc -/trellis_viterbi_combined_fs.h -/trellis_viterbi_combined_fs.i -/trellis_viterbi_combined_fi.cc -/trellis_viterbi_combined_is.h -/trellis_viterbi_combined_is.i -/trellis_viterbi_combined_ci.h -/trellis_viterbi_combined_ci.i -/trellis_viterbi_combined_cs.cc -/trellis_viterbi_combined_is.cc -/trellis_viterbi_combined_si.h -/trellis_viterbi_combined_si.i -/trellis_viterbi_combined_ss.cc -/trellis_viterbi_combined_fb.cc -/trellis_viterbi_combined_fi.h -/trellis_viterbi_combined_fi.i -/trellis_viterbi_combined_cb.h -/trellis_viterbi_combined_cb.i -/trellis_viterbi_combined_ci.cc -/trellis_viterbi_combined_ii.cc -/trellis_viterbi_combined_ii.h -/trellis_viterbi_combined_ii.i -/trellis_viterbi_combined_sb.h -/trellis_viterbi_combined_sb.i -/trellis_viterbi_combined_si.cc -/trellis_viterbi_combined_fb.h -/trellis_viterbi_combined_fb.i -/trellis_viterbi_combined_ib.h -/trellis_viterbi_combined_ib.i -/trellis_viterbi_combined_cs.h -/trellis_viterbi_combined_cs.i -/trellis_viterbi_combined_fs.cc -/trellis_viterbi_combined_cb.cc -/trellis_viterbi_combined_ss.h -/trellis_viterbi_combined_ss.i -/trellis_viterbi_combined_ib.cc -/trellis_viterbi_combined_sb.cc -/trellis_sccc_decoder_combined_fb.h -/trellis_sccc_decoder_combined_fb.i -/trellis_sccc_decoder_combined_fb.cc -/trellis_sccc_decoder_combined_fs.h -/trellis_sccc_decoder_combined_fs.i -/trellis_sccc_decoder_combined_fs.cc -/trellis_sccc_decoder_combined_fi.h -/trellis_sccc_decoder_combined_fi.i -/trellis_sccc_decoder_combined_fi.cc -/trellis_sccc_decoder_combined_cb.h -/trellis_sccc_decoder_combined_cb.i -/trellis_sccc_decoder_combined_cb.cc -/trellis_sccc_decoder_combined_cs.h -/trellis_sccc_decoder_combined_cs.i -/trellis_sccc_decoder_combined_cs.cc -/trellis_sccc_decoder_combined_ci.h -/trellis_sccc_decoder_combined_ci.i -/trellis_sccc_decoder_combined_ci.cc -/trellis_sccc_decoder_b.h -/trellis_sccc_decoder_b.i -/trellis_sccc_decoder_b.cc -/trellis_sccc_decoder_s.h -/trellis_sccc_decoder_s.i -/trellis_sccc_decoder_s.cc -/trellis_sccc_decoder_i.h -/trellis_sccc_decoder_i.i -/trellis_sccc_decoder_i.cc -/trellis_pccc_decoder_b.h -/trellis_pccc_decoder_b.i -/trellis_pccc_decoder_b.cc -/trellis_pccc_decoder_s.h -/trellis_pccc_decoder_s.i -/trellis_pccc_decoder_s.cc -/trellis_pccc_decoder_i.h -/trellis_pccc_decoder_i.i -/trellis_pccc_decoder_i.cc -/trellis_pccc_encoder_bb.cc -/trellis_pccc_encoder_bb.h -/trellis_pccc_encoder_bb.i -/trellis_pccc_encoder_bi.cc -/trellis_pccc_encoder_bi.h -/trellis_pccc_encoder_bi.i -/trellis_pccc_encoder_bs.cc -/trellis_pccc_encoder_bs.h -/trellis_pccc_encoder_bs.i -/trellis_pccc_encoder_ii.cc -/trellis_pccc_encoder_ii.h -/trellis_pccc_encoder_ii.i -/trellis_pccc_encoder_si.cc -/trellis_pccc_encoder_si.h -/trellis_pccc_encoder_si.i -/trellis_pccc_encoder_ss.cc -/trellis_pccc_encoder_ss.h -/trellis_pccc_encoder_ss.i -/trellis_pccc_decoder_combined_cb.cc -/trellis_pccc_decoder_combined_cb.h -/trellis_pccc_decoder_combined_cb.i -/trellis_pccc_decoder_combined_ci.cc -/trellis_pccc_decoder_combined_ci.h -/trellis_pccc_decoder_combined_ci.i -/trellis_pccc_decoder_combined_cs.cc -/trellis_pccc_decoder_combined_cs.h -/trellis_pccc_decoder_combined_cs.i -/trellis_pccc_decoder_combined_fb.cc -/trellis_pccc_decoder_combined_fb.h -/trellis_pccc_decoder_combined_fb.i -/trellis_pccc_decoder_combined_fi.cc -/trellis_pccc_decoder_combined_fi.h -/trellis_pccc_decoder_combined_fi.i -/trellis_pccc_decoder_combined_fs.cc -/trellis_pccc_decoder_combined_fs.h -/trellis_pccc_decoder_combined_fs.i -/trellis_generated.i -/generate-stamp -/stamp-* -/run_guile_tests -/gnuradio -/guile -/python diff --git a/gr-trellis/src/lib/Makefile.am b/gr-trellis/src/lib/Makefile.am deleted file mode 100644 index ea28ea538..000000000 --- a/gr-trellis/src/lib/Makefile.am +++ /dev/null @@ -1,188 +0,0 @@ -# -# Copyright 2004,2005,2006,2007,2008,2009,2010 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 3, 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., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -include $(top_srcdir)/Makefile.common -include $(top_srcdir)/Makefile.swig - -TESTS = - -EXTRA_DIST += \ - run_guile_tests.in \ - trellis.test - - -AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \ - $(GR_DIGITAL_INCLUDES) \ - $(WITH_INCLUDES) - -# ---------------------------------------------------------------- -# these scripts generate trellis codes from template files - -core_generator = \ - generate_all.py \ - generate_trellis.py \ - trellis_encoder_XX.cc.t \ - trellis_encoder_XX.h.t \ - trellis_encoder_XX.i.t \ - trellis_sccc_encoder_XX.cc.t \ - trellis_sccc_encoder_XX.h.t \ - trellis_sccc_encoder_XX.i.t \ - trellis_pccc_encoder_XX.cc.t \ - trellis_pccc_encoder_XX.h.t \ - trellis_pccc_encoder_XX.i.t \ - trellis_metrics_X.cc.t \ - trellis_metrics_X.h.t \ - trellis_metrics_X.i.t \ - trellis_viterbi_combined_XX.cc.t \ - trellis_viterbi_combined_XX.h.t \ - trellis_viterbi_combined_XX.i.t \ - trellis_sccc_decoder_combined_XX.cc.t \ - trellis_sccc_decoder_combined_XX.h.t \ - trellis_sccc_decoder_combined_XX.i.t \ - trellis_sccc_decoder_X.cc.t \ - trellis_sccc_decoder_X.h.t \ - trellis_sccc_decoder_X.i.t \ - trellis_pccc_decoder_X.cc.t \ - trellis_pccc_decoder_X.h.t \ - trellis_pccc_decoder_X.i.t \ - trellis_pccc_decoder_combined_XX.cc.t \ - trellis_pccc_decoder_combined_XX.h.t \ - trellis_pccc_decoder_combined_XX.i.t \ - trellis_viterbi_X.cc.t \ - trellis_viterbi_X.h.t \ - trellis_viterbi_X.i.t - -# Source built by Python into $(builddir) -python_built_sources = \ - $(GENERATED_H) \ - $(GENERATED_I) \ - $(GENERATED_CC) \ - trellis_generated.i - -EXTRA_DIST += \ - $(core_generator) - -# These headers get installed in ${prefix}/include/gnuradio -grinclude_HEADERS = \ - trellis_api.h \ - fsm.h \ - quicksort_index.h \ - base.h \ - interleaver.h \ - calc_metric.h \ - core_algorithms.h \ - trellis_permutation.h \ - siso_type.h \ - trellis_siso_f.h \ - trellis_siso_combined_f.h \ - trellis_constellation_metrics_cf.h \ - $(GENERATED_H) - -lib_LTLIBRARIES = libgnuradio-trellis.la - -libgnuradio_trellis_la_SOURCES = \ - fsm.cc \ - quicksort_index.cc \ - base.cc \ - interleaver.cc \ - calc_metric.cc \ - core_algorithms.cc \ - trellis_permutation.cc \ - trellis_siso_f.cc \ - trellis_siso_combined_f.cc \ - trellis_constellation_metrics_cf.cc \ - $(GENERATED_CC) - -libgnuradio_trellis_la_LIBADD = \ - $(GNURADIO_CORE_LA) - -libgnuradio_trellis_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS) - -trellis.py trellis.scm: trellis_generated.i - -################################# -# SWIG interface and library - -TOP_SWIG_DOC_IFILES = \ - trellis_swig_doc.i - -TOP_SWIG_IFILES = \ - $(TOP_SWIG_DOC_IFILES) \ - trellis.i - -BUILT_SOURCES += \ - $(TOP_SWIG_DOC_IFILES) - -EXTRA_DIST += \ - $(TOP_SWIG_DOC_IFILES) - -$(TOP_SWIG_DOC_IFILES): - `echo "" > $@` - -# Install so that they end up available as: -# import gnuradio.trellis -# This ends up at: -# ${prefix}/lib/python${python_version}/site-packages/gnuradio -trellis_pythondir_category = \ - gnuradio - -# additional libraries for linking with the SWIG-generated library -trellis_la_swig_libadd = \ - libgnuradio-trellis.la - -# additional SWIG files to be installed -trellis_swiginclude_headers = \ - $(GENERATED_I) \ - fsm.i \ - interleaver.i \ - trellis_permutation.i \ - trellis_siso_f.i \ - trellis_siso_combined_f.i \ - trellis_constellation_metrics_cf.i \ - trellis_generated.i \ - $(TOP_SWIG_DOC_IFILES) - -# Do creation and inclusion of other Makefiles last - -# include the srcdir's Makefile.gen; doing this creates an implicit -# dependency between $(srcdir)/Makefile.in and $(srcdir)/Makefile.gen. -include $(srcdir)/Makefile.gen - -# common way for generating local Makefile.gen -makefile_gen_gen_command = PYTHONPATH=$(top_srcdir)/gnuradio-core/src/python srcdir=$(srcdir) do_makefile=1 do_sources=0 $(PYTHON) $(srcdir)/generate_all.py -include $(top_srcdir)/Makefile.gen.gen - -# common way for generating sources from templates when using -# BUILT_SOURCES, using parallel build protection. -gen_sources = $(python_built_sources) -gen_sources_deps = $(core_generator) -par_gen_command = PYTHONPATH=$(top_srcdir)/gnuradio-core/src/python srcdir=$(srcdir) $(PYTHON) $(srcdir)/generate_all.py -include $(top_srcdir)/Makefile.par.gen - -BUILT_SOURCES += $(python_built_sources) - -# Location of non-standard SWIG interface files -trellis_swig_args = \ - $(GR_DIGITAL_INCLUDES) - -if GUILE -TESTS += run_guile_tests -endif diff --git a/gr-trellis/src/lib/Makefile.swig.gen b/gr-trellis/src/lib/Makefile.swig.gen deleted file mode 100644 index 2d014b946..000000000 --- a/gr-trellis/src/lib/Makefile.swig.gen +++ /dev/null @@ -1,145 +0,0 @@ -# -*- Makefile -*- -# -# Copyright 2009 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 3, 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., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -# Makefile.swig.gen for trellis.i - -## Default install locations for these files: -## -## Default location for the Python directory is: -## ${prefix}/lib/python${python_version}/site-packages/[category]/trellis -## Default location for the Python exec directory is: -## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/trellis -## -## The following can be overloaded to change the install location, but -## this has to be done in the including Makefile.am -before- -## Makefile.swig is included. - -trellis_pythondir_category ?= gnuradio/trellis -trellis_pylibdir_category ?= $(trellis_pythondir_category) -trellis_pythondir = $(pythondir)/$(trellis_pythondir_category) -trellis_pylibdir = $(pyexecdir)/$(trellis_pylibdir_category) - -# The .so libraries for the guile modules get installed whereever guile -# is installed, usually /usr/lib/guile/gnuradio/ -# FIXME: determince whether these should be installed with gnuradio. -trellis_scmlibdir = $(libdir) - -# The scm files for the guile modules get installed where ever guile -# is installed, usually /usr/share/guile/site/trellis -# FIXME: determince whether these should be installed with gnuradio. -trellis_scmdir = $(guiledir) - -## SWIG headers are always installed into the same directory. - -trellis_swigincludedir = $(swigincludedir) - -## This is a template file for a "generated" Makefile addition (in -## this case, "Makefile.swig.gen"). By including the top-level -## Makefile.swig, this file will be used to generate the SWIG -## dependencies. Assign the variable TOP_SWIG_FILES to be the list of -## SWIG .i files to generated wrappings for; there can be more than 1 -## so long as the names are unique (no sorting is done on the -## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i -## file will generate .cc, .py, and possibly .h files -- meaning that -## all of these files will have the same base name (that provided for -## the SWIG .i file). -## -## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the -## right thing. For more info, see < -## http://sources.redhat.com/automake/automake.html#Multiple-Outputs > - -## Other cleaned files: dependency files generated by SWIG or this Makefile - -MOSTLYCLEANFILES += $(DEPDIR)/*.S* - -## Various SWIG variables. These can be overloaded in the including -## Makefile.am by setting the variable value there, then including -## Makefile.swig . - -trellis_swiginclude_HEADERS = \ - trellis.i \ - $(trellis_swiginclude_headers) - -if PYTHON -trellis_pylib_LTLIBRARIES = \ - _trellis.la - -_trellis_la_SOURCES = \ - python/trellis.cc \ - $(trellis_la_swig_sources) - -trellis_python_PYTHON = \ - trellis.py \ - $(trellis_python) - -_trellis_la_LIBADD = \ - $(STD_SWIG_LA_LIB_ADD) \ - $(trellis_la_swig_libadd) - -_trellis_la_LDFLAGS = \ - $(STD_SWIG_LA_LD_FLAGS) \ - $(trellis_la_swig_ldflags) - -_trellis_la_CXXFLAGS = \ - $(STD_SWIG_CXX_FLAGS) \ - -I$(top_builddir) \ - $(trellis_la_swig_cxxflags) - -python/trellis.cc: trellis.py -trellis.py: trellis.i - -# Include the python dependencies for this file --include python/trellis.d - -endif # end of if python - -if GUILE - -trellis_scmlib_LTLIBRARIES = \ - libguile-gnuradio-trellis.la -libguile_gnuradio_trellis_la_SOURCES = \ - guile/trellis.cc \ - $(trellis_la_swig_sources) -nobase_trellis_scm_DATA = \ - gnuradio/trellis.scm \ - gnuradio/trellis-primitive.scm -libguile_gnuradio_trellis_la_LIBADD = \ - $(STD_SWIG_LA_LIB_ADD) \ - $(trellis_la_swig_libadd) -libguile_gnuradio_trellis_la_LDFLAGS = \ - $(STD_SWIG_LA_LD_FLAGS) \ - $(trellis_la_swig_ldflags) -libguile_gnuradio_trellis_la_CXXFLAGS = \ - $(STD_SWIG_CXX_FLAGS) \ - -I$(top_builddir) \ - $(trellis_la_swig_cxxflags) - -guile/trellis.cc: gnuradio/trellis.scm -gnuradio/trellis.scm: trellis.i -gnuradio/trellis-primitive.scm: gnuradio/trellis.scm - -# Include the guile dependencies for this file --include guile/trellis.d - -endif # end of GUILE - - diff --git a/gr-trellis/src/lib/calc_metric.cc b/gr-trellis/src/lib/calc_metric.cc index 0e8f9c2d5..ce628209b 100644 --- a/gr-trellis/src/lib/calc_metric.cc +++ b/gr-trellis/src/lib/calc_metric.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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 3, 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., 51 Franklin Street, @@ -26,12 +26,12 @@ -template <class T> +template <class T> void calc_metric(int O, int D, const std::vector<T> &TABLE, const T *in, float *metric, trellis_metric_type_t type) { float minm = FLT_MAX; int minmi = 0; - + switch (type){ case TRELLIS_EUCLIDEAN: @@ -178,7 +178,7 @@ void calc_metric(int O, int D, const std::vector<float> &TABLE, const float *in, float s=in[m]-TABLE[o*D+m]; metric[o]+=s*s; } - } + } break; case TRELLIS_HARD_SYMBOL: for(int o=0;o<O;o++) { diff --git a/gr-trellis/src/lib/calc_metric.h b/gr-trellis/src/lib/calc_metric.h index fd20f8d36..7cad6160a 100644 --- a/gr-trellis/src/lib/calc_metric.h +++ b/gr-trellis/src/lib/calc_metric.h @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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 3, 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., 51 Franklin Street, @@ -28,7 +28,7 @@ #include <digital_metric_type.h> -template <class T> +template <class T> void calc_metric(int O, int D, const std::vector<T> &TABLE, const T *in, float *metric, trellis_metric_type_t type); /* diff --git a/gr-trellis/src/lib/core_algorithms.cc b/gr-trellis/src/lib/core_algorithms.cc index 54193c818..3ed912c08 100644 --- a/gr-trellis/src/lib/core_algorithms.cc +++ b/gr-trellis/src/lib/core_algorithms.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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 3, 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., 51 Franklin Street, @@ -42,8 +42,8 @@ float min_star(float a, float b) -template <class T> -void viterbi_algorithm(int I, int S, int O, +template <class T> +void viterbi_algorithm(int I, int S, int O, const std::vector<int> &NS, const std::vector<int> &OS, const std::vector< std::vector<int> > &PS, @@ -51,7 +51,7 @@ void viterbi_algorithm(int I, int S, int O, int K, int S0,int SK, const float *in, T *out)//, - //std::vector<int> &trace) + //std::vector<int> &trace) { std::vector<int> trace(S*K); std::vector<float> alpha(S*2); @@ -84,7 +84,7 @@ void viterbi_algorithm(int I, int S, int O, alpha[((alphai+1)%2)*S+j]=minm; if(minm<norm) norm=minm; } - for(int j=0;j<S;j++) + for(int j=0;j<S;j++) alpha[((alphai+1)%2)*S+j]-=norm; // normalize total metrics so they do not explode alphai=(alphai+1)%2; } @@ -190,7 +190,7 @@ void viterbi_algorithm_combined(int I, int S, int O, alpha[((alphai+1)%2)*S+j]=minm; if(minm<norm) norm=minm; } - for(int j=0;j<S;j++) + for(int j=0;j<S;j++) alpha[((alphai+1)%2)*S+j]-=norm; // normalize total metrics so they do not explode alphai=(alphai+1)%2; } @@ -211,7 +211,7 @@ void viterbi_algorithm_combined(int I, int S, int O, out[k]= (To) PI[st][i0]; st=PS[st][i0]; } - + delete [] metric; } @@ -415,7 +415,7 @@ void viterbi_algorithm_combined<gr_complex,int>(int I, int S, int O, //=============================================== -void siso_algorithm(int I, int S, int O, +void siso_algorithm(int I, int S, int O, const std::vector<int> &NS, const std::vector<int> &OS, const std::vector< std::vector<int> > &PS, @@ -427,7 +427,7 @@ void siso_algorithm(int I, int S, int O, const float *priori, const float *prioro, float *post//, //std::vector<float> &alpha, //std::vector<float> &beta - ) + ) { float norm,mm,minm; std::vector<float> alpha(S*(K+1)); @@ -454,7 +454,7 @@ void siso_algorithm(int I, int S, int O, alpha[(k+1)*S+j]=minm; if(minm<norm) norm=minm; } - for(int j=0;j<S;j++) + for(int j=0;j<S;j++) alpha[(k+1)*S+j]-=norm; // normalize total metrics so they do not explode } @@ -468,7 +468,7 @@ void siso_algorithm(int I, int S, int O, for(int k=K-1;k>=0;k--) { // backward recursion norm=INF; - for(int j=0;j<S;j++) { + for(int j=0;j<S;j++) { minm=INF; for(int i=0;i<I;i++) { int i0 = j*I+i; @@ -517,8 +517,8 @@ if (POSTI && POSTO) for(int n=0;n<O;n++) post[k*(I+O)+I+n]-=norm; // normalize metrics } -} -else if(POSTI) +} +else if(POSTI) { for(int k=0;k<K;k++) { // input combining norm=INF; @@ -563,7 +563,7 @@ else //=========================================================== template <class T> -void siso_algorithm_combined(int I, int S, int O, +void siso_algorithm_combined(int I, int S, int O, const std::vector<int> &NS, const std::vector<int> &OS, const std::vector< std::vector<int> > &PS, @@ -576,7 +576,7 @@ void siso_algorithm_combined(int I, int S, int O, const std::vector<T> &TABLE, trellis_metric_type_t TYPE, const float *priori, const T *observations, float *post -) +) { float norm,mm,minm; std::vector<float> alpha(S*(K+1)); @@ -605,7 +605,7 @@ void siso_algorithm_combined(int I, int S, int O, alpha[(k+1)*S+j]=minm; if(minm<norm) norm=minm; } - for(int j=0;j<S;j++) + for(int j=0;j<S;j++) alpha[(k+1)*S+j]-=norm; // normalize total metrics so they do not explode } @@ -619,7 +619,7 @@ void siso_algorithm_combined(int I, int S, int O, for(int k=K-1;k>=0;k--) { // backward recursion norm=INF; - for(int j=0;j<S;j++) { + for(int j=0;j<S;j++) { minm=INF; for(int i=0;i<I;i++) { int i0 = j*I+i; @@ -668,8 +668,8 @@ void siso_algorithm_combined(int I, int S, int O, for(int n=0;n<O;n++) post[k*(I+O)+I+n]-=norm; // normalize metrics } - } - else if(POSTI) + } + else if(POSTI) { for(int k=0;k<K;k++) { // input combining norm=INF; @@ -828,7 +828,7 @@ for(int rep=0;rep<iterations;rep++) { //oprioro[k*FSMi.I()+i]=iposti[ki*FSMi.I()+i]; //} memcpy(&(oprioro[k*FSMi.I()]),&(iposti[ki*FSMi.I()]),FSMi.I()*sizeof(float)); - } + } // run outer SISO @@ -849,10 +849,10 @@ for(int rep=0;rep<iterations;rep++) { //ipriori[ki*FSMi.I()+i]=oposto[k*FSMi.I()+i]; //} memcpy(&(ipriori[ki*FSMi.I()]),&(oposto[k*FSMi.I()]),FSMi.I()*sizeof(float)); - } + } } else // produce posti but not posto - + siso_algorithm(FSMo.I(),FSMo.S(),FSMo.O(), FSMo.NS(), FSMo.OS(), FSMo.PS(), FSMo.PI(), blocklength, @@ -861,7 +861,7 @@ for(int rep=0;rep<iterations;rep++) { p2mymin, &(opriori[0]), &(oprioro[0]), &(oposti[0]) ); - + /* viterbi_algorithm(FSMo.I(),FSMo.S(),FSMo.O(), FSMo.NS(), FSMo.OS(), FSMo.PS(), FSMo.PI(), @@ -1006,7 +1006,7 @@ void sccc_decoder( //oprioro[k*FSMi.I()+i]=iposti[ki*FSMi.I()+i]; //} memcpy(&(oprioro[k*FSMi.I()]),&(iposti[ki*FSMi.I()]),FSMi.I()*sizeof(float)); - } + } // run outer SISO @@ -1027,10 +1027,10 @@ void sccc_decoder( //ipriori[ki*FSMi.I()+i]=oposto[k*FSMi.I()+i]; //} memcpy(&(ipriori[ki*FSMi.I()]),&(oposto[k*FSMi.I()]),FSMi.I()*sizeof(float)); - } + } } else {// produce posti but not posto - + siso_algorithm(FSMo.I(),FSMo.S(),FSMo.O(), FSMo.NS(), FSMo.OS(), FSMo.PS(), FSMo.PI(), blocklength, @@ -1039,7 +1039,7 @@ void sccc_decoder( p2mymin, &(opriori[0]), &(oprioro[0]), &(oposti[0]) ); - + /* viterbi_algorithm(FSMo.I(),FSMo.S(),FSMo.O(), FSMo.NS(), FSMo.OS(), FSMo.PS(), FSMo.PI(), @@ -1120,7 +1120,7 @@ void pccc_decoder( std::vector<float> priori2(blocklength*FSM2.I(),0.0); std::vector<float> prioro2(blocklength*FSM2.O()); std::vector<float> posti2(blocklength*FSM2.I()); - + //generate prioro1,2 (metrics are not updated per iteration: this is not the best you can do...) for (int k=0;k<blocklength;k++) { //std::cout << k << std::endl; @@ -1150,7 +1150,7 @@ void pccc_decoder( p2mymin, &(priori1[0]), &(prioro1[0]), &(posti1[0]) ); - + //for(int k=0;k<blocklength;k++){ //for(int i=0;i<FSM1.I();i++) //std::cout << posti1[k*FSM1.I()+i] << ", "; @@ -1164,7 +1164,7 @@ void pccc_decoder( //oprioro[k*FSMi.I()+i]=iposti[ki*FSMi.I()+i]; //} memcpy(&(priori2[k*FSM2.I()]),&(posti1[ki*FSM1.I()]),FSM1.I()*sizeof(float)); - } + } // run SISO 2 siso_algorithm(FSM2.I(),FSM2.S(),FSM2.O(), @@ -1272,7 +1272,7 @@ void pccc_decoder_combined( calc_metric(O, D, TABLE, &(observations[k*D]), &(cprioro[k*O]),METRIC_TYPE); cprioro[k*O] *= scaling; } - + //generate prioro1,2 (metrics are not updated per iteration: this is not the best you can do...) for (int k=0;k<blocklength;k++) { //std::cout << k << std::endl; @@ -1302,7 +1302,7 @@ void pccc_decoder_combined( p2mymin, &(priori1[0]), &(prioro1[0]), &(posti1[0]) ); - + //for(int k=0;k<blocklength;k++){ //for(int i=0;i<FSM1.I();i++) //std::cout << posti1[k*FSM1.I()+i] << ", "; @@ -1316,7 +1316,7 @@ void pccc_decoder_combined( //oprioro[k*FSMi.I()+i]=iposti[ki*FSMi.I()+i]; //} memcpy(&(priori2[k*FSM2.I()]),&(posti1[ki*FSM1.I()]),FSM1.I()*sizeof(float)); - } + } // run SISO 2 siso_algorithm(FSM2.I(),FSM2.S(),FSM2.O(), diff --git a/gr-trellis/src/lib/core_algorithms.h b/gr-trellis/src/lib/core_algorithms.h index cab7086ba..a8765225b 100644 --- a/gr-trellis/src/lib/core_algorithms.h +++ b/gr-trellis/src/lib/core_algorithms.h @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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 3, 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., 51 Franklin Street, @@ -34,7 +34,7 @@ float min(float a, float b); float min_star(float a, float b); -template <class T> +template <class T> void viterbi_algorithm(int I, int S, int O, const std::vector<int> &NS, const std::vector<int> &OS, @@ -99,7 +99,7 @@ void sccc_decoder( float (*p2mymin)(float,float), const float *iprioro, T *data ); - + template<class Ti, class To> void sccc_decoder_combined( diff --git a/gr-trellis/src/lib/fsm.cc b/gr-trellis/src/lib/fsm.cc index 65c4b4b32..fb2b4d2c9 100644 --- a/gr-trellis/src/lib/fsm.cc +++ b/gr-trellis/src/lib/fsm.cc @@ -64,7 +64,7 @@ fsm::fsm(int I, int S, int O, const std::vector<int> &NS, const std::vector<int> d_O=O; d_NS=NS; d_OS=OS; - + generate_PS_PI(); generate_TM(); } @@ -79,11 +79,11 @@ fsm::fsm(int I, int S, int O, const std::vector<int> &NS, const std::vector<int> //# output symbol matrix (S lines, each with I integers separated by spaces) //# optional comments //###################################################################### -fsm::fsm(const char *name) +fsm::fsm(const char *name) { FILE *fsmfile; - if((fsmfile=fopen(name,"r"))==NULL) + if((fsmfile=fopen(name,"r"))==NULL) throw std::runtime_error ("fsm::fsm(const char *name): file open error\n"); //printf("file open error in fsm()\n"); @@ -91,7 +91,7 @@ fsm::fsm(const char *name) if(ferror(fsmfile) != 0) throw std::runtime_error ("fsm::fsm(const char *name): file read error\n"); } - + d_NS.resize(d_I*d_S); d_OS.resize(d_I*d_S); @@ -113,7 +113,7 @@ fsm::fsm(const char *name) } fclose(fsmfile); - + generate_PS_PI(); generate_TM(); } @@ -141,7 +141,7 @@ fsm::fsm(int k, int n, const std::vector<int> &G) max_mem=mem; } } - + //printf("max_mem_x\n"); //for(int j=0;j<max_mem_x.size();j++) printf("%d ",max_mem_x[j]); printf("\n"); @@ -155,7 +155,7 @@ fsm::fsm(int k, int n, const std::vector<int> &G) d_I=1<<k; d_S=1<<sum_max_mem; d_O=1<<n; - + // binary representation of the G matrix std::vector<std::vector<int> > Gb(k*n); for(int j=0;j<k*n;j++) { @@ -165,9 +165,9 @@ fsm::fsm(int k, int n, const std::vector<int> &G) //for(int m=0;m<Gb[j].size();m++) printf("%d ",Gb[j][m]); printf("\n"); } - // alphabet size of each shift register + // alphabet size of each shift register std::vector<int> bases_x(k); - for(int j=0;j<k ;j++) + for(int j=0;j<k ;j++) bases_x[j] = 1 << max_mem_x[j]; //printf("bases_x\n"); //for(int j=0;j<max_mem_x.size();j++) printf("%d ",max_mem_x[j]); printf("\n"); @@ -229,7 +229,7 @@ fsm::fsm(int k, int n, const std::vector<int> &G) //###################################################################### -//# Automatically generate an FSM specification describing the +//# Automatically generate an FSM specification describing the //# ISI for a channel //# of length ch_length and a modulation of size mod_size //###################################################################### @@ -243,13 +243,13 @@ fsm::fsm(int mod_size, int ch_length) d_OS.resize(d_I*d_S); for(int s=0;s<d_S;s++) { - for(int i=0;i<d_I;i++) { + for(int i=0;i<d_I;i++) { int t=i*d_S+s; d_NS[s*d_I+i] = t/d_I; d_OS[s*d_I+i] = t; } } - + generate_PS_PI(); generate_TM(); } @@ -258,8 +258,8 @@ fsm::fsm(int mod_size, int ch_length) //###################################################################### -//# Automatically generate an FSM specification describing the -//# the trellis for a CPM with h=K/P (relatively prime), +//# Automatically generate an FSM specification describing the +//# the trellis for a CPM with h=K/P (relatively prime), //# alphabet size M, and frequency pulse duration L symbols //# //# This FSM is based on the paper by B. Rimoldi @@ -303,7 +303,7 @@ fsm::fsm(int P, int M, int L) //###################################################################### -//# Automatically generate an FSM specification describing the +//# Automatically generate an FSM specification describing the //# the joint trellis of fsm1 and fsm2 //###################################################################### fsm::fsm(const fsm &FSM1, const fsm &FSM2) @@ -433,7 +433,7 @@ bool fsm::find_es(int es) { bool done = true; for(int s=0;s<d_S;s++) { - if(d_TMl[s*d_S+es] < d_S) + if(d_TMl[s*d_S+es] < d_S) continue; int minl=d_S; int mini=-1; @@ -477,7 +477,7 @@ void fsm::write_trellis_svg( std::string filename ,int number_stages) for( int stage_num = 0;stage_num < number_stages;stage_num ++){ // draw states for ( int state_num = 0;state_num < d_S ; state_num ++ ) { - trellis_fname << "<circle cx = \"" << stage_num * STAGE_STATE_OFFSETS + TRELLIS_X_OFFSET << + trellis_fname << "<circle cx = \"" << stage_num * STAGE_STATE_OFFSETS + TRELLIS_X_OFFSET << "\" cy = \"" << state_num * STAGE_STATE_OFFSETS + TRELLIS_Y_OFFSET << "\" r = \"1\"/>" << std::endl; //draw branches if(stage_num != number_stages-1){ @@ -495,7 +495,7 @@ void fsm::write_trellis_svg( std::string filename ,int number_stages) // label the stages trellis_fname << "<g font-size = \"4\" font= \"times\" fill = \"black\">" << std::endl; for( int stage_num = 0;stage_num < number_stages ;stage_num ++){ - trellis_fname << "<text x = \"" << stage_num * STAGE_STATE_OFFSETS + STAGE_LABEL_X_OFFSET << + trellis_fname << "<text x = \"" << stage_num * STAGE_STATE_OFFSETS + STAGE_LABEL_X_OFFSET << "\" y = \"" << STAGE_LABEL_Y_OFFSET << "\" >" << std::endl; trellis_fname << stage_num << std::endl; trellis_fname << "</text>" << std::endl; @@ -505,7 +505,7 @@ void fsm::write_trellis_svg( std::string filename ,int number_stages) // label the states trellis_fname << "<g font-size = \"4\" font= \"times\" fill = \"black\">" << std::endl; for( int state_num = 0;state_num < d_S ; state_num ++){ - trellis_fname << "<text y = \"" << state_num * STAGE_STATE_OFFSETS + STATE_LABEL_Y_OFFSET << + trellis_fname << "<text y = \"" << state_num * STAGE_STATE_OFFSETS + STATE_LABEL_Y_OFFSET << "\" x = \"" << STATE_LABEL_X_OFFSET << "\" >" << std::endl; trellis_fname << state_num << std::endl; trellis_fname << "</text>" << std::endl; diff --git a/gr-trellis/src/lib/fsm.h b/gr-trellis/src/lib/fsm.h index 7dc7e0d9d..47e467898 100644 --- a/gr-trellis/src/lib/fsm.h +++ b/gr-trellis/src/lib/fsm.h @@ -46,7 +46,7 @@ private: // next_state = d_NS[current_state * d_I + input_symbol] std::vector<int> d_NS; // OS means Output Symbol. - // output_symbol = d_OS[current_state * d_I + input_symbol] + // output_symbol = d_OS[current_state * d_I + input_symbol] std::vector<int> d_OS; // PS means Previous State. std::vector< std::vector<int> > d_PS; @@ -83,7 +83,7 @@ public: * \param NS A mapping from (current state, input symbol) to next state. * next_state = NS[current_state * I + input_symbol] * \param OS A mapping from (current state, input symbol) to output symbol. - * output_symbol = OS[current_state * I + input_symbol] + * output_symbol = OS[current_state * I + input_symbol] * */ fsm(int I, int S, int O, const std::vector<int> &NS, const std::vector<int> &OS); @@ -152,7 +152,7 @@ public: * \param filename filename * \param number_stages ???? * - */ + */ void write_trellis_svg(std::string filename ,int number_stages); /*! * \brief Write the FSMS to a file. diff --git a/gr-trellis/src/lib/generate_all.py b/gr-trellis/src/lib/generate_all.py index ee1966b89..78e36270c 100644 --- a/gr-trellis/src/lib/generate_all.py +++ b/gr-trellis/src/lib/generate_all.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2006,2007 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 3, 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., 51 Franklin Street, # Boston, MA 02110-1301, USA. -# +# from build_utils import output_glue diff --git a/gr-trellis/src/lib/generate_trellis.py b/gr-trellis/src/lib/generate_trellis.py index 31bc44aac..60a81f77a 100644 --- a/gr-trellis/src/lib/generate_trellis.py +++ b/gr-trellis/src/lib/generate_trellis.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2006,2007 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 3, 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., 51 Franklin Street, # Boston, MA 02110-1301, USA. -# +# from build_utils import expand_template, copyright, open_and_log_name from build_utils_codes import * diff --git a/gr-trellis/src/lib/interleaver.cc b/gr-trellis/src/lib/interleaver.cc index 131dcb07b..740f33ab3 100644 --- a/gr-trellis/src/lib/interleaver.cc +++ b/gr-trellis/src/lib/interleaver.cc @@ -20,7 +20,7 @@ * Boston, MA 02110-1301, USA. */ -#include <cstdlib> +#include <cstdlib> #include <cstdio> #include <iostream> #include <string> @@ -52,7 +52,7 @@ interleaver::interleaver(int K, const std::vector<int> &INTER) d_K=K; d_INTER=INTER; d_DEINTER.resize(d_K); - + // generate DEINTER table for(int i=0;i<d_K;i++) { d_DEINTER[d_INTER[i]]=i; @@ -67,14 +67,14 @@ interleaver::interleaver(int K, const std::vector<int> &INTER) //# list of space separated K integers from 0 to K-1 in appropriate order //# optional comments //###################################################################### -interleaver::interleaver(const char *name) +interleaver::interleaver(const char *name) { FILE *interleaverfile; - if((interleaverfile=fopen(name,"r"))==NULL) + if((interleaverfile=fopen(name,"r"))==NULL) throw std::runtime_error ("file open error in interleaver()"); //printf("file open error in interleaver()\n"); - + if(fscanf(interleaverfile,"%d\n",&d_K) == EOF) { if(ferror(interleaverfile) != 0) throw std::runtime_error ("interleaver::interleaver(const char *name): file read error\n"); @@ -89,7 +89,7 @@ interleaver::interleaver(const char *name) throw std::runtime_error ("interleaver::interleaver(const char *name): file read error\n"); } } - + // generate DEINTER table for(int i=0;i<d_K;i++) { d_DEINTER[d_INTER[i]]=i; @@ -105,11 +105,11 @@ interleaver::interleaver(int K, int seed) d_INTER.resize(d_K); d_DEINTER.resize(d_K); - if(seed>=0) srand((unsigned int)seed); + if(seed>=0) srand((unsigned int)seed); std::vector<int> tmp(d_K); for(int i=0;i<d_K;i++) { d_INTER[i]=i; - tmp[i] = rand(); + tmp[i] = rand(); } quicksort_index <int> (tmp,d_INTER,0,d_K-1); diff --git a/gr-trellis/src/lib/interleaver.i b/gr-trellis/src/lib/interleaver.i index 403c2d09e..bb9078b1b 100644 --- a/gr-trellis/src/lib/interleaver.i +++ b/gr-trellis/src/lib/interleaver.i @@ -1,38 +1,38 @@ -/* -*- c++ -*- */
-/*
- * Copyright 2002 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 3, 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., 51 Franklin Street,
- * Boston, MA 02110-1301, USA.
- */
-
-class interleaver {
-private:
- int d_K;
- std::vector<int> d_INTER;
- std::vector<int> d_DEINTER;
-public:
- interleaver();
- interleaver(const interleaver & INTERLEAVER);
- interleaver(int K, const std::vector<int> & INTER);
- interleaver(const char *name);
- interleaver(int K, int seed);
- int K () const { return d_K; }
- const std::vector<int> & INTER () const { return d_INTER; }
- const std::vector<int> & DEINTER () const { return d_DEINTER; }
- void write_interleaver_txt(std::string filename);
-};
+/* -*- c++ -*- */ +/* + * Copyright 2002 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 3, 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., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +class interleaver { +private: + int d_K; + std::vector<int> d_INTER; + std::vector<int> d_DEINTER; +public: + interleaver(); + interleaver(const interleaver & INTERLEAVER); + interleaver(int K, const std::vector<int> & INTER); + interleaver(const char *name); + interleaver(int K, int seed); + int K () const { return d_K; } + const std::vector<int> & INTER () const { return d_INTER; } + const std::vector<int> & DEINTER () const { return d_DEINTER; } + void write_interleaver_txt(std::string filename); +}; diff --git a/gr-trellis/src/lib/quicksort_index.cc b/gr-trellis/src/lib/quicksort_index.cc index b75896a20..cf37e862e 100644 --- a/gr-trellis/src/lib/quicksort_index.cc +++ b/gr-trellis/src/lib/quicksort_index.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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 3, 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., 51 Franklin Street, diff --git a/gr-trellis/src/lib/quicksort_index.h b/gr-trellis/src/lib/quicksort_index.h index da453972e..9583955db 100644 --- a/gr-trellis/src/lib/quicksort_index.h +++ b/gr-trellis/src/lib/quicksort_index.h @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2004,2007 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 3, 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., 51 Franklin Street, diff --git a/gr-trellis/src/lib/run_guile_tests.in b/gr-trellis/src/lib/run_guile_tests.in deleted file mode 100644 index 5d08b0dd5..000000000 --- a/gr-trellis/src/lib/run_guile_tests.in +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -. @top_builddir@/setup_guile_test_env - -# 1st argument is absolute path to hand coded guile source directory -# 2nd argument is absolute path to component C++ shared library build directory -# 3nd argument is absolute path to component SWIG build directory - -add_local_paths \ - @srcdir@ \ - @abs_builddir@ \ - @abs_builddir@ - -@GUILE@ -e main -c '(use-modules (gnuradio test-suite guile-test))' -t @srcdir@ diff --git a/gr-trellis/src/lib/trellis.i b/gr-trellis/src/lib/trellis.i index 70775af41..0debf5e5d 100644 --- a/gr-trellis/src/lib/trellis.i +++ b/gr-trellis/src/lib/trellis.i @@ -56,13 +56,3 @@ //%pythoncode %{ // from gnuradio.gr import TRELLIS_EUCLIDEAN, TRELLIS_HARD_SYMBOL, TRELLIS_HARD_BIT // %} - -#if SWIGGUILE -%scheme %{ -(load-extension-global "libguile-gnuradio-trellis" "scm_init_gnuradio_trellis_module") -%} - -%goops %{ -(use-modules (gnuradio gnuradio_core_runtime)) -%} -#endif diff --git a/gr-trellis/src/lib/trellis.test b/gr-trellis/src/lib/trellis.test deleted file mode 100644 index d370ab18c..000000000 --- a/gr-trellis/src/lib/trellis.test +++ /dev/null @@ -1,53 +0,0 @@ -;;; -*- Scheme -*- -;;; -;;; Copyright 2010 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 3, 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 this program. If not, see <http://www.gnu.org/licenses/>. -;;; - -;;; If you're using Emacs's Scheme mode: -;;; (put 'with-test-prefix 'scheme-indent-function 1) - -;;; See the comments in gnuradio/test-suite/lib.scm for info on writing tests. -;;; See also the very end of the file, where the test-equal, test-eqv -;;; and test-eq macros are defined. - -(define-module (test-module) - #:use-module (oop goops) - #:use-module (gnuradio core) - #:use-module (gnuradio test-suite lib) - #:duplicates (merge-generics replace check)) - - -;;; See if we can import the module... -(use-modules (gnuradio trellis)) - -;;; Now do some real testing, like that in ../python/qa_trellis.py -;;; FIXME later. Other problems to deal with. Looks like -;;; I don't understand the constructor to <fsm> - -(read-set! keywords 'prefix) - -'(with-test-prefix "test-001-fsm" - (let* ((I 2) - (S 4) - (O 4) - (NS #(0 2 0 2 1 3 1 3)) - (OS #(0 3 3 0 1 2 2 1)) - (f (make <fsm> :I I :S S :O O :NS NS :OS OS))) - (test-equal (list I S O NS OS) - (list (gr:I f) (gr:S f) (gr:O f) (gr:NS f) (gr:OS f))))) - diff --git a/gr-trellis/src/lib/trellis_constellation_metrics_cf.cc b/gr-trellis/src/lib/trellis_constellation_metrics_cf.cc index 91520e4ce..6e6aa2dd0 100644 --- a/gr-trellis/src/lib/trellis_constellation_metrics_cf.cc +++ b/gr-trellis/src/lib/trellis_constellation_metrics_cf.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2004,2010,2011 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 3, 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., 51 Franklin Street, @@ -81,8 +81,8 @@ for (unsigned int m=0;m<nstreams;m++) { float *out = (float *) output_items[m]; for (unsigned int i = 0; i < noutput_items / d_O ; i++){ - d_constellation->calc_metric(&(in[i*d_D]), &(out[i*d_O]), d_TYPE); - } + d_constellation->calc_metric(&(in[i*d_D]), &(out[i*d_O]), d_TYPE); + } } consume_each (d_D * noutput_items / d_O); diff --git a/gr-trellis/src/lib/trellis_constellation_metrics_cf.h b/gr-trellis/src/lib/trellis_constellation_metrics_cf.h index 1851bb89c..2c2070522 100644 --- a/gr-trellis/src/lib/trellis_constellation_metrics_cf.h +++ b/gr-trellis/src/lib/trellis_constellation_metrics_cf.h @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2004,2010,2011 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 3, 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., 51 Franklin Street, @@ -48,7 +48,7 @@ class TRELLIS_API trellis_constellation_metrics_cf : public gr_block gr_vector_void_star &output_items); protected: trellis_constellation_metrics_cf (digital_constellation_sptr constellation, trellis_metric_type_t TYPE); - + private: digital_constellation_sptr d_constellation; trellis_metric_type_t d_TYPE; diff --git a/gr-trellis/src/lib/trellis_encoder_XX.cc.t b/gr-trellis/src/lib/trellis_encoder_XX.cc.t index 698a0b307..dca92b08f 100644 --- a/gr-trellis/src/lib/trellis_encoder_XX.cc.t +++ b/gr-trellis/src/lib/trellis_encoder_XX.cc.t @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2004,2010 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 3, 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., 51 Franklin Street, @@ -30,7 +30,7 @@ #include <gr_io_signature.h> #include <iostream> -@SPTR_NAME@ +@SPTR_NAME@ trellis_make_@BASE_NAME@ (const fsm &FSM, int ST) { return gnuradio::get_initial_sptr (new @NAME@ (FSM,ST)); @@ -47,7 +47,7 @@ trellis_make_@BASE_NAME@ (const fsm &FSM, int ST) -int +int @NAME@::work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) diff --git a/gr-trellis/src/lib/trellis_encoder_XX.h.t b/gr-trellis/src/lib/trellis_encoder_XX.h.t index 4038caac9..7c4250a92 100644 --- a/gr-trellis/src/lib/trellis_encoder_XX.h.t +++ b/gr-trellis/src/lib/trellis_encoder_XX.h.t @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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 3, 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., 51 Franklin Street, @@ -44,7 +44,7 @@ private: friend TRELLIS_API @SPTR_NAME@ trellis_make_@BASE_NAME@ (const fsm &FSM, int ST); fsm d_FSM; int d_ST; - @NAME@ (const fsm &FSM, int ST); + @NAME@ (const fsm &FSM, int ST); public: fsm FSM () const { return d_FSM; } diff --git a/gr-trellis/src/lib/trellis_metrics_X.cc.t b/gr-trellis/src/lib/trellis_metrics_X.cc.t index cd66df6fb..77eb8c81b 100644 --- a/gr-trellis/src/lib/trellis_metrics_X.cc.t +++ b/gr-trellis/src/lib/trellis_metrics_X.cc.t @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2004,2010 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 3, 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., 51 Franklin Street, @@ -89,7 +89,7 @@ for (int m=0;m<nstreams;m++) { for (int i = 0; i < noutput_items / d_O ; i++){ calc_metric(d_O, d_D, d_TABLE,&(in[i*d_D]),&(out[i*d_O]), d_TYPE); - } + } } consume_each (d_D * noutput_items / d_O); diff --git a/gr-trellis/src/lib/trellis_metrics_X.h.t b/gr-trellis/src/lib/trellis_metrics_X.h.t index 809c27e65..ab406c51e 100644 --- a/gr-trellis/src/lib/trellis_metrics_X.h.t +++ b/gr-trellis/src/lib/trellis_metrics_X.h.t @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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 3, 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., 51 Franklin Street, diff --git a/gr-trellis/src/lib/trellis_pccc_decoder_X.cc.t b/gr-trellis/src/lib/trellis_pccc_decoder_X.cc.t index 34dd2eb87..d79192491 100644 --- a/gr-trellis/src/lib/trellis_pccc_decoder_X.cc.t +++ b/gr-trellis/src/lib/trellis_pccc_decoder_X.cc.t @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2004,2010 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 3, 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., 51 Franklin Street, @@ -32,10 +32,10 @@ #include <iostream> #include "core_algorithms.h" - + static const float INF = 1.0e9; -@SPTR_NAME@ +@SPTR_NAME@ trellis_make_@BASE_NAME@ ( const fsm &FSM1, int ST10, int ST1K, const fsm &FSM2, int ST20, int ST2K, @@ -65,7 +65,7 @@ trellis_make_@BASE_NAME@ ( ) : gr_block ("@BASE_NAME@", gr_make_io_signature (1, 1, sizeof (float)), - gr_make_io_signature (1, 1, sizeof (@O_TYPE@))), + gr_make_io_signature (1, 1, sizeof (@O_TYPE@))), d_FSM1 (FSM1), d_ST10 (ST10), d_ST1K (ST1K), d_FSM2 (FSM2), d_ST20 (ST20), d_ST2K (ST2K), d_INTERLEAVER (INTERLEAVER), @@ -114,7 +114,7 @@ int d_FSM1, d_ST10, d_ST1K, d_FSM2, d_ST20, d_ST2K, d_INTERLEAVER, d_blocklength, d_repetitions, - p2min, + p2min, &(in[n*d_blocklength*d_FSM1.O()*d_FSM2.O()]),&(out[n*d_blocklength]) ); } diff --git a/gr-trellis/src/lib/trellis_pccc_decoder_X.h.t b/gr-trellis/src/lib/trellis_pccc_decoder_X.h.t index a58a03264..e9bc94681 100644 --- a/gr-trellis/src/lib/trellis_pccc_decoder_X.h.t +++ b/gr-trellis/src/lib/trellis_pccc_decoder_X.h.t @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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 3, 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., 51 Franklin Street, @@ -41,7 +41,7 @@ TRELLIS_API @SPTR_NAME@ trellis_make_@BASE_NAME@ ( const interleaver &INTERLEAVER, int blocklength, int repetitions, - trellis_siso_type_t SISO_TYPE // perform "min-sum" or "sum-product" combining + trellis_siso_type_t SISO_TYPE // perform "min-sum" or "sum-product" combining ); @@ -77,7 +77,7 @@ class TRELLIS_API @NAME@ : public gr_block const interleaver &INTERLEAVER, int blocklength, int repetitions, - trellis_siso_type_t SISO_TYPE + trellis_siso_type_t SISO_TYPE ); public: diff --git a/gr-trellis/src/lib/trellis_pccc_decoder_combined_XX.cc.t b/gr-trellis/src/lib/trellis_pccc_decoder_combined_XX.cc.t index 48f68f1fe..03e21de1f 100644 --- a/gr-trellis/src/lib/trellis_pccc_decoder_combined_XX.cc.t +++ b/gr-trellis/src/lib/trellis_pccc_decoder_combined_XX.cc.t @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2004,2010 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 3, 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., 51 Franklin Street, @@ -32,10 +32,10 @@ #include <iostream> #include "core_algorithms.h" - + static const float INF = 1.0e9; -@SPTR_NAME@ +@SPTR_NAME@ trellis_make_@BASE_NAME@ ( const fsm &FSMo, int STo0, int SToK, const fsm &FSMi, int STi0, int STiK, @@ -76,7 +76,7 @@ trellis_make_@BASE_NAME@ ( ) : gr_block ("@BASE_NAME@", gr_make_io_signature (1, 1, sizeof (@I_TYPE@)), - gr_make_io_signature (1, 1, sizeof (@O_TYPE@))), + gr_make_io_signature (1, 1, sizeof (@O_TYPE@))), d_FSMo (FSMo), d_STo0 (STo0), d_SToK (SToK), d_FSMi (FSMi), d_STi0 (STi0), d_STiK (STiK), d_INTERLEAVER (INTERLEAVER), @@ -134,9 +134,9 @@ int d_FSMo, d_STo0, d_SToK, d_FSMi, d_STi0, d_STiK, d_INTERLEAVER, d_blocklength, d_repetitions, - p2min, - d_D,d_TABLE, - d_METRIC_TYPE, + p2min, + d_D,d_TABLE, + d_METRIC_TYPE, d_scaling, &(in[n*d_blocklength*d_D]),&(out[n*d_blocklength]) ); diff --git a/gr-trellis/src/lib/trellis_pccc_decoder_combined_XX.h.t b/gr-trellis/src/lib/trellis_pccc_decoder_combined_XX.h.t index ce118a3b1..6e45ea10a 100644 --- a/gr-trellis/src/lib/trellis_pccc_decoder_combined_XX.h.t +++ b/gr-trellis/src/lib/trellis_pccc_decoder_combined_XX.h.t @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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 3, 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., 51 Franklin Street, @@ -42,7 +42,7 @@ TRELLIS_API @SPTR_NAME@ trellis_make_@BASE_NAME@ ( const interleaver &INTERLEAVER, int blocklength, int repetitions, - trellis_siso_type_t SISO_TYPE, // perform "min-sum" or "sum-product" combining + trellis_siso_type_t SISO_TYPE, // perform "min-sum" or "sum-product" combining int D, const std::vector<@I_TYPE@> &TABLE, trellis_metric_type_t METRIC_TYPE, @@ -90,7 +90,7 @@ class TRELLIS_API @NAME@ : public gr_block const interleaver &INTERLEAVER, int blocklength, int repetitions, - trellis_siso_type_t SISO_TYPE, + trellis_siso_type_t SISO_TYPE, int D, const std::vector<@I_TYPE@> &TABLE, trellis_metric_type_t METRIC_TYPE, diff --git a/gr-trellis/src/lib/trellis_pccc_encoder_XX.cc.t b/gr-trellis/src/lib/trellis_pccc_encoder_XX.cc.t index 40dcd4105..6cab858cd 100644 --- a/gr-trellis/src/lib/trellis_pccc_encoder_XX.cc.t +++ b/gr-trellis/src/lib/trellis_pccc_encoder_XX.cc.t @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2004,2010 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 3, 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., 51 Franklin Street, @@ -30,7 +30,7 @@ #include <gr_io_signature.h> #include <iostream> -@SPTR_NAME@ +@SPTR_NAME@ trellis_make_@BASE_NAME@ ( const fsm &FSM1, int ST1, const fsm &FSM2, int ST2, @@ -64,13 +64,13 @@ trellis_make_@BASE_NAME@ ( -int +int @NAME@::work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { assert(noutput_items%d_blocklength ==0); - for (int b = 0 ; b<noutput_items/d_blocklength; b++) { + for (int b = 0 ; b<noutput_items/d_blocklength; b++) { const @I_TYPE@ *in = (const @I_TYPE@ *) input_items[0]+b*d_blocklength; @O_TYPE@ *out = (@O_TYPE@ *) output_items[0]+b*d_blocklength; diff --git a/gr-trellis/src/lib/trellis_pccc_encoder_XX.h.t b/gr-trellis/src/lib/trellis_pccc_encoder_XX.h.t index 2b6110e37..75a22b829 100644 --- a/gr-trellis/src/lib/trellis_pccc_encoder_XX.h.t +++ b/gr-trellis/src/lib/trellis_pccc_encoder_XX.h.t @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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 3, 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., 51 Franklin Street, @@ -66,7 +66,7 @@ private: const fsm &FSM2, int ST2, const interleaver &INTERLEAVER, int blocklength - ); + ); public: fsm FSM1 () const { return d_FSM1; } diff --git a/gr-trellis/src/lib/trellis_permutation.cc b/gr-trellis/src/lib/trellis_permutation.cc index 416fc58ec..57c6d2693 100644 --- a/gr-trellis/src/lib/trellis_permutation.cc +++ b/gr-trellis/src/lib/trellis_permutation.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2004,2010 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 3, 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., 51 Franklin Street, @@ -29,7 +29,7 @@ #include <iostream> #include <string.h> -trellis_permutation_sptr +trellis_permutation_sptr trellis_make_permutation (int K, const std::vector<int> &TABLE, int SYMS_PER_BLOCK, size_t BYTES_PER_SYMBOL) { return gnuradio::get_initial_sptr(new trellis_permutation (K,TABLE,SYMS_PER_BLOCK,BYTES_PER_SYMBOL)); @@ -50,7 +50,7 @@ trellis_permutation::trellis_permutation (int K, const std::vector<int> &TABLE, -int +int trellis_permutation::work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) @@ -67,13 +67,13 @@ trellis_permutation::work (int noutput_items, for (int i = 0; i < noutput_items/d_SYMS_PER_BLOCK; i++){ // Index i refers to blocks. // Begining of packet (in blocks) - int i0 = d_K*(i/d_K); + int i0 = d_K*(i/d_K); // position of block within packet (in blocks) int j0 = i%d_K; // new position of block within packet (in blocks) int k0 = d_TABLE[j0]; - memcpy(&(out[i*d_SYMS_PER_BLOCK*d_BYTES_PER_SYMBOL]), - &(in[(i0+k0)*d_SYMS_PER_BLOCK*d_BYTES_PER_SYMBOL]), + memcpy(&(out[i*d_SYMS_PER_BLOCK*d_BYTES_PER_SYMBOL]), + &(in[(i0+k0)*d_SYMS_PER_BLOCK*d_BYTES_PER_SYMBOL]), d_BYTES_PER_SYMBOL*d_SYMS_PER_BLOCK); } // end per stream processing diff --git a/gr-trellis/src/lib/trellis_permutation.h b/gr-trellis/src/lib/trellis_permutation.h index 2786de29a..cc40518c2 100644 --- a/gr-trellis/src/lib/trellis_permutation.h +++ b/gr-trellis/src/lib/trellis_permutation.h @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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 3, 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., 51 Franklin Street, @@ -45,7 +45,7 @@ private: std::vector<int> d_TABLE; int d_SYMS_PER_BLOCK; size_t d_BYTES_PER_SYMBOL; - trellis_permutation (int K, const std::vector<int> &TABLE, int SYMS_PER_BLOCK, size_t NBYTES); + trellis_permutation (int K, const std::vector<int> &TABLE, int SYMS_PER_BLOCK, size_t NBYTES); public: int K () const { return d_K; } diff --git a/gr-trellis/src/lib/trellis_permutation.i b/gr-trellis/src/lib/trellis_permutation.i index 1433a6584..fdfaa44d3 100644 --- a/gr-trellis/src/lib/trellis_permutation.i +++ b/gr-trellis/src/lib/trellis_permutation.i @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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 3, 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., 51 Franklin Street, @@ -31,7 +31,7 @@ private: std::vector<int> d_TABLE; int d_SYMS_PER_BLOCK; size_t d_BYTES_PER_SYMBOL; - trellis_permutation (int K, const std::vector<int> &TABLE, int SYMS_PER_BLOCK, size_t BYTES_PER_SYMBOL); + trellis_permutation (int K, const std::vector<int> &TABLE, int SYMS_PER_BLOCK, size_t BYTES_PER_SYMBOL); public: int K () const { return d_K; } diff --git a/gr-trellis/src/lib/trellis_sccc_decoder_X.cc.t b/gr-trellis/src/lib/trellis_sccc_decoder_X.cc.t index 4a0f471fa..c9b78aa8f 100644 --- a/gr-trellis/src/lib/trellis_sccc_decoder_X.cc.t +++ b/gr-trellis/src/lib/trellis_sccc_decoder_X.cc.t @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2004,2010 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 3, 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., 51 Franklin Street, @@ -32,10 +32,10 @@ #include <iostream> #include "core_algorithms.h" - + static const float INF = 1.0e9; -@SPTR_NAME@ +@SPTR_NAME@ trellis_make_@BASE_NAME@ ( const fsm &FSMo, int STo0, int SToK, const fsm &FSMi, int STi0, int STiK, @@ -65,7 +65,7 @@ trellis_make_@BASE_NAME@ ( ) : gr_block ("@BASE_NAME@", gr_make_io_signature (1, 1, sizeof (float)), - gr_make_io_signature (1, 1, sizeof (@O_TYPE@))), + gr_make_io_signature (1, 1, sizeof (@O_TYPE@))), d_FSMo (FSMo), d_STo0 (STo0), d_SToK (SToK), d_FSMi (FSMi), d_STi0 (STi0), d_STiK (STiK), d_INTERLEAVER (INTERLEAVER), @@ -114,7 +114,7 @@ int d_FSMo, d_STo0, d_SToK, d_FSMi, d_STi0, d_STiK, d_INTERLEAVER, d_blocklength, d_repetitions, - p2min, + p2min, &(in[n*d_blocklength*d_FSMi.O()]),&(out[n*d_blocklength]) ); } diff --git a/gr-trellis/src/lib/trellis_sccc_decoder_X.h.t b/gr-trellis/src/lib/trellis_sccc_decoder_X.h.t index 9857c6a34..d6fb72f68 100644 --- a/gr-trellis/src/lib/trellis_sccc_decoder_X.h.t +++ b/gr-trellis/src/lib/trellis_sccc_decoder_X.h.t @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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 3, 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., 51 Franklin Street, @@ -41,7 +41,7 @@ TRELLIS_API @SPTR_NAME@ trellis_make_@BASE_NAME@ ( const interleaver &INTERLEAVER, int blocklength, int repetitions, - trellis_siso_type_t SISO_TYPE // perform "min-sum" or "sum-product" combining + trellis_siso_type_t SISO_TYPE // perform "min-sum" or "sum-product" combining ); @@ -77,7 +77,7 @@ class TRELLIS_API @NAME@ : public gr_block const interleaver &INTERLEAVER, int blocklength, int repetitions, - trellis_siso_type_t SISO_TYPE + trellis_siso_type_t SISO_TYPE ); public: diff --git a/gr-trellis/src/lib/trellis_sccc_decoder_combined_XX.cc.t b/gr-trellis/src/lib/trellis_sccc_decoder_combined_XX.cc.t index 2927e3fe3..4508ca5cb 100644 --- a/gr-trellis/src/lib/trellis_sccc_decoder_combined_XX.cc.t +++ b/gr-trellis/src/lib/trellis_sccc_decoder_combined_XX.cc.t @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2004,2010 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 3, 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., 51 Franklin Street, @@ -32,10 +32,10 @@ #include <iostream> #include "core_algorithms.h" - + static const float INF = 1.0e9; -@SPTR_NAME@ +@SPTR_NAME@ trellis_make_@BASE_NAME@ ( const fsm &FSMo, int STo0, int SToK, const fsm &FSMi, int STi0, int STiK, @@ -76,7 +76,7 @@ trellis_make_@BASE_NAME@ ( ) : gr_block ("@BASE_NAME@", gr_make_io_signature (1, 1, sizeof (@I_TYPE@)), - gr_make_io_signature (1, 1, sizeof (@O_TYPE@))), + gr_make_io_signature (1, 1, sizeof (@O_TYPE@))), d_FSMo (FSMo), d_STo0 (STo0), d_SToK (SToK), d_FSMi (FSMi), d_STi0 (STi0), d_STiK (STiK), d_INTERLEAVER (INTERLEAVER), @@ -134,9 +134,9 @@ int d_FSMo, d_STo0, d_SToK, d_FSMi, d_STi0, d_STiK, d_INTERLEAVER, d_blocklength, d_repetitions, - p2min, - d_D,d_TABLE, - d_METRIC_TYPE, + p2min, + d_D,d_TABLE, + d_METRIC_TYPE, d_scaling, &(in[n*d_blocklength*d_D]),&(out[n*d_blocklength]) ); diff --git a/gr-trellis/src/lib/trellis_sccc_decoder_combined_XX.h.t b/gr-trellis/src/lib/trellis_sccc_decoder_combined_XX.h.t index 5d2c2b85c..3fdc53c62 100644 --- a/gr-trellis/src/lib/trellis_sccc_decoder_combined_XX.h.t +++ b/gr-trellis/src/lib/trellis_sccc_decoder_combined_XX.h.t @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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 3, 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., 51 Franklin Street, @@ -42,7 +42,7 @@ TRELLIS_API @SPTR_NAME@ trellis_make_@BASE_NAME@ ( const interleaver &INTERLEAVER, int blocklength, int repetitions, - trellis_siso_type_t SISO_TYPE, // perform "min-sum" or "sum-product" combining + trellis_siso_type_t SISO_TYPE, // perform "min-sum" or "sum-product" combining int D, const std::vector<@I_TYPE@> &TABLE, trellis_metric_type_t METRIC_TYPE, @@ -90,7 +90,7 @@ class TRELLIS_API @NAME@ : public gr_block const interleaver &INTERLEAVER, int blocklength, int repetitions, - trellis_siso_type_t SISO_TYPE, + trellis_siso_type_t SISO_TYPE, int D, const std::vector<@I_TYPE@> &TABLE, trellis_metric_type_t METRIC_TYPE, diff --git a/gr-trellis/src/lib/trellis_sccc_encoder_XX.cc.t b/gr-trellis/src/lib/trellis_sccc_encoder_XX.cc.t index b1a46ca60..8054909db 100644 --- a/gr-trellis/src/lib/trellis_sccc_encoder_XX.cc.t +++ b/gr-trellis/src/lib/trellis_sccc_encoder_XX.cc.t @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2004,2010 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 3, 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., 51 Franklin Street, @@ -30,7 +30,7 @@ #include <gr_io_signature.h> #include <iostream> -@SPTR_NAME@ +@SPTR_NAME@ trellis_make_@BASE_NAME@ ( const fsm &FSMo, int STo, const fsm &FSMi, int STi, @@ -64,13 +64,13 @@ trellis_make_@BASE_NAME@ ( -int +int @NAME@::work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { assert(noutput_items%d_blocklength ==0); - for (int b = 0 ; b<noutput_items/d_blocklength; b++) { + for (int b = 0 ; b<noutput_items/d_blocklength; b++) { const @I_TYPE@ *in = (const @I_TYPE@ *) input_items[0]+b*d_blocklength; @O_TYPE@ *out = (@O_TYPE@ *) output_items[0]+b*d_blocklength; diff --git a/gr-trellis/src/lib/trellis_sccc_encoder_XX.h.t b/gr-trellis/src/lib/trellis_sccc_encoder_XX.h.t index 0e8ff45a4..b16d7ffca 100644 --- a/gr-trellis/src/lib/trellis_sccc_encoder_XX.h.t +++ b/gr-trellis/src/lib/trellis_sccc_encoder_XX.h.t @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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 3, 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., 51 Franklin Street, @@ -66,7 +66,7 @@ private: const fsm &FSMi, int STi, const interleaver &INTERLEAVER, int blocklength - ); + ); public: fsm FSMo () const { return d_FSMo; } diff --git a/gr-trellis/src/lib/trellis_siso_combined_f.cc b/gr-trellis/src/lib/trellis_siso_combined_f.cc index 2a4cfa123..d27fe4425 100644 --- a/gr-trellis/src/lib/trellis_siso_combined_f.cc +++ b/gr-trellis/src/lib/trellis_siso_combined_f.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2004,2010 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 3, 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., 51 Franklin Street, @@ -29,10 +29,10 @@ #include <stdexcept> #include <assert.h> #include <iostream> - + static const float INF = 1.0e9; -trellis_siso_combined_f_sptr +trellis_siso_combined_f_sptr trellis_make_siso_combined_f ( const fsm &FSM, int K, @@ -61,7 +61,7 @@ trellis_siso_combined_f::trellis_siso_combined_f ( trellis_metric_type_t TYPE) : gr_block ("siso_combined_f", gr_make_io_signature (1, -1, sizeof (float)), - gr_make_io_signature (1, -1, sizeof (float))), + gr_make_io_signature (1, -1, sizeof (float))), d_FSM (FSM), d_K (K), d_S0 (S0), @@ -76,7 +76,7 @@ trellis_siso_combined_f::trellis_siso_combined_f ( //d_beta(FSM.S()*(K+1)) { int multiple; - if (d_POSTI && d_POSTO) + if (d_POSTI && d_POSTO) multiple = d_FSM.I()+d_FSM.O(); else if(d_POSTI) multiple = d_FSM.I(); @@ -88,14 +88,14 @@ trellis_siso_combined_f::trellis_siso_combined_f ( set_output_multiple (d_K*multiple); //what is the meaning of relative rate for a block with 2 inputs? //set_relative_rate ( multiple / ((double) d_FSM.I()) ); - // it turns out that the above gives problems in the scheduler, so + // it turns out that the above gives problems in the scheduler, so // let's try (assumption O>I) //set_relative_rate ( multiple / ((double) d_FSM.O()) ); // I am tempted to automate like this if(d_FSM.I() <= d_D) set_relative_rate ( multiple / ((double) d_D) ); else - set_relative_rate ( multiple / ((double) d_FSM.I()) ); + set_relative_rate ( multiple / ((double) d_FSM.I()) ); } @@ -111,7 +111,7 @@ trellis_siso_combined_f::forecast (int noutput_items, gr_vector_int &ninput_item multiple = d_FSM.O(); else throw std::runtime_error ("Not both POSTI and POSTO can be false."); - //printf("forecast: Multiple = %d\n",multiple); + //printf("forecast: Multiple = %d\n",multiple); assert (noutput_items % (d_K*multiple) == 0); int input_required1 = d_FSM.I() * (noutput_items/multiple) ; int input_required2 = d_D * (noutput_items/multiple) ; @@ -142,7 +142,7 @@ inline float min_star(float a, float b) return (a <= b ? a : b)-log(1+exp(a <= b ? a-b : b-a)); } -void siso_algorithm_combined(int I, int S, int O, +void siso_algorithm_combined(int I, int S, int O, const std::vector<int> &NS, const std::vector<int> &OS, const std::vector< std::vector<int> > &PS, @@ -157,7 +157,7 @@ void siso_algorithm_combined(int I, int S, int O, const float *priori, const float *observations, float *post//, //std::vector<float> &alpha, //std::vector<float> &beta - ) + ) { float norm,mm,minm; std::vector<float> alpha(S*(K+1)); @@ -186,7 +186,7 @@ void siso_algorithm_combined(int I, int S, int O, alpha[(k+1)*S+j]=minm; if(minm<norm) norm=minm; } - for(int j=0;j<S;j++) + for(int j=0;j<S;j++) alpha[(k+1)*S+j]-=norm; // normalize total metrics so they do not explode } @@ -200,7 +200,7 @@ void siso_algorithm_combined(int I, int S, int O, for(int k=K-1;k>=0;k--) { // backward recursion norm=INF; - for(int j=0;j<S;j++) { + for(int j=0;j<S;j++) { minm=INF; for(int i=0;i<I;i++) { int i0 = j*I+i; @@ -249,8 +249,8 @@ void siso_algorithm_combined(int I, int S, int O, for(int n=0;n<O;n++) post[k*(I+O)+I+n]-=norm; // normalize metrics } - } - else if(POSTI) + } + else if(POSTI) { for(int k=0;k<K;k++) { // input combining norm=INF; @@ -306,7 +306,7 @@ trellis_siso_combined_f::general_work (int noutput_items, { assert (input_items.size() == 2*output_items.size()); int nstreams = output_items.size(); - //printf("general_work:Streams: %d\n",nstreams); + //printf("general_work:Streams: %d\n",nstreams); int multiple; if (d_POSTI && d_POSTO) multiple = d_FSM.I()+d_FSM.O(); @@ -319,11 +319,11 @@ trellis_siso_combined_f::general_work (int noutput_items, assert (noutput_items % (d_K*multiple) == 0); int nblocks = noutput_items / (d_K*multiple); - //printf("general_work:Blocks: %d\n",nblocks); + //printf("general_work:Blocks: %d\n",nblocks); //for(int i=0;i<ninput_items.size();i++) //printf("general_work:Input items available: %d\n",ninput_items[i]); - float (*p2min)(float, float) = NULL; + float (*p2min)(float, float) = NULL; if(d_SISO_TYPE == TRELLIS_MIN_SUM) p2min = &min; else if(d_SISO_TYPE == TRELLIS_SUM_PRODUCT) diff --git a/gr-trellis/src/lib/trellis_siso_combined_f.h b/gr-trellis/src/lib/trellis_siso_combined_f.h index 2d043df62..4b28e8de4 100644 --- a/gr-trellis/src/lib/trellis_siso_combined_f.h +++ b/gr-trellis/src/lib/trellis_siso_combined_f.h @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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 3, 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., 51 Franklin Street, @@ -40,7 +40,7 @@ TRELLIS_API trellis_siso_combined_f_sptr trellis_make_siso_combined_f ( int SK, // final state (put -1 if not specified) bool POSTI, // true if you want a-posteriori info about the input symbols to be mux-ed in the output bool POSTO, // true if you want a-posteriori info about the output symbols to be mux-ed in the output - trellis_siso_type_t d_SISO_TYPE, // perform "min-sum" or "sum-product" combining + trellis_siso_type_t d_SISO_TYPE, // perform "min-sum" or "sum-product" combining int D, const std::vector<float> &TABLE, trellis_metric_type_t TYPE diff --git a/gr-trellis/src/lib/trellis_siso_f.cc b/gr-trellis/src/lib/trellis_siso_f.cc index d478c13a3..ffebf1928 100644 --- a/gr-trellis/src/lib/trellis_siso_f.cc +++ b/gr-trellis/src/lib/trellis_siso_f.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2004,2010 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 3, 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., 51 Franklin Street, @@ -29,10 +29,10 @@ #include <stdexcept> #include <assert.h> #include <iostream> - + static const float INF = 1.0e9; -trellis_siso_f_sptr +trellis_siso_f_sptr trellis_make_siso_f ( const fsm &FSM, int K, @@ -55,7 +55,7 @@ trellis_siso_f::trellis_siso_f ( trellis_siso_type_t SISO_TYPE) : gr_block ("siso_f", gr_make_io_signature (1, -1, sizeof (float)), - gr_make_io_signature (1, -1, sizeof (float))), + gr_make_io_signature (1, -1, sizeof (float))), d_FSM (FSM), d_K (K), d_S0 (S0), @@ -67,7 +67,7 @@ trellis_siso_f::trellis_siso_f ( //d_beta(FSM.S()*(K+1)) { int multiple; - if (d_POSTI && d_POSTO) + if (d_POSTI && d_POSTO) multiple = d_FSM.I()+d_FSM.O(); else if(d_POSTI) multiple = d_FSM.I(); @@ -79,14 +79,14 @@ trellis_siso_f::trellis_siso_f ( set_output_multiple (d_K*multiple); //what is the meaning of relative rate for a block with 2 inputs? //set_relative_rate ( multiple / ((double) d_FSM.I()) ); - // it turns out that the above gives problems in the scheduler, so + // it turns out that the above gives problems in the scheduler, so // let's try (assumption O>I) //set_relative_rate ( multiple / ((double) d_FSM.O()) ); // I am tempted to automate like this if(d_FSM.I() <= d_FSM.O()) set_relative_rate ( multiple / ((double) d_FSM.O()) ); else - set_relative_rate ( multiple / ((double) d_FSM.I()) ); + set_relative_rate ( multiple / ((double) d_FSM.I()) ); } @@ -102,7 +102,7 @@ trellis_siso_f::forecast (int noutput_items, gr_vector_int &ninput_items_require multiple = d_FSM.O(); else throw std::runtime_error ("Not both POSTI and POSTO can be false."); - //printf("forecast: Multiple = %d\n",multiple); + //printf("forecast: Multiple = %d\n",multiple); assert (noutput_items % (d_K*multiple) == 0); int input_required1 = d_FSM.I() * (noutput_items/multiple) ; int input_required2 = d_FSM.O() * (noutput_items/multiple) ; @@ -131,7 +131,7 @@ inline float min_star(float a, float b) return (a <= b ? a : b)-log(1+exp(a <= b ? a-b : b-a)); } -void siso_algorithm(int I, int S, int O, +void siso_algorithm(int I, int S, int O, const std::vector<int> &NS, const std::vector<int> &OS, const std::vector< std::vector<int> > &PS, @@ -143,7 +143,7 @@ void siso_algorithm(int I, int S, int O, const float *priori, const float *prioro, float *post//, //std::vector<float> &alpha, //std::vector<float> &beta - ) + ) { float norm,mm,minm; std::vector<float> alpha(S*(K+1)); @@ -170,7 +170,7 @@ void siso_algorithm(int I, int S, int O, alpha[(k+1)*S+j]=minm; if(minm<norm) norm=minm; } - for(int j=0;j<S;j++) + for(int j=0;j<S;j++) alpha[(k+1)*S+j]-=norm; // normalize total metrics so they do not explode } @@ -184,7 +184,7 @@ void siso_algorithm(int I, int S, int O, for(int k=K-1;k>=0;k--) { // backward recursion norm=INF; - for(int j=0;j<S;j++) { + for(int j=0;j<S;j++) { minm=INF; for(int i=0;i<I;i++) { int i0 = j*I+i; @@ -233,8 +233,8 @@ if (POSTI && POSTO) for(int n=0;n<O;n++) post[k*(I+O)+I+n]-=norm; // normalize metrics } -} -else if(POSTI) +} +else if(POSTI) { for(int k=0;k<K;k++) { // input combining norm=INF; @@ -288,7 +288,7 @@ trellis_siso_f::general_work (int noutput_items, { assert (input_items.size() == 2*output_items.size()); int nstreams = output_items.size(); - //printf("general_work:Streams: %d\n",nstreams); + //printf("general_work:Streams: %d\n",nstreams); int multiple; if (d_POSTI && d_POSTO) multiple = d_FSM.I()+d_FSM.O(); @@ -301,11 +301,11 @@ trellis_siso_f::general_work (int noutput_items, assert (noutput_items % (d_K*multiple) == 0); int nblocks = noutput_items / (d_K*multiple); - //printf("general_work:Blocks: %d\n",nblocks); + //printf("general_work:Blocks: %d\n",nblocks); //for(int i=0;i<ninput_items.size();i++) //printf("general_work:Input items available: %d\n",ninput_items[i]); - float (*p2min)(float, float) = NULL; + float (*p2min)(float, float) = NULL; if(d_SISO_TYPE == TRELLIS_MIN_SUM) p2min = &min; else if(d_SISO_TYPE == TRELLIS_SUM_PRODUCT) diff --git a/gr-trellis/src/lib/trellis_siso_f.h b/gr-trellis/src/lib/trellis_siso_f.h index b3d02ad05..9341f2468 100644 --- a/gr-trellis/src/lib/trellis_siso_f.h +++ b/gr-trellis/src/lib/trellis_siso_f.h @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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 3, 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., 51 Franklin Street, @@ -39,7 +39,7 @@ TRELLIS_API trellis_siso_f_sptr trellis_make_siso_f ( int SK, // final state (put -1 if not specified) bool POSTI, // true if you want a-posteriori info about the input symbols to be mux-ed in the output bool POSTO, // true if you want a-posteriori info about the output symbols to be mux-ed in the output - trellis_siso_type_t d_SISO_TYPE // perform "min-sum" or "sum-product" combining + trellis_siso_type_t d_SISO_TYPE // perform "min-sum" or "sum-product" combining ); diff --git a/gr-trellis/src/lib/trellis_viterbi_X.cc.t b/gr-trellis/src/lib/trellis_viterbi_X.cc.t index 2254f6450..cadb89d57 100644 --- a/gr-trellis/src/lib/trellis_viterbi_X.cc.t +++ b/gr-trellis/src/lib/trellis_viterbi_X.cc.t @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2004,2010 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 3, 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., 51 Franklin Street, @@ -30,10 +30,10 @@ #include <gr_io_signature.h> #include <assert.h> #include <iostream> - + static const float INF = 1.0e9; -@SPTR_NAME@ +@SPTR_NAME@ trellis_make_@BASE_NAME@ ( const fsm &FSM, int K, @@ -50,7 +50,7 @@ trellis_make_@BASE_NAME@ ( int SK) : gr_block ("@BASE_NAME@", gr_make_io_signature (1, -1, sizeof (float)), - gr_make_io_signature (1, -1, sizeof (@TYPE@))), + gr_make_io_signature (1, -1, sizeof (@TYPE@))), d_FSM (FSM), d_K (K), d_S0 (S0), @@ -89,7 +89,7 @@ void viterbi_algorithm<@O_TYPE@>(int I, int S, int O, /* Moved it to "core_algorithms.cc" */ /* -void viterbi_algorithm(int I, int S, int O, +void viterbi_algorithm(int I, int S, int O, const std::vector<int> &NS, const std::vector<int> &OS, const std::vector< std::vector<int> > &PS, @@ -97,7 +97,7 @@ void viterbi_algorithm(int I, int S, int O, int K, int S0,int SK, const float *in, @TYPE@ *out)//, - //std::vector<int> &trace) + //std::vector<int> &trace) { std::vector<int> trace(S*K); std::vector<float> alpha(S*2); @@ -130,7 +130,7 @@ void viterbi_algorithm(int I, int S, int O, alpha[((alphai+1)%2)*S+j]=minm; if(minm<norm) norm=minm; } - for(int j=0;j<S;j++) + for(int j=0;j<S;j++) alpha[((alphai+1)%2)*S+j]-=norm; // normalize total metrics so they do not explode alphai=(alphai+1)%2; } diff --git a/gr-trellis/src/lib/trellis_viterbi_X.h.t b/gr-trellis/src/lib/trellis_viterbi_X.h.t index c679649bb..c0400d341 100644 --- a/gr-trellis/src/lib/trellis_viterbi_X.h.t +++ b/gr-trellis/src/lib/trellis_viterbi_X.h.t @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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 3, 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., 51 Franklin Street, @@ -34,7 +34,7 @@ class @NAME@; typedef boost::shared_ptr<@NAME@> @SPTR_NAME@; TRELLIS_API @SPTR_NAME@ trellis_make_@BASE_NAME@ ( - const fsm &FSM, + const fsm &FSM, int K, int S0, int SK); diff --git a/gr-trellis/src/lib/trellis_viterbi_combined_XX.cc.t b/gr-trellis/src/lib/trellis_viterbi_combined_XX.cc.t index e883a0ba7..74611ab8f 100644 --- a/gr-trellis/src/lib/trellis_viterbi_combined_XX.cc.t +++ b/gr-trellis/src/lib/trellis_viterbi_combined_XX.cc.t @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2004,2010 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 3, 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., 51 Franklin Street, @@ -30,10 +30,10 @@ #include <gr_io_signature.h> #include <assert.h> #include <iostream> - + static const float INF = 1.0e9; -@SPTR_NAME@ +@SPTR_NAME@ trellis_make_@BASE_NAME@ ( const fsm &FSM, int K, @@ -56,7 +56,7 @@ trellis_make_@BASE_NAME@ ( trellis_metric_type_t TYPE) : gr_block ("@BASE_NAME@", gr_make_io_signature (1, -1, sizeof (@I_TYPE@)), - gr_make_io_signature (1, -1, sizeof (@O_TYPE@))), + gr_make_io_signature (1, -1, sizeof (@O_TYPE@))), d_FSM (FSM), d_K (K), d_S0 (S0), @@ -71,7 +71,7 @@ trellis_make_@BASE_NAME@ ( } -void @NAME@::set_TABLE(const std::vector<@I_TYPE@> &table) +void @NAME@::set_TABLE(const std::vector<@I_TYPE@> &table) { d_TABLE = table; } @@ -91,7 +91,7 @@ void /* -void viterbi_algorithm_combined(int I, int S, int O, +void viterbi_algorithm_combined(int I, int S, int O, const std::vector<int> &NS, const std::vector<int> &OS, const std::vector< std::vector<int> > &PS, @@ -102,7 +102,7 @@ void viterbi_algorithm_combined(int I, int S, int O, const std::vector<@I_TYPE@> &TABLE, trellis_metric_type_t TYPE, const @I_TYPE@ *in, @O_TYPE@ *out)//, - //std::vector<int> &trace) + //std::vector<int> &trace) { std::vector<int> trace(S*K); std::vector<float> alpha(S*2); @@ -136,7 +136,7 @@ void viterbi_algorithm_combined(int I, int S, int O, alpha[((alphai+1)%2)*S+j]=minm; if(minm<norm) norm=minm; } - for(int j=0;j<S;j++) + for(int j=0;j<S;j++) alpha[((alphai+1)%2)*S+j]-=norm; // normalize total metrics so they do not explode alphai=(alphai+1)%2; } @@ -157,7 +157,7 @@ void viterbi_algorithm_combined(int I, int S, int O, out[k]= (@O_TYPE@) PI[st][i0]; st=PS[st][i0]; } - + delete [] metric; } diff --git a/gr-trellis/src/lib/trellis_viterbi_combined_XX.h.t b/gr-trellis/src/lib/trellis_viterbi_combined_XX.h.t index 072f66158..c7e468e73 100644 --- a/gr-trellis/src/lib/trellis_viterbi_combined_XX.h.t +++ b/gr-trellis/src/lib/trellis_viterbi_combined_XX.h.t @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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 3, 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., 51 Franklin Street, diff --git a/gr-trellis/src/python/.gitignore b/gr-trellis/src/python/.gitignore deleted file mode 100644 index bf03975bb..000000000 --- a/gr-trellis/src/python/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -/Makefile -/Makefile.in -/.deps -/.libs -/*.la -/*.lo -/*.pyc -/*.pyo -/run_tests diff --git a/gr-trellis/src/python/CMakeLists.txt b/gr-trellis/src/python/CMakeLists.txt index 66ca3eb13..ae2ab9cb4 100644 --- a/gr-trellis/src/python/CMakeLists.txt +++ b/gr-trellis/src/python/CMakeLists.txt @@ -1,17 +1,17 @@ # Copyright 2011-2012 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 3, 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., 51 Franklin Street, diff --git a/gr-trellis/src/python/Makefile.am b/gr-trellis/src/python/Makefile.am deleted file mode 100644 index 808ac4fb7..000000000 --- a/gr-trellis/src/python/Makefile.am +++ /dev/null @@ -1,32 +0,0 @@ -# -# Copyright 2004,2009 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 3, 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., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -include $(top_srcdir)/Makefile.common - -EXTRA_DIST += run_tests.in \ - awgn1o2_4.fsm - - -TESTS = run_tests - - -noinst_PYTHON = \ - qa_trellis.py diff --git a/gr-trellis/src/python/qa_trellis.py b/gr-trellis/src/python/qa_trellis.py index b50679f27..fcc651ec6 100755 --- a/gr-trellis/src/python/qa_trellis.py +++ b/gr-trellis/src/python/qa_trellis.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004,2010 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 3, 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., 51 Franklin Street, # Boston, MA 02110-1301, USA. -# +# import math @@ -111,9 +111,9 @@ class trellis_tb(gr.top_block): # packet size in shorts src_head = gr.head (gr.sizeof_short, packet_size/16) # unpack shorts to symbols compatible with the FSM input cardinality - s2fsmi = gr.packed_to_unpacked_ss(bitspersymbol, gr.GR_MSB_FIRST) + s2fsmi = gr.packed_to_unpacked_ss(bitspersymbol, gr.GR_MSB_FIRST) # initial FSM state = 0 - enc = trellis.encoder_ss(f, 0) + enc = trellis.encoder_ss(f, 0) mod = gr.chunks_to_symbols_sc(constellation.points(), 1) # CHANNEL @@ -122,14 +122,14 @@ class trellis_tb(gr.top_block): # RX # data preprocessing to generate metrics for Viterbi - metrics = trellis.constellation_metrics_cf(constellation.base(), digital_swig.TRELLIS_EUCLIDEAN) + metrics = trellis.constellation_metrics_cf(constellation.base(), digital_swig.TRELLIS_EUCLIDEAN) # Put -1 if the Initial/Final states are not set. va = trellis.viterbi_s(f, K, 0, -1) # pack FSM input symbols to shorts - fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol, gr.GR_MSB_FIRST) + fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol, gr.GR_MSB_FIRST) # check the output self.dst = gr.check_lfsr_32k_s() - + self.connect (src, src_head, s2fsmi, enc, mod) self.connect (mod, (add, 0)) self.connect (noise, (add, 1)) diff --git a/gr-trellis/src/python/run_tests.in b/gr-trellis/src/python/run_tests.in deleted file mode 100644 index fcb078663..000000000 --- a/gr-trellis/src/python/run_tests.in +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# 1st parameter is absolute path to component source directory -# 2nd parameter is absolute path to component build directory -# 3rd parameter is path to Python QA directory - -PYTHONPATH=@top_builddir@/gr-digital/swig:@top_builddir@/gr-digital/swig/.libs:@top_srcdir@/gr-digital/swig:$PYTHONPATH - -@top_builddir@/run_tests.sh \ - @abs_top_srcdir@/gr-trellis \ - @abs_top_builddir@/gr-trellis \ - @srcdir@ |