spandsp: v29tx_constellation_maps.h Source File

spandsp 0.0.6

v29tx_constellation_maps.h
1/*
2 * SpanDSP - a series of DSP components for telephony
3 *
4 * v29tx_constellation_maps.h - ITU V.29 modem transmit part.
5 * Constellation mapping.
6 *
7 * Written by Steve Underwood <steveu@coppice.org>
8 *
9 * Copyright (C) 2008 Steve Underwood
10 *
11 * All rights reserved.
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU Lesser General Public License version 2.1,
15 * as published by the Free Software Foundation.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU Lesser General Public License for more details.
21 *
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this program; if not, write to the Free Software
24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 */
26
27#if !defined(FP_SCALE)
28#if defined(SPANDSP_USE_FIXED_POINT)
29#define FP_SCALE(x) ((int16_t) x)
30#else
31#define FP_SCALE(x) (x)
32#endif
33#endif
34
35#if defined(SPANDSP_USE_FIXED_POINT)
36static const complexi16_t v29_abab_constellation[6] =
37#else
38static const complexf_t v29_abab_constellation[6] =
39#endif
40{
41 {FP_SCALE( 3.0f), FP_SCALE(-3.0f)}, /* 315deg high 9600 */
42 {FP_SCALE(-3.0f), FP_SCALE( 0.0f)}, /* 180deg low */
43 {FP_SCALE( 1.0f), FP_SCALE(-1.0f)}, /* 315deg low 7200 */
44 {FP_SCALE(-3.0f), FP_SCALE( 0.0f)}, /* 180deg low */
45 {FP_SCALE( 0.0f), FP_SCALE(-3.0f)}, /* 270deg low 4800 */
46 {FP_SCALE(-3.0f), FP_SCALE( 0.0f)} /* 180deg low */
47};
48
49#if defined(SPANDSP_USE_FIXED_POINT)
50static const complexi16_t v29_cdcd_constellation[6] =
51#else
52static const complexf_t v29_cdcd_constellation[6] =
53#endif
54{
55 {FP_SCALE( 3.0f), FP_SCALE( 0.0f)}, /* 0deg low 9600 */
56 {FP_SCALE(-3.0f), FP_SCALE( 3.0f)}, /* 135deg high */
57 {FP_SCALE( 3.0f), FP_SCALE( 0.0f)}, /* 0deg low 7200 */
58 {FP_SCALE(-1.0f), FP_SCALE( 1.0f)}, /* 135deg low */
59 {FP_SCALE( 3.0f), FP_SCALE( 0.0f)}, /* 0deg low 4800 */
60 {FP_SCALE( 0.0f), FP_SCALE( 3.0f)} /* 90deg low */
61};
62
63#if defined(SPANDSP_USE_FIXED_POINT)
64static const complexi16_t v29_9600_constellation[16] =
65#else
66static const complexf_t v29_9600_constellation[16] =
67#endif
68{
69 {FP_SCALE( 3.0f), FP_SCALE( 0.0f)}, /* 0deg low */
70 {FP_SCALE( 1.0f), FP_SCALE( 1.0f)}, /* 45deg low */
71 {FP_SCALE( 0.0f), FP_SCALE( 3.0f)}, /* 90deg low */
72 {FP_SCALE(-1.0f), FP_SCALE( 1.0f)}, /* 135deg low */
73 {FP_SCALE(-3.0f), FP_SCALE( 0.0f)}, /* 180deg low */
74 {FP_SCALE(-1.0f), FP_SCALE(-1.0f)}, /* 225deg low */
75 {FP_SCALE( 0.0f), FP_SCALE(-3.0f)}, /* 270deg low */
76 {FP_SCALE( 1.0f), FP_SCALE(-1.0f)}, /* 315deg low */
77 {FP_SCALE( 5.0f), FP_SCALE( 0.0f)}, /* 0deg high */
78 {FP_SCALE( 3.0f), FP_SCALE( 3.0f)}, /* 45deg high */
79 {FP_SCALE( 0.0f), FP_SCALE( 5.0f)}, /* 90deg high */
80 {FP_SCALE(-3.0f), FP_SCALE( 3.0f)}, /* 135deg high */
81 {FP_SCALE(-5.0f), FP_SCALE( 0.0f)}, /* 180deg high */
82 {FP_SCALE(-3.0f), FP_SCALE(-3.0f)}, /* 225deg high */
83 {FP_SCALE( 0.0f), FP_SCALE(-5.0f)}, /* 270deg high */
84 {FP_SCALE( 3.0f), FP_SCALE(-3.0f)} /* 315deg high */
85};
86
87/*- End of file ------------------------------------------------------------*/
complexf_t
Definition complex.h:43
complexi16_t
Definition complex.h:89