spandsp  0.0.6
v17_v32bis_tx_constellation_maps.h
1 /*
2  * SpanDSP - a series of DSP components for telephony
3  *
4  * v17_v32bis_tx_constellation_maps.h - ITU V.17 and V.32bis modems
5  * transmit part.
6  * Constellation mapping.
7  *
8  * Written by Steve Underwood <steveu@coppice.org>
9  *
10  * Copyright (C) 2004 Steve Underwood
11  *
12  * All rights reserved.
13  *
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU Lesser General Public License version 2.1,
16  * as published by the Free Software Foundation.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU Lesser General Public License for more details.
22  *
23  * You should have received a copy of the GNU Lesser General Public
24  * License along with this program; if not, write to the Free Software
25  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26  */
27 
28 #if defined(SPANDSP_USE_FIXED_POINTx)
29 static const complexi16_t v17_v32bis_14400_constellation[128] =
30 #else
31 static const complexf_t v17_v32bis_14400_constellation[128] =
32 #endif
33 {
34  {-8, -3}, /* 0x00 */
35  { 9, 2}, /* 0x01 */
36  { 2, -9}, /* 0x02 */
37  {-3, 8}, /* 0x03 */
38  { 8, 3}, /* 0x04 */
39  {-9, -2}, /* 0x05 */
40  {-2, 9}, /* 0x06 */
41  { 3, -8}, /* 0x07 */
42  {-8, 1}, /* 0x08 */
43  { 9, -2}, /* 0x09 */
44  {-2, -9}, /* 0x0A */
45  { 1, 8}, /* 0x0B */
46  { 8, -1}, /* 0x0C */
47  {-9, 2}, /* 0x0D */
48  { 2, 9}, /* 0x0E */
49  {-1, -8}, /* 0x0F */
50  {-4, -3}, /* 0x10 */
51  { 5, 2}, /* 0x11 */
52  { 2, -5}, /* 0x12 */
53  {-3, 4}, /* 0x13 */
54  { 4, 3}, /* 0x14 */
55  {-5, -2}, /* 0x15 */
56  {-2, 5}, /* 0x16 */
57  { 3, -4}, /* 0x17 */
58  {-4, 1}, /* 0x18 */
59  { 5, -2}, /* 0x19 */
60  {-2, -5}, /* 0x1A */
61  { 1, 4}, /* 0x1B */
62  { 4, -1}, /* 0x1C */
63  {-5, 2}, /* 0x1D */
64  { 2, 5}, /* 0x1E */
65  {-1, -4}, /* 0x1F */
66  { 4, -3}, /* 0x20 */
67  {-3, 2}, /* 0x21 */
68  { 2, 3}, /* 0x22 */
69  {-3, -4}, /* 0x23 */
70  {-4, 3}, /* 0x24 */
71  { 3, -2}, /* 0x25 */
72  {-2, -3}, /* 0x26 */
73  { 3, 4}, /* 0x27 */
74  { 4, 1}, /* 0x28 */
75  {-3, -2}, /* 0x29 */
76  {-2, 3}, /* 0x2A */
77  { 1, -4}, /* 0x2B */
78  {-4, -1}, /* 0x2C */
79  { 3, 2}, /* 0x2D */
80  { 2, -3}, /* 0x2E */
81  {-1, 4}, /* 0x2F */
82  { 0, -3}, /* 0x30 */
83  { 1, 2}, /* 0x31 */
84  { 2, -1}, /* 0x32 */
85  {-3, 0}, /* 0x33 */
86  { 0, 3}, /* 0x34 */
87  {-1, -2}, /* 0x35 */
88  {-2, 1}, /* 0x36 */
89  { 3, 0}, /* 0x37 */
90  { 0, 1}, /* 0x38 */
91  { 1, -2}, /* 0x39 */
92  {-2, -1}, /* 0x3A */
93  { 1, 0}, /* 0x3B */
94  { 0, -1}, /* 0x3C */
95  {-1, 2}, /* 0x3D */
96  { 2, 1}, /* 0x3E */
97  {-1, 0}, /* 0x3F */
98  { 8, -3}, /* 0x40 */
99  {-7, 2}, /* 0x41 */
100  { 2, 7}, /* 0x42 */
101  {-3, -8}, /* 0x43 */
102  {-8, 3}, /* 0x44 */
103  { 7, -2}, /* 0x45 */
104  {-2, -7}, /* 0x46 */
105  { 3, 8}, /* 0x47 */
106  { 8, 1}, /* 0x48 */
107  {-7, -2}, /* 0x49 */
108  {-2, 7}, /* 0x4A */
109  { 1, -8}, /* 0x4B */
110  {-8, -1}, /* 0x4C */
111  { 7, 2}, /* 0x4D */
112  { 2, -7}, /* 0x4E */
113  {-1, 8}, /* 0x4F */
114  {-4, -7}, /* 0x50 */
115  { 5, 6}, /* 0x51 */
116  { 6, -5}, /* 0x52 */
117  {-7, 4}, /* 0x53 */
118  { 4, 7}, /* 0x54 */
119  {-5, -6}, /* 0x55 */
120  {-6, 5}, /* 0x56 */
121  { 7, -4}, /* 0x57 */
122  {-4, 5}, /* 0x58 */
123  { 5, -6}, /* 0x59 */
124  {-6, -5}, /* 0x5A */
125  { 5, 4}, /* 0x5B */
126  { 4, -5}, /* 0x5C */
127  {-5, 6}, /* 0x5D */
128  { 6, 5}, /* 0x5E */
129  {-5, -4}, /* 0x5F */
130  { 4, -7}, /* 0x60 */
131  {-3, 6}, /* 0x61 */
132  { 6, 3}, /* 0x62 */
133  {-7, -4}, /* 0x63 */
134  {-4, 7}, /* 0x64 */
135  { 3, -6}, /* 0x65 */
136  {-6, -3}, /* 0x66 */
137  { 7, 4}, /* 0x67 */
138  { 4, 5}, /* 0x68 */
139  {-3, -6}, /* 0x69 */
140  {-6, 3}, /* 0x6A */
141  { 5, -4}, /* 0x6B */
142  {-4, -5}, /* 0x6C */
143  { 3, 6}, /* 0x6D */
144  { 6, -3}, /* 0x6E */
145  {-5, 4}, /* 0x6F */
146  { 0, -7}, /* 0x70 */
147  { 1, 6}, /* 0x71 */
148  { 6, -1}, /* 0x72 */
149  {-7, 0}, /* 0x73 */
150  { 0, 7}, /* 0x74 */
151  {-1, -6}, /* 0x75 */
152  {-6, 1}, /* 0x76 */
153  { 7, 0}, /* 0x77 */
154  { 0, 5}, /* 0x78 */
155  { 1, -6}, /* 0x79 */
156  {-6, -1}, /* 0x7A */
157  { 5, 0}, /* 0x7B */
158  { 0, -5}, /* 0x7C */
159  {-1, 6}, /* 0x7D */
160  { 6, 1}, /* 0x7E */
161  {-5, 0} /* 0x7F */
162 };
163 
164 #if defined(SPANDSP_USE_FIXED_POINTx)
165 static const complexi16_t v17_v32bis_12000_constellation[64] =
166 #else
167 static const complexf_t v17_v32bis_12000_constellation[64] =
168 #endif
169 {
170  { 7, 1}, /* 0x00 */
171  {-5, -1}, /* 0x01 */
172  {-1, 5}, /* 0x02 */
173  { 1, -7}, /* 0x03 */
174  {-7, -1}, /* 0x04 */
175  { 5, 1}, /* 0x05 */
176  { 1, -5}, /* 0x06 */
177  {-1, 7}, /* 0x07 */
178  { 3, -3}, /* 0x08 */
179  {-1, 3}, /* 0x09 */
180  { 3, 1}, /* 0x0A */
181  {-3, -3}, /* 0x0B */
182  {-3, 3}, /* 0x0C */
183  { 1, -3}, /* 0x0D */
184  {-3, -1}, /* 0x0E */
185  { 3, 3}, /* 0x0F */
186  { 7, -7}, /* 0x10 */
187  {-5, 7}, /* 0x11 */
188  { 7, 5}, /* 0x12 */
189  {-7, -7}, /* 0x13 */
190  {-7, 7}, /* 0x14 */
191  { 5, -7}, /* 0x15 */
192  {-7, -5}, /* 0x16 */
193  { 7, 7}, /* 0x17 */
194  {-1, -7}, /* 0x18 */
195  { 3, 7}, /* 0x19 */
196  { 7, -3}, /* 0x1A */
197  {-7, 1}, /* 0x1B */
198  { 1, 7}, /* 0x1C */
199  {-3, -7}, /* 0x1D */
200  {-7, 3}, /* 0x1E */
201  { 7, -1}, /* 0x1F */
202  { 3, 5}, /* 0x20 */
203  {-1, -5}, /* 0x21 */
204  {-5, 1}, /* 0x22 */
205  { 5, -3}, /* 0x23 */
206  {-3, -5}, /* 0x24 */
207  { 1, 5}, /* 0x25 */
208  { 5, -1}, /* 0x26 */
209  {-5, 3}, /* 0x27 */
210  {-1, 1}, /* 0x28 */
211  { 3, -1}, /* 0x29 */
212  {-1, -3}, /* 0x2A */
213  { 1, 1}, /* 0x2B */
214  { 1, -1}, /* 0x2C */
215  {-3, 1}, /* 0x2D */
216  { 1, 3}, /* 0x2E */
217  {-1, -1}, /* 0x2F */
218  {-5, 5}, /* 0x30 */
219  { 7, -5}, /* 0x31 */
220  {-5, -7}, /* 0x32 */
221  { 5, 5}, /* 0x33 */
222  { 5, -5}, /* 0x34 */
223  {-7, 5}, /* 0x35 */
224  { 5, 7}, /* 0x36 */
225  {-5, -5}, /* 0x37 */
226  {-5, -3}, /* 0x38 */
227  { 7, 3}, /* 0x39 */
228  { 3, -7}, /* 0x3A */
229  {-3, 5}, /* 0x3B */
230  { 5, 3}, /* 0x3C */
231  {-7, -3}, /* 0x3D */
232  {-3, 7}, /* 0x3E */
233  { 3, -5} /* 0x3F */
234 };
235 
236 #if defined(SPANDSP_USE_FIXED_POINTx)
237 static const complexi16_t v17_v32bis_9600_constellation[32] =
238 #else
239 static const complexf_t v17_v32bis_9600_constellation[32] =
240 #endif
241 {
242  {-8, 2}, /* 0x00 */
243  {-6, -4}, /* 0x01 */
244  {-4, 6}, /* 0x02 */
245  { 2, 8}, /* 0x03 */
246  { 8, -2}, /* 0x04 */
247  { 6, 4}, /* 0x05 */
248  { 4, -6}, /* 0x06 */
249  {-2, -8}, /* 0x07 */
250  { 0, 2}, /* 0x08 */
251  {-6, 4}, /* 0x09 */
252  { 4, 6}, /* 0x0A */
253  { 2, 0}, /* 0x0B */
254  { 0, -2}, /* 0x0C */
255  { 6, -4}, /* 0x0D */
256  {-4, -6}, /* 0x0E */
257  {-2, 0}, /* 0x0F */
258  { 0, -6}, /* 0x10 */
259  { 2, -4}, /* 0x11 */
260  {-4, -2}, /* 0x12 */
261  {-6, 0}, /* 0x13 */
262  { 0, 6}, /* 0x14 */
263  {-2, 4}, /* 0x15 */
264  { 4, 2}, /* 0x16 */
265  { 6, 0}, /* 0x17 */
266  { 8, 2}, /* 0x18 */
267  { 2, 4}, /* 0x19 */
268  { 4, -2}, /* 0x1A */
269  { 2, -8}, /* 0x1B */
270  {-8, -2}, /* 0x1C */
271  {-2, -4}, /* 0x1D */
272  {-4, 2}, /* 0x1E */
273  {-2, 8} /* 0x1F */
274 };
275 
276 #if defined(SPANDSP_USE_FIXED_POINTx)
277 static const complexi16_t v17_v32bis_7200_constellation[16] =
278 #else
279 static const complexf_t v17_v32bis_7200_constellation[16] =
280 #endif
281 {
282  { 6, -6}, /* 0x00 */
283  {-2, 6}, /* 0x01 */
284  { 6, 2}, /* 0x02 */
285  {-6, -6}, /* 0x03 */
286  {-6, 6}, /* 0x04 */
287  { 2, -6}, /* 0x05 */
288  {-6, -2}, /* 0x06 */
289  { 6, 6}, /* 0x07 */
290  {-2, 2}, /* 0x08 */
291  { 6, -2}, /* 0x09 */
292  {-2, -6}, /* 0x0A */
293  { 2, 2}, /* 0x0B */
294  { 2, -2}, /* 0x0C */
295  {-6, 2}, /* 0x0D */
296  { 2, 6}, /* 0x0E */
297  {-2, -2} /* 0x0F */
298 };
299 
300 /* This one does not exist in V.17 as a data constellation. It is only
301  the equaliser training constellation. In V.32/V.32bis it is a data mode. */
302 #if defined(SPANDSP_USE_FIXED_POINTx)
303 static const complexi16_t v17_v32bis_4800_constellation[4] =
304 #else
305 static const complexf_t v17_v32bis_4800_constellation[4] =
306 #endif
307 {
308  {-6, -2}, /* 0x00 */
309  {-2, 6}, /* 0x01 */
310  { 2, -6}, /* 0x02 */
311  { 6, 2} /* 0x03 */
312 };
313 
314 #if defined(SPANDSP_USE_FIXED_POINTx)
315 static const complexi16_t v17_v32bis_abcd_constellation[4] =
316 #else
317 static const complexf_t v17_v32bis_abcd_constellation[4] =
318 #endif
319 {
320  {-6, -2}, /* A */
321  { 2, -6}, /* B */
322  { 6, 2}, /* C */
323  {-2, 6} /* D */
324 };
325 
326 /*- End of file ------------------------------------------------------------*/