summaryrefslogtreecommitdiff
path: root/gr-digital/python/digital/soft_dec_lut_gen.py
diff options
context:
space:
mode:
authorTom Rondeau <tom@trondeau.com>2015-08-17 12:26:24 -0400
committerTom Rondeau <tom@trondeau.com>2015-08-17 12:26:24 -0400
commitdff90672879bf1ed9d3e083ba236fdd6ce29e168 (patch)
tree7b066b9aa14af2758a515d6a4c3c2ea137cf2a24 /gr-digital/python/digital/soft_dec_lut_gen.py
parent22e2f1aed8afdfccce3884cf6bf3140c2b8e3f53 (diff)
whitespace fixes and some minor adjustments for building the Python
manual.
Diffstat (limited to 'gr-digital/python/digital/soft_dec_lut_gen.py')
-rw-r--r--gr-digital/python/digital/soft_dec_lut_gen.py109
1 files changed, 55 insertions, 54 deletions
diff --git a/gr-digital/python/digital/soft_dec_lut_gen.py b/gr-digital/python/digital/soft_dec_lut_gen.py
index 5bea27f843..f517277702 100644
--- a/gr-digital/python/digital/soft_dec_lut_gen.py
+++ b/gr-digital/python/digital/soft_dec_lut_gen.py
@@ -23,60 +23,61 @@
import numpy
def soft_dec_table_generator(soft_dec_gen, prec, Es=1):
- '''Builds a LUT that is a list of tuples. The tuple represents the
- soft decisions for the constellation/bit mapping at any given
- point in the complex space, (x,y).
-
- The table is built to a precision specified by the 'prec'
- argument. There are (2x2)^prec samples in the sample space, so we
- get the precision of 2^prec samples in both the real and imaginary
- axes.
-
- The space is represented where index 0 is the bottom left corner
- and the maximum index is the upper left. The table index for a
- surface space with 4 bits of precision looks like the following:
-
- 240 241 242 243 244 245 246 247 | 248 249 250 251 252 253 254 255
- 224 225 226 227 228 229 230 231 | 232 233 234 235 236 237 238 239
- 208 209 210 211 212 213 214 215 | 216 217 218 219 220 221 222 223
- 192 193 194 195 196 197 198 199 | 200 201 202 203 204 205 206 207
- 176 177 178 179 180 181 182 183 | 184 185 186 187 188 189 190 191
- 160 161 162 163 164 165 166 167 | 168 169 170 171 172 173 174 175
- 144 145 146 147 148 149 150 151 | 152 153 154 155 156 157 158 159
- 128 129 130 131 132 133 134 135 | 136 137 138 139 140 141 142 143
- -----------------------------------------------------------------
- 112 113 114 115 116 117 118 119 | 120 121 122 123 124 125 126 127
- 96 97 98 99 100 101 102 103 | 104 105 106 107 108 109 110 111
- 80 81 82 83 84 85 86 87 | 88 89 90 91 92 93 94 95
- 64 65 66 67 68 69 70 71 | 72 73 74 75 76 77 78 79
- 48 49 50 51 52 53 54 55 | 56 57 58 59 60 61 62 63
- 32 33 34 35 36 37 38 39 | 40 41 42 43 44 45 46 47
- 16 17 18 19 20 21 22 23 | 24 25 26 27 28 29 30 31
- 0 1 2 3 4 5 6 7 | 8 9 10 11 12 13 14 15
-
- We then calculate coordinates from -1 to 1 with 2^prec points for
- both the x and y axes. We then sample starting at (-1, -1) and
- move left to right on the x-axis and then move up a row on the
- y-axis. For every point in this sampled space, we calculate the
- soft decisions for the given constellation/mapping. This is done
- by passing in the function 'soft_dec_gen' as an argument to this
- function. This takes in the x/y coordinates and outputs the soft
- decisions. These soft decisions are stored into the list at the
- index from the above table as a tuple.
-
- The function 'calc_from_table' takes in a point and reverses this
- operation. It converts the point from the coordinates (-1,-1) to
- (1,1) into an index value in the table and returns the tuple of
- soft decisions at that index.
-
- Es is the maximum energy per symbol. This is passed to the
- function to provide the bounds when calling the generator function
- since they don't know how the constellation was normalized. Using
- the (maximum) energy per symbol for constellation allows us to
- provide any scaling of the constellation (normalized to sum to 1,
- normalized so the outside points sit on +/-1, etc.) but still
- calculate the soft decisions as we would given the full
- constellation.
+ '''
+ | Builds a LUT that is a list of tuples. The tuple represents the
+ | soft decisions for the constellation/bit mapping at any given
+ | point in the complex space, (x,y).
+ |
+ | The table is built to a precision specified by the 'prec'
+ | argument. There are (2x2)^prec samples in the sample space, so we
+ | get the precision of 2^prec samples in both the real and imaginary
+ | axes.
+ |
+ | The space is represented where index 0 is the bottom left corner
+ | and the maximum index is the upper left. The table index for a
+ | surface space with 4 bits of precision looks like the following:
+ |
+ | 240 241 242 243 244 245 246 247 | 248 249 250 251 252 253 254 255
+ | 224 225 226 227 228 229 230 231 | 232 233 234 235 236 237 238 239
+ | 208 209 210 211 212 213 214 215 | 216 217 218 219 220 221 222 223
+ | 192 193 194 195 196 197 198 199 | 200 201 202 203 204 205 206 207
+ | 176 177 178 179 180 181 182 183 | 184 185 186 187 188 189 190 191
+ | 160 161 162 163 164 165 166 167 | 168 169 170 171 172 173 174 175
+ | 144 145 146 147 148 149 150 151 | 152 153 154 155 156 157 158 159
+ | 128 129 130 131 132 133 134 135 | 136 137 138 139 140 141 142 143
+ | -----------------------------------------------------------------
+ | 112 113 114 115 116 117 118 119 | 120 121 122 123 124 125 126 127
+ | 96 97 98 99 100 101 102 103 | 104 105 106 107 108 109 110 111
+ | 80 81 82 83 84 85 86 87 | 88 89 90 91 92 93 94 95
+ | 64 65 66 67 68 69 70 71 | 72 73 74 75 76 77 78 79
+ | 48 49 50 51 52 53 54 55 | 56 57 58 59 60 61 62 63
+ | 32 33 34 35 36 37 38 39 | 40 41 42 43 44 45 46 47
+ | 16 17 18 19 20 21 22 23 | 24 25 26 27 28 29 30 31
+ | 0 1 2 3 4 5 6 7 | 8 9 10 11 12 13 14 15
+ |
+ | We then calculate coordinates from -1 to 1 with 2^prec points for
+ | both the x and y axes. We then sample starting at (-1, -1) and
+ | move left to right on the x-axis and then move up a row on the
+ | y-axis. For every point in this sampled space, we calculate the
+ | soft decisions for the given constellation/mapping. This is done
+ | by passing in the function 'soft_dec_gen' as an argument to this
+ | function. This takes in the x/y coordinates and outputs the soft
+ | decisions. These soft decisions are stored into the list at the
+ | index from the above table as a tuple.
+ |
+ | The function 'calc_from_table' takes in a point and reverses this
+ | operation. It converts the point from the coordinates (-1,-1) to
+ | (1,1) into an index value in the table and returns the tuple of
+ | soft decisions at that index.
+ |
+ | Es is the maximum energy per symbol. This is passed to the
+ | function to provide the bounds when calling the generator function
+ | since they don't know how the constellation was normalized. Using
+ | the (maximum) energy per symbol for constellation allows us to
+ | provide any scaling of the constellation (normalized to sum to 1,
+ | normalized so the outside points sit on +/-1, etc.) but still
+ | calculate the soft decisions as we would given the full
+ | constellation.
'''