From 6af84a870c21836e20077f27a85d94fd382a02be Mon Sep 17 00:00:00 2001 From: Steve Underwood Date: Sat, 16 Mar 2013 15:35:39 +0800 Subject: [PATCH] Cleanup of modem filters --- libs/spandsp/src/Makefile.am | 110 ++-- libs/spandsp/src/async.c | 53 +- libs/spandsp/src/libspandsp.2005.vcproj | 31 +- libs/spandsp/src/libspandsp.2008.vcproj | 27 +- libs/spandsp/src/make_modem_filter.c | 206 +++---- libs/spandsp/src/spandsp/private/async.h | 2 + libs/spandsp/src/t30.c | 2 +- libs/spandsp/src/t30_api.c | 2 + libs/spandsp/src/t4_rx.c | 66 ++- .../src/v17_v32bis_tx_constellation_maps.h | 501 +++++++++--------- libs/spandsp/src/v17rx.c | 7 +- libs/spandsp/src/v17tx.c | 36 +- libs/spandsp/src/v22bis_rx.c | 7 +- libs/spandsp/src/v22bis_tx.c | 4 +- libs/spandsp/src/v27ter_rx.c | 64 +-- libs/spandsp/src/v27ter_tx.c | 7 +- libs/spandsp/src/v29rx.c | 16 +- libs/spandsp/src/v29tx.c | 11 +- libs/spandsp/src/v29tx_constellation_maps.h | 66 +-- libs/spandsp/tests/regression_tests.sh | 9 + 20 files changed, 606 insertions(+), 621 deletions(-) diff --git a/libs/spandsp/src/Makefile.am b/libs/spandsp/src/Makefile.am index 95e9932c3c..aad3b91dd7 100644 --- a/libs/spandsp/src/Makefile.am +++ b/libs/spandsp/src/Makefile.am @@ -391,133 +391,89 @@ t42.lo: cielab_luts.h cielab_luts.h: make_cielab_luts$(EXEEXT) ./make_cielab_luts$(EXEEXT) >cielab_luts.h -V17_V32BIS_RX_INCL = v17_v32bis_rx_fixed_rrc.h \ - v17_v32bis_rx_floating_rrc.h +V17_V32BIS_RX_INCL = v17_v32bis_rx_rrc.h v17rx.$(OBJEXT): ${V17_V32BIS_RX_INCL} v17rx.lo: ${V17_V32BIS_RX_INCL} -v17_v32bis_rx_fixed_rrc.h: make_modem_filter$(EXEEXT) - ./make_modem_filter$(EXEEXT) -m V.17 -i -r >v17_v32bis_rx_fixed_rrc.h +v17_v32bis_rx_rrc.h: make_modem_filter$(EXEEXT) + ./make_modem_filter$(EXEEXT) -m V.17 -r >v17_v32bis_rx_rrc.h -v17_v32bis_rx_floating_rrc.h: make_modem_filter$(EXEEXT) - ./make_modem_filter$(EXEEXT) -m V.17 -r >v17_v32bis_rx_floating_rrc.h - -V17_V32BIS_TX_INCL = v17_v32bis_tx_fixed_rrc.h \ - v17_v32bis_tx_floating_rrc.h +V17_V32BIS_TX_INCL = v17_v32bis_tx_rrc.h v17tx.$(OBJEXT): ${V17_V32BIS_TX_INCL} v17tx.lo: ${V17_V32BIS_TX_INCL} -v17_v32bis_tx_fixed_rrc.h: make_modem_filter$(EXEEXT) - ./make_modem_filter$(EXEEXT) -m V.17 -i -t >v17_v32bis_tx_fixed_rrc.h +v17_v32bis_tx_rrc.h: make_modem_filter$(EXEEXT) + ./make_modem_filter$(EXEEXT) -m V.17 -t >v17_v32bis_tx_rrc.h -v17_v32bis_tx_floating_rrc.h: make_modem_filter$(EXEEXT) - ./make_modem_filter$(EXEEXT) -m V.17 -t >v17_v32bis_tx_floating_rrc.h - -V22BIS_RX_INCL = v22bis_rx_1200_fixed_rrc.h \ - v22bis_rx_2400_fixed_rrc.h \ - v22bis_rx_1200_floating_rrc.h \ - v22bis_rx_2400_floating_rrc.h +V22BIS_RX_INCL = v22bis_rx_1200_rrc.h \ + v22bis_rx_2400_rrc.h v22bis_rx.$(OBJEXT): ${V22BIS_RX_INCL} v22bis_rx.lo: ${V22BIS_RX_INCL} -v22bis_rx_1200_fixed_rrc.h: make_modem_filter$(EXEEXT) - ./make_modem_filter$(EXEEXT) -m V.22bis1200 -i -r >v22bis_rx_1200_fixed_rrc.h +v22bis_rx_1200_rrc.h: make_modem_filter$(EXEEXT) + ./make_modem_filter$(EXEEXT) -m V.22bis1200 -r >v22bis_rx_1200_rrc.h -v22bis_rx_2400_fixed_rrc.h: make_modem_filter$(EXEEXT) - ./make_modem_filter$(EXEEXT) -m V.22bis2400 -i -r >v22bis_rx_2400_fixed_rrc.h +v22bis_rx_2400_rrc.h: make_modem_filter$(EXEEXT) + ./make_modem_filter$(EXEEXT) -m V.22bis2400 -r >v22bis_rx_2400_rrc.h -v22bis_rx_1200_floating_rrc.h: make_modem_filter$(EXEEXT) - ./make_modem_filter$(EXEEXT) -m V.22bis1200 -r >v22bis_rx_1200_floating_rrc.h - -v22bis_rx_2400_floating_rrc.h: make_modem_filter$(EXEEXT) - ./make_modem_filter$(EXEEXT) -m V.22bis2400 -r >v22bis_rx_2400_floating_rrc.h - -V22BIS_TX_INCL = v22bis_tx_fixed_rrc.h \ - v22bis_tx_floating_rrc.h +V22BIS_TX_INCL = v22bis_tx_rrc.h v22bis_tx.$(OBJEXT): ${V22BIS_TX_INCL} v22bis_tx.lo: ${V22BIS_TX_INCL} -v22bis_tx_fixed_rrc.h: make_modem_filter$(EXEEXT) - ./make_modem_filter$(EXEEXT) -m V.22bis -i -t >v22bis_tx_fixed_rrc.h +v22bis_tx_rrc.h: make_modem_filter$(EXEEXT) + ./make_modem_filter$(EXEEXT) -m V.22bis -t >v22bis_tx_rrc.h -v22bis_tx_floating_rrc.h: make_modem_filter$(EXEEXT) - ./make_modem_filter$(EXEEXT) -m V.22bis -t >v22bis_tx_floating_rrc.h - -V27_RX_INCL = v27ter_rx_2400_fixed_rrc.h \ - v27ter_rx_4800_fixed_rrc.h \ - v27ter_rx_2400_floating_rrc.h \ - v27ter_rx_4800_floating_rrc.h +V27_RX_INCL = v27ter_rx_2400_rrc.h \ + v27ter_rx_4800_rrc.h v27ter_rx.$(OBJEXT): ${V27_RX_INCL} v27ter_rx.lo: ${V27_RX_INCL} -v27ter_rx_2400_fixed_rrc.h: make_modem_filter$(EXEEXT) - ./make_modem_filter$(EXEEXT) -m V.27ter2400 -i -r >v27ter_rx_2400_fixed_rrc.h +v27ter_rx_2400_rrc.h: make_modem_filter$(EXEEXT) + ./make_modem_filter$(EXEEXT) -m V.27ter2400 -r >v27ter_rx_2400_rrc.h -v27ter_rx_4800_fixed_rrc.h: make_modem_filter$(EXEEXT) - ./make_modem_filter$(EXEEXT) -m V.27ter4800 -i -r >v27ter_rx_4800_fixed_rrc.h +v27ter_rx_4800_rrc.h: make_modem_filter$(EXEEXT) + ./make_modem_filter$(EXEEXT) -m V.27ter4800 -r >v27ter_rx_4800_rrc.h -v27ter_rx_2400_floating_rrc.h: make_modem_filter$(EXEEXT) - ./make_modem_filter$(EXEEXT) -m V.27ter2400 -r >v27ter_rx_2400_floating_rrc.h - -v27ter_rx_4800_floating_rrc.h: make_modem_filter$(EXEEXT) - ./make_modem_filter$(EXEEXT) -m V.27ter4800 -r >v27ter_rx_4800_floating_rrc.h - -V27TER_TX_INCL = v27ter_tx_2400_fixed_rrc.h \ - v27ter_tx_4800_fixed_rrc.h \ - v27ter_tx_2400_floating_rrc.h \ - v27ter_tx_4800_floating_rrc.h +V27TER_TX_INCL = v27ter_tx_2400_rrc.h \ + v27ter_tx_4800_rrc.h v27ter_tx_.$(OBJEXT): ${V27TER_TX_INCL} v27ter_tx.lo: ${V27TER_TX_INCL} -v27ter_tx_2400_fixed_rrc.h: make_modem_filter$(EXEEXT) - ./make_modem_filter$(EXEEXT) -m V.27ter2400 -i -t >v27ter_tx_2400_fixed_rrc.h +v27ter_tx_2400_rrc.h: make_modem_filter$(EXEEXT) + ./make_modem_filter$(EXEEXT) -m V.27ter2400 -t >v27ter_tx_2400_rrc.h -v27ter_tx_4800_fixed_rrc.h: make_modem_filter$(EXEEXT) - ./make_modem_filter$(EXEEXT) -m V.27ter4800 -i -t >v27ter_tx_4800_fixed_rrc.h +v27ter_tx_4800_rrc.h: make_modem_filter$(EXEEXT) + ./make_modem_filter$(EXEEXT) -m V.27ter4800 -t >v27ter_tx_4800_rrc.h -v27ter_tx_2400_floating_rrc.h: make_modem_filter$(EXEEXT) - ./make_modem_filter$(EXEEXT) -m V.27ter2400 -t >v27ter_tx_2400_floating_rrc.h - -v27ter_tx_4800_floating_rrc.h: make_modem_filter$(EXEEXT) - ./make_modem_filter$(EXEEXT) -m V.27ter4800 -t >v27ter_tx_4800_floating_rrc.h - -V29_RX_INCL = v29rx_fixed_rrc.h \ - v29rx_floating_rrc.h +V29_RX_INCL = v29rx_rrc.h v29rx.$(OBJEXT): ${V29_RX_INCL} v29rx.lo: ${V29_RX_INCL} -v29rx_fixed_rrc.h: make_modem_filter$(EXEEXT) - ./make_modem_filter$(EXEEXT) -m V.29 -i -r >v29rx_fixed_rrc.h +v29rx_rrc.h: make_modem_filter$(EXEEXT) + ./make_modem_filter$(EXEEXT) -m V.29 -r >v29rx_rrc.h -v29rx_floating_rrc.h: make_modem_filter$(EXEEXT) - ./make_modem_filter$(EXEEXT) -m V.29 -r >v29rx_floating_rrc.h - -V29_TX_INCL = v29tx_fixed_rrc.h \ - v29tx_floating_rrc.h +V29_TX_INCL = v29tx_rrc.h v29tx.$(OBJEXT): ${V29_TX_INCL} v29tx.lo: ${V29_TX_INCL} -v29tx_fixed_rrc.h: make_modem_filter$(EXEEXT) - ./make_modem_filter$(EXEEXT) -m V.29 -i -t >v29tx_fixed_rrc.h - -v29tx_floating_rrc.h: make_modem_filter$(EXEEXT) - ./make_modem_filter$(EXEEXT) -m V.29 -t >v29tx_floating_rrc.h +v29tx_rrc.h: make_modem_filter$(EXEEXT) + ./make_modem_filter$(EXEEXT) -m V.29 -t >v29tx_rrc.h DSP = libspandsp.dsp VCPROJ8 = libspandsp.2005.vcproj diff --git a/libs/spandsp/src/async.c b/libs/spandsp/src/async.c index 4df12dffb6..fb381bb7bc 100644 --- a/libs/spandsp/src/async.c +++ b/libs/spandsp/src/async.c @@ -212,42 +212,46 @@ SPAN_DECLARE_NONSTD(int) async_tx_get_bit(void *user_data) { async_tx_state_t *s; int bit; + int parity_bit; s = (async_tx_state_t *) user_data; if (s->bitpos == 0) { + if (s->presend_bits > 0) + { + s->presend_bits--; + return 1; + } if ((s->byte_in_progress = s->get_byte(s->user_data)) < 0) { - /* No more data */ - bit = SIG_STATUS_END_OF_DATA; + if (s->byte_in_progress != SIG_STATUS_LINK_IDLE) + return s->byte_in_progress; + /* Idle for a bit time. If the get byte call configured a presend + time we might idle for longer. */ + return 1; + } + s->byte_in_progress &= (0xFFFF >> (16 - s->data_bits)); + if (s->parity != ASYNC_PARITY_NONE) + { + parity_bit = parity8(s->byte_in_progress); + if (s->parity == ASYNC_PARITY_ODD) + parity_bit ^= 1; + s->byte_in_progress |= (parity_bit << s->data_bits); + s->byte_in_progress |= (0xFFFF << (s->data_bits + 1)); } else { - /* Start bit */ - bit = 0; - s->parity_bit = 0; - s->bitpos++; + s->byte_in_progress |= (0xFFFF << s->data_bits); } - } - else if (s->bitpos <= s->data_bits) - { - bit = s->byte_in_progress & 1; - s->byte_in_progress >>= 1; - s->parity_bit ^= bit; - s->bitpos++; - } - else if (s->parity && s->bitpos == s->data_bits + 1) - { - if (s->parity == ASYNC_PARITY_ODD) - s->parity_bit ^= 1; - bit = s->parity_bit; + /* Start bit */ + bit = 0; s->bitpos++; } else { - /* Stop bit(s) */ - bit = 1; - if (++s->bitpos > s->data_bits + s->stop_bits) + bit = s->byte_in_progress & 1; + s->byte_in_progress >>= 1; + if (++s->bitpos > s->total_bits) s->bitpos = 0; } return bit; @@ -278,16 +282,15 @@ SPAN_DECLARE(async_tx_state_t *) async_tx_init(async_tx_state_t *s, flow control does not exist, so V.14 stuffing is not needed. */ s->data_bits = data_bits; s->parity = parity; - s->stop_bits = stop_bits; + s->total_bits = data_bits + stop_bits; if (parity != ASYNC_PARITY_NONE) - s->stop_bits++; + s->total_bits++; s->get_byte = get_byte; s->user_data = user_data; s->byte_in_progress = 0; s->bitpos = 0; - s->parity_bit = 0; s->presend_bits = 0; return s; } diff --git a/libs/spandsp/src/libspandsp.2005.vcproj b/libs/spandsp/src/libspandsp.2005.vcproj index 4ed3af322a..a89a59b23d 100644 --- a/libs/spandsp/src/libspandsp.2005.vcproj +++ b/libs/spandsp/src/libspandsp.2005.vcproj @@ -92,6 +92,7 @@ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" > + @@ -123,12 +124,14 @@ + + @@ -143,6 +146,8 @@ + + @@ -154,8 +159,13 @@ + + + + + @@ -174,6 +184,7 @@ + @@ -205,8 +216,10 @@ + + @@ -222,8 +235,6 @@ - - @@ -234,8 +245,16 @@ + + + + + + + + @@ -253,6 +272,7 @@ + @@ -271,6 +291,7 @@ + @@ -293,7 +314,13 @@ + + + + + + diff --git a/libs/spandsp/src/libspandsp.2008.vcproj b/libs/spandsp/src/libspandsp.2008.vcproj index bd4e236b17..96af303167 100644 --- a/libs/spandsp/src/libspandsp.2008.vcproj +++ b/libs/spandsp/src/libspandsp.2008.vcproj @@ -342,6 +342,10 @@ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" > + + @@ -702,18 +706,15 @@ - - - + + @@ -842,6 +843,10 @@ RelativePath="spandsp/ima_adpcm.h" > + + @@ -878,6 +883,10 @@ RelativePath="spandsp/power_meter.h" > + + @@ -950,6 +959,10 @@ RelativePath="spandsp/private/ima_adpcm.h" > + + diff --git a/libs/spandsp/src/make_modem_filter.c b/libs/spandsp/src/make_modem_filter.c index 593f894cbf..8ceac8aab9 100644 --- a/libs/spandsp/src/make_modem_filter.c +++ b/libs/spandsp/src/make_modem_filter.c @@ -66,7 +66,6 @@ static void make_tx_filter(int coeff_sets, double carrier, double baud_rate, double excess_bandwidth, - int fixed_point, const char *tag) { int i; @@ -75,8 +74,9 @@ static void make_tx_filter(int coeff_sets, int total_coeffs; double alpha; double beta; - double gain; - double scaling; + double floating_gain; + double fixed_gain; + double fixed_scaling; double peak; double coeffs[MAX_COEFF_SETS*MAX_COEFFS_PER_FILTER + 1]; @@ -87,63 +87,63 @@ static void make_tx_filter(int coeff_sets, compute_raised_cosine_filter(coeffs, total_coeffs, TRUE, FALSE, alpha, beta); /* Find the DC gain of the filter, and adjust the filter to unity gain. */ - gain = 0.0; + floating_gain = 0.0; for (i = coeff_sets/2; i < total_coeffs; i += coeff_sets) - gain += coeffs[i]; + floating_gain += coeffs[i]; /* Normalise the gain to 1.0 */ for (i = 0; i < total_coeffs; i++) - coeffs[i] /= gain; - gain = 1.0; + coeffs[i] /= floating_gain; + floating_gain = 1.0; + fixed_gain = 1.0; - if (fixed_point) + peak = -1.0; + for (i = 0; i < total_coeffs; i++) { - peak = -1.0; - for (i = 0; i < total_coeffs; i++) - { - if (fabs(coeffs[i]) > peak) - peak = fabs(coeffs[i]); - } - scaling = 32767.0; - if (peak >= 1.0) - { - scaling /= peak; - gain = 1.0/peak; - } - for (i = 0; i < total_coeffs; i++) - coeffs[i] *= scaling; + if (fabs(coeffs[i]) > peak) + peak = fabs(coeffs[i]); + } + fixed_scaling = 32767.0f; + if (peak >= 1.0) + { + fixed_scaling /= peak; + fixed_gain = 1.0/peak; } /* Churn out the data as a C source code header file, which can be directly included by the modem code. */ - printf("#define TX_PULSESHAPER%s_GAIN %ff\n", tag, gain); + printf("#if defined(SPANDSP_USE_FIXED_POINT)\n"); + printf("#define TX_PULSESHAPER%s_SCALE(x) ((int16_t) (%f*x + ((x >= 0.0) ? 0.5 : -0.5)))\n", tag, fixed_scaling); + printf("#define TX_PULSESHAPER%s_GAIN %ff\n", tag, fixed_gain); + printf("#else\n"); + printf("#define TX_PULSESHAPER%s_SCALE(x) (x)\n", tag); + printf("#define TX_PULSESHAPER%s_GAIN %ff\n", tag, floating_gain); + printf("#endif\n"); printf("#define TX_PULSESHAPER%s_COEFF_SETS %d\n", tag, coeff_sets); - printf("static const %s tx_pulseshaper%s[TX_PULSESHAPER%s_COEFF_SETS][%d] =\n", - (fixed_point) ? "int16_t" : "float", + printf("\n"); + printf("#if defined(SPANDSP_USE_FIXED_POINT)\n"); + printf("static const int16_t tx_pulseshaper%s[TX_PULSESHAPER%s_COEFF_SETS][%d] =\n", tag, tag, coeffs_per_filter); + printf("#else\n"); + printf("static const float tx_pulseshaper%s[TX_PULSESHAPER%s_COEFF_SETS][%d] =\n", + tag, + tag, + coeffs_per_filter); + printf("#endif\n"); printf("{\n"); for (j = 0; j < coeff_sets; j++) { x = j; printf(" {\n"); - if (fixed_point) - printf(" %8d, /* Filter %d */\n", (int) coeffs[x], j); - else - printf(" %15.10ff, /* Filter %d */\n", coeffs[x], j); + printf(" TX_PULSESHAPER%s_SCALE(%15.10ff), /* Filter %d */\n", tag, coeffs[x], j); for (i = 1; i < coeffs_per_filter - 1; i++) { x = i*coeff_sets + j; - if (fixed_point) - printf(" %8d,\n", (int) coeffs[x]); - else - printf(" %15.10ff,\n", coeffs[x]); + printf(" TX_PULSESHAPER%s_SCALE(%15.10ff),\n", tag, coeffs[x]); } x = i*coeff_sets + j; - if (fixed_point) - printf(" %8d\n", (int) coeffs[x]); - else - printf(" %15.10ff\n", coeffs[x]); + printf(" TX_PULSESHAPER%s_SCALE(%15.10ff)\n", tag, coeffs[x]); if (j < coeff_sets - 1) printf(" },\n"); else @@ -158,7 +158,6 @@ static void make_rx_filter(int coeff_sets, double carrier, double baud_rate, double excess_bandwidth, - int fixed_point, const char *tag) { int i; @@ -169,14 +168,12 @@ static void make_rx_filter(int coeff_sets, int total_coeffs; double alpha; double beta; - double gain; + double floating_gain; + double fixed_gain; + double fixed_scaling; double peak; double coeffs[MAX_COEFF_SETS*MAX_COEFFS_PER_FILTER + 1]; -#if 0 - complex_t co[MAX_COEFFS_PER_FILTER]; -#else double cox[MAX_COEFFS_PER_FILTER]; -#endif total_coeffs = coeff_sets*coeffs_per_filter + 1; alpha = baud_rate/(2.0*(double) (coeff_sets*SAMPLE_RATE)); @@ -186,84 +183,54 @@ static void make_rx_filter(int coeff_sets, compute_raised_cosine_filter(coeffs, total_coeffs, TRUE, FALSE, alpha, beta); /* Find the DC gain of the filter, and adjust the filter to unity gain. */ - gain = 0.0; + floating_gain = 0.0; for (i = coeff_sets/2; i < total_coeffs; i += coeff_sets) - gain += coeffs[i]; + floating_gain += coeffs[i]; /* Normalise the gain to 1.0 */ for (i = 0; i < total_coeffs; i++) - coeffs[i] /= gain; - gain = 1.0; + coeffs[i] /= floating_gain; + floating_gain = 1.0; + fixed_gain = 1.0; - if (fixed_point) + peak = -1.0; + for (i = 0; i < total_coeffs; i++) { - peak = -1.0; - for (i = 0; i < total_coeffs; i++) - { - if (fabs(coeffs[i]) > peak) - peak = fabs(coeffs[i]); - } - gain = 32767.0; - if (peak >= 1.0) - gain /= peak; - for (i = 0; i < total_coeffs; i++) - coeffs[i] *= gain; + if (fabs(coeffs[i]) > peak) + peak = fabs(coeffs[i]); + } + fixed_scaling = 32767.0f; + if (peak >= 1.0) + { + fixed_scaling /= peak; + fixed_gain = 1.0/peak; } /* Churn out the data as a C source code header file, which can be directly included by the modem code. */ - printf("#define RX_PULSESHAPER%s_GAIN %ff\n", tag, gain); + printf("#if defined(SPANDSP_USE_FIXED_POINT)\n"); + printf("#define RX_PULSESHAPER%s_SCALE(x) ((int16_t) (%f*x + ((x >= 0.0) ? 0.5 : -0.5)))\n", tag, fixed_scaling); + printf("#define RX_PULSESHAPER%s_GAIN %ff\n", tag, fixed_gain); + printf("#else\n"); + printf("#define RX_PULSESHAPER%s_SCALE(x) (x)\n", tag); + printf("#define RX_PULSESHAPER%s_GAIN %ff\n", tag, floating_gain); + printf("#endif\n"); printf("#define RX_PULSESHAPER%s_COEFF_SETS %d\n", tag, coeff_sets); -#if 0 - printf("static const %s rx_pulseshaper%s[RX_PULSESHAPER%s_COEFF_SETS][%d] =\n", - (fixed_point) ? "complexi16_t" : "complexf_t", - tag, - tag, - coeffs_per_filter); - printf("{\n"); - for (j = 0; j < coeff_sets; j++) - { - /* Complex modulate the filter, to make it a complex pulse shaping bandpass filter - centred at the nominal carrier frequency. Use the same phase for all the coefficient - sets. This means the modem can step the carrier in whole samples, and not worry about - the fractional sample shift caused by selecting amongst the various coefficient sets. */ - for (i = 0; i < coeffs_per_filter; i++) - { - m = i - (coeffs_per_filter >> 1); - x = i*coeff_sets + j; - co[i].re = coeffs[x]*cos(carrier*m); - co[i].im = coeffs[x]*sin(carrier*m); - } - printf(" {\n"); - if (fixed_point) - printf(" {%8d, %8d}, /* Filter %d */\n", (int) co[i].re, (int) co[i].im, j); - else - printf(" {%15.10ff, %15.10ff}, /* Filter %d */\n", co[0].re, co[0].im, j); - for (i = 1; i < coeffs_per_filter - 1; i++) - { - if (fixed_point) - printf(" {%8d, %8d},\n", (int) co[i].re, (int) co[i].im); - else - printf(" {%15.10ff, %15.10ff},\n", co[i].re, co[i].im); - } - if (fixed_point) - printf(" {%8d, %8d}\n", (int) co[i].re, (int) co[i].im); - else - printf(" {%15.10ff, %15.10ff}\n", co[i].re, co[i].im); - if (j < coeff_sets - 1) - printf(" },\n"); - else - printf(" }\n"); - } - printf("};\n"); -#else for (k = 0; k < 2; k++) { - printf("static const %s rx_pulseshaper%s_%s[RX_PULSESHAPER%s_COEFF_SETS][%d] =\n", - (fixed_point) ? "int16_t" : "float", + printf("\n"); + printf("#if defined(SPANDSP_USE_FIXED_POINT)\n"); + printf("static const int16_t rx_pulseshaper%s_%s[RX_PULSESHAPER%s_COEFF_SETS][%d] =\n", tag, (k == 0) ? "re" : "im", tag, coeffs_per_filter); + printf("#else\n"); + printf("static const float rx_pulseshaper%s_%s[RX_PULSESHAPER%s_COEFF_SETS][%d] =\n", + tag, + (k == 0) ? "re" : "im", + tag, + coeffs_per_filter); + printf("#endif\n"); printf("{\n"); for (j = 0; j < coeff_sets; j++) { @@ -281,21 +248,10 @@ static void make_rx_filter(int coeff_sets, cox[i] = coeffs[x]*sin(carrier*m); } printf(" {\n"); - if (fixed_point) - printf(" %8d, /* Filter %d */\n", (int) cox[0], j); - else - printf(" %15.10ff, /* Filter %d */\n", cox[0], j); + printf(" RX_PULSESHAPER%s_SCALE(%15.10ff), /* Filter %d */\n", tag, cox[0], j); for (i = 1; i < coeffs_per_filter - 1; i++) - { - if (fixed_point) - printf(" %8d,\n", (int) cox[i]); - else - printf(" %15.10ff,\n", cox[i]); - } - if (fixed_point) - printf(" %8d\n", (int) cox[i]); - else - printf(" %15.10ff\n", cox[i]); + printf(" RX_PULSESHAPER%s_SCALE(%15.10ff),\n", tag, cox[i]); + printf(" RX_PULSESHAPER%s_SCALE(%15.10ff)\n", tag, cox[i]); if (j < coeff_sets - 1) printf(" },\n"); else @@ -303,13 +259,12 @@ static void make_rx_filter(int coeff_sets, } printf("};\n"); } -#endif } /*- End of function --------------------------------------------------------*/ static void usage(void) { - fprintf(stderr, "Usage: make_modem_rx_filter -m [-i] [-r] [-t]\n"); + fprintf(stderr, "Usage: make_modem_rx_filter -m [-r] [-t]\n"); } /*- End of function --------------------------------------------------------*/ @@ -321,7 +276,6 @@ int main(int argc, char **argv) int tx_coeffs_per_filter; int opt; int transmit_modem; - int fixed_point; double carrier; double baud_rate; double rx_excess_bandwidth; @@ -330,16 +284,12 @@ int main(int argc, char **argv) const char *tx_tag; const char *modem; - fixed_point = FALSE; transmit_modem = FALSE; modem = ""; - while ((opt = getopt(argc, argv, "im:rt")) != -1) + while ((opt = getopt(argc, argv, "m:rt")) != -1) { switch (opt) { - case 'i': - fixed_point = TRUE; - break; case 'm': modem = optarg; break; @@ -607,7 +557,6 @@ int main(int argc, char **argv) carrier, baud_rate, tx_excess_bandwidth, - fixed_point, tx_tag); } else @@ -617,7 +566,6 @@ int main(int argc, char **argv) carrier, baud_rate, rx_excess_bandwidth, - fixed_point, rx_tag); } return 0; diff --git a/libs/spandsp/src/spandsp/private/async.h b/libs/spandsp/src/spandsp/private/async.h index 7354aaf967..39bb1d4a44 100644 --- a/libs/spandsp/src/spandsp/private/async.h +++ b/libs/spandsp/src/spandsp/private/async.h @@ -39,6 +39,8 @@ struct async_tx_state_s int parity; /*! \brief The number of stop bits per character. */ int stop_bits; + /*! \brief Total number of bits per character, including the parity and stop bits. */ + int total_bits; /*! \brief A pointer to the callback routine used to get characters to be transmitted. */ get_byte_func_t get_byte; /*! \brief An opaque pointer passed when calling get_byte. */ diff --git a/libs/spandsp/src/t30.c b/libs/spandsp/src/t30.c index 7e9e4c333f..a8ed266f94 100644 --- a/libs/spandsp/src/t30.c +++ b/libs/spandsp/src/t30.c @@ -1538,7 +1538,7 @@ static int build_dcs(t30_state_t *s) || ((s->image_width == T4_WIDTH_1200_A4) && (s->x_resolution == T4_X_RESOLUTION_1200))) { - span_log(&s->logging, SPAN_LOG_FLOW, "Image width is A4 0x%x 0x%x\n", s->image_width, s->x_resolution); + span_log(&s->logging, SPAN_LOG_FLOW, "Image width is A4\n"); /* No width related bits need to be set. */ } else if (((s->image_width == T4_WIDTH_R8_B4) && (s->x_resolution == T4_X_RESOLUTION_R8)) diff --git a/libs/spandsp/src/t30_api.c b/libs/spandsp/src/t30_api.c index 495ba6f9b1..e6d157c21e 100644 --- a/libs/spandsp/src/t30_api.c +++ b/libs/spandsp/src/t30_api.c @@ -653,6 +653,8 @@ SPAN_DECLARE(int) t30_set_rx_encoding(t30_state_t *s, int encoding) case T4_COMPRESSION_ITU_T4_1D: case T4_COMPRESSION_ITU_T4_2D: case T4_COMPRESSION_ITU_T6: + //case T4_COMPRESSION_ITU_T85: + //case T4_COMPRESSION_ITU_T85_L0: s->output_encoding = encoding; return 0; } diff --git a/libs/spandsp/src/t4_rx.c b/libs/spandsp/src/t4_rx.c index eae361941b..0d6950e278 100644 --- a/libs/spandsp/src/t4_rx.c +++ b/libs/spandsp/src/t4_rx.c @@ -146,9 +146,16 @@ static int set_tiff_directory_info(t4_rx_state_t *s) t4_rx_tiff_state_t *t; int32_t output_compression; int32_t output_t4_options; + int bits_per_sample; + int samples_per_pixel; + int photometric; + int image_length; t = &s->tiff; /* Prepare the directory entry fully before writing the image, or libtiff complains */ + bits_per_sample = 1; + samples_per_pixel = 1; + photometric = PHOTOMETRIC_MINISWHITE; switch (t->output_encoding) { case T4_COMPRESSION_ITU_T4_1D: @@ -163,7 +170,24 @@ static int set_tiff_directory_info(t4_rx_state_t *s) case T4_COMPRESSION_ITU_T6: output_compression = COMPRESSION_CCITT_T6; break; +#if defined(SPANDSP_SUPPORT_T42) + case T4_COMPRESSION_ITU_T42: + output_compression = COMPRESSION_JPEG; + bits_per_sample = 8; + samples_per_pixel = 3; + photometric = PHOTOMETRIC_ITULAB; + break; +#endif +#if defined(SPANDSP_SUPPORT_T43) + case T4_COMPRESSION_ITU_T43: + output_compression = COMPRESSION_T43; + bits_per_sample = 8; + samples_per_pixel = 3; + photometric = PHOTOMETRIC_ITULAB; + break; +#endif case T4_COMPRESSION_ITU_T85: + case T4_COMPRESSION_ITU_T85_L0: output_compression = COMPRESSION_T85; break; } @@ -179,28 +203,23 @@ static int set_tiff_directory_info(t4_rx_state_t *s) TIFFSetField(t->tiff_file, TIFFTAG_T6OPTIONS, 0); TIFFSetField(t->tiff_file, TIFFTAG_FAXMODE, FAXMODE_CLASSF); break; + case COMPRESSION_JPEG: + TIFFSetField(t->tiff_file, TIFFTAG_FAXMODE, FAXMODE_CLASSF); + break; +#if defined(SPANDSP_SUPPORT_T43) + case COMPRESSION_T43: + TIFFSetField(t->tiff_file, TIFFTAG_FAXMODE, FAXMODE_CLASSF); + break; +#endif case COMPRESSION_T85: TIFFSetField(t->tiff_file, TIFFTAG_FAXMODE, FAXMODE_CLASSF); - TIFFSetField(t->tiff_file, TIFFTAG_ROWSPERSTRIP, -1L); - break; - default: - TIFFSetField(t->tiff_file, - TIFFTAG_ROWSPERSTRIP, - TIFFDefaultStripSize(t->tiff_file, 0)); break; } -#if defined(SPANDSP_SUPPORT_TIFF_FX) - TIFFSetField(t->tiff_file, TIFFTAG_PROFILETYPE, PROFILETYPE_G3_FAX); - TIFFSetField(t->tiff_file, TIFFTAG_FAXPROFILE, FAXPROFILE_F); - TIFFSetField(t->tiff_file, TIFFTAG_CODINGMETHODS, CODINGMETHODS_T4_1D | CODINGMETHODS_T4_2D | CODINGMETHODS_T6); - TIFFSetField(t->tiff_file, TIFFTAG_VERSIONYEAR, "1998"); - /* TIFFSetField(t->tiff_file, TIFFTAG_MODENUMBER, 0); */ -#endif - TIFFSetField(t->tiff_file, TIFFTAG_BITSPERSAMPLE, 1); TIFFSetField(t->tiff_file, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); - TIFFSetField(t->tiff_file, TIFFTAG_SAMPLESPERPIXEL, 1); + TIFFSetField(t->tiff_file, TIFFTAG_BITSPERSAMPLE, bits_per_sample); + TIFFSetField(t->tiff_file, TIFFTAG_SAMPLESPERPIXEL, samples_per_pixel); TIFFSetField(t->tiff_file, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); - TIFFSetField(t->tiff_file, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE); + TIFFSetField(t->tiff_file, TIFFTAG_PHOTOMETRIC, photometric); TIFFSetField(t->tiff_file, TIFFTAG_FILLORDER, FILLORDER_LSB2MSB); /* TIFFTAG_STRIPBYTECOUNTS and TIFFTAG_STRIPOFFSETS are added automatically */ @@ -257,6 +276,7 @@ static int set_tiff_directory_info(t4_rx_state_t *s) /* TIFF page numbers start from zero, so the number of pages in the file is always one greater than the highest page number in the file. */ s->tiff.pages_in_file = s->current_page + 1; + image_length = 0; switch (s->line_encoding) { case T4_COMPRESSION_ITU_T4_1D: @@ -277,22 +297,28 @@ static int set_tiff_directory_info(t4_rx_state_t *s) } /* Fall through */ case T4_COMPRESSION_ITU_T6: - TIFFSetField(t->tiff_file, TIFFTAG_IMAGELENGTH, t4_t6_decode_get_image_length(&s->decoder.t4_t6)); + image_length = t4_t6_decode_get_image_length(&s->decoder.t4_t6); break; case T4_COMPRESSION_ITU_T42: - TIFFSetField(t->tiff_file, TIFFTAG_IMAGELENGTH, t42_decode_get_image_length(&s->decoder.t42)); + image_length = t42_decode_get_image_length(&s->decoder.t42); break; #if defined(SPANDSP_SUPPORT_T43) case T4_COMPRESSION_ITU_T43: - TIFFSetField(t->tiff_file, TIFFTAG_IMAGELENGTH, t43_decode_get_image_length(&s->decoder.t43)); + image_length = t43_decode_get_image_length(&s->decoder.t43); break; #endif case T4_COMPRESSION_ITU_T85: case T4_COMPRESSION_ITU_T85_L0: - TIFFSetField(t->tiff_file, TIFFTAG_IMAGELENGTH, t85_decode_get_image_length(&s->decoder.t85)); + image_length = t85_decode_get_image_length(&s->decoder.t85); break; } + TIFFSetField(t->tiff_file, TIFFTAG_IMAGELENGTH, image_length); + TIFFSetField(t->tiff_file, TIFFTAG_ROWSPERSTRIP, image_length); #if defined(SPANDSP_SUPPORT_TIFF_FX) + TIFFSetField(t->tiff_file, TIFFTAG_PROFILETYPE, PROFILETYPE_G3_FAX); + TIFFSetField(t->tiff_file, TIFFTAG_FAXPROFILE, FAXPROFILE_S); + TIFFSetField(t->tiff_file, TIFFTAG_CODINGMETHODS, CODINGMETHODS_T4_1D | CODINGMETHODS_T4_2D | CODINGMETHODS_T6); + TIFFSetField(t->tiff_file, TIFFTAG_VERSIONYEAR, "1998"); if (s->current_page == 0) { /* Create a placeholder for the global parameters IFD, to be filled in later */ diff --git a/libs/spandsp/src/v17_v32bis_tx_constellation_maps.h b/libs/spandsp/src/v17_v32bis_tx_constellation_maps.h index 8044ad1e32..5ce8db44c8 100644 --- a/libs/spandsp/src/v17_v32bis_tx_constellation_maps.h +++ b/libs/spandsp/src/v17_v32bis_tx_constellation_maps.h @@ -2,12 +2,11 @@ * SpanDSP - a series of DSP components for telephony * * v17_v32bis_tx_constellation_maps.h - ITU V.17 and V.32bis modems - * transmit part. - * Constellation mapping. + * transmit part. Constellation mapping. * * Written by Steve Underwood * - * Copyright (C) 2004 Steve Underwood + * Copyright (C) 2004, 2012 Steve Underwood * * All rights reserved. * @@ -31,134 +30,134 @@ static const complexi16_t v17_v32bis_14400_constellation[128] = static const complexf_t v17_v32bis_14400_constellation[128] = #endif { - {FP_SCALE(-8.0f), FP_SCALE(-3.0f)}, /* 0x00 */ - {FP_SCALE( 9.0f), FP_SCALE( 2.0f)}, /* 0x01 */ - {FP_SCALE( 2.0f), FP_SCALE(-9.0f)}, /* 0x02 */ - {FP_SCALE(-3.0f), FP_SCALE( 8.0f)}, /* 0x03 */ - {FP_SCALE( 8.0f), FP_SCALE( 3.0f)}, /* 0x04 */ - {FP_SCALE(-9.0f), FP_SCALE(-2.0f)}, /* 0x05 */ - {FP_SCALE(-2.0f), FP_SCALE( 9.0f)}, /* 0x06 */ - {FP_SCALE( 3.0f), FP_SCALE(-8.0f)}, /* 0x07 */ - {FP_SCALE(-8.0f), FP_SCALE( 1.0f)}, /* 0x08 */ - {FP_SCALE( 9.0f), FP_SCALE(-2.0f)}, /* 0x09 */ - {FP_SCALE(-2.0f), FP_SCALE(-9.0f)}, /* 0x0A */ - {FP_SCALE( 1.0f), FP_SCALE( 8.0f)}, /* 0x0B */ - {FP_SCALE( 8.0f), FP_SCALE(-1.0f)}, /* 0x0C */ - {FP_SCALE(-9.0f), FP_SCALE( 2.0f)}, /* 0x0D */ - {FP_SCALE( 2.0f), FP_SCALE( 9.0f)}, /* 0x0E */ - {FP_SCALE(-1.0f), FP_SCALE(-8.0f)}, /* 0x0F */ - {FP_SCALE(-4.0f), FP_SCALE(-3.0f)}, /* 0x10 */ - {FP_SCALE( 5.0f), FP_SCALE( 2.0f)}, /* 0x11 */ - {FP_SCALE( 2.0f), FP_SCALE(-5.0f)}, /* 0x12 */ - {FP_SCALE(-3.0f), FP_SCALE( 4.0f)}, /* 0x13 */ - {FP_SCALE( 4.0f), FP_SCALE( 3.0f)}, /* 0x14 */ - {FP_SCALE(-5.0f), FP_SCALE(-2.0f)}, /* 0x15 */ - {FP_SCALE(-2.0f), FP_SCALE( 5.0f)}, /* 0x16 */ - {FP_SCALE( 3.0f), FP_SCALE(-4.0f)}, /* 0x17 */ - {FP_SCALE(-4.0f), FP_SCALE( 1.0f)}, /* 0x18 */ - {FP_SCALE( 5.0f), FP_SCALE(-2.0f)}, /* 0x19 */ - {FP_SCALE(-2.0f), FP_SCALE(-5.0f)}, /* 0x1A */ - {FP_SCALE( 1.0f), FP_SCALE( 4.0f)}, /* 0x1B */ - {FP_SCALE( 4.0f), FP_SCALE(-1.0f)}, /* 0x1C */ - {FP_SCALE(-5.0f), FP_SCALE( 2.0f)}, /* 0x1D */ - {FP_SCALE( 2.0f), FP_SCALE( 5.0f)}, /* 0x1E */ - {FP_SCALE(-1.0f), FP_SCALE(-4.0f)}, /* 0x1F */ - {FP_SCALE( 4.0f), FP_SCALE(-3.0f)}, /* 0x20 */ - {FP_SCALE(-3.0f), FP_SCALE( 2.0f)}, /* 0x21 */ - {FP_SCALE( 2.0f), FP_SCALE( 3.0f)}, /* 0x22 */ - {FP_SCALE(-3.0f), FP_SCALE(-4.0f)}, /* 0x23 */ - {FP_SCALE(-4.0f), FP_SCALE( 3.0f)}, /* 0x24 */ - {FP_SCALE( 3.0f), FP_SCALE(-2.0f)}, /* 0x25 */ - {FP_SCALE(-2.0f), FP_SCALE(-3.0f)}, /* 0x26 */ - {FP_SCALE( 3.0f), FP_SCALE( 4.0f)}, /* 0x27 */ - {FP_SCALE( 4.0f), FP_SCALE( 1.0f)}, /* 0x28 */ - {FP_SCALE(-3.0f), FP_SCALE(-2.0f)}, /* 0x29 */ - {FP_SCALE(-2.0f), FP_SCALE( 3.0f)}, /* 0x2A */ - {FP_SCALE( 1.0f), FP_SCALE(-4.0f)}, /* 0x2B */ - {FP_SCALE(-4.0f), FP_SCALE(-1.0f)}, /* 0x2C */ - {FP_SCALE( 3.0f), FP_SCALE( 2.0f)}, /* 0x2D */ - {FP_SCALE( 2.0f), FP_SCALE(-3.0f)}, /* 0x2E */ - {FP_SCALE(-1.0f), FP_SCALE( 4.0f)}, /* 0x2F */ - {FP_SCALE( 0.0f), FP_SCALE(-3.0f)}, /* 0x30 */ - {FP_SCALE( 1.0f), FP_SCALE( 2.0f)}, /* 0x31 */ - {FP_SCALE( 2.0f), FP_SCALE(-1.0f)}, /* 0x32 */ - {FP_SCALE(-3.0f), FP_SCALE( 0.0f)}, /* 0x33 */ - {FP_SCALE( 0.0f), FP_SCALE( 3.0f)}, /* 0x34 */ - {FP_SCALE(-1.0f), FP_SCALE(-2.0f)}, /* 0x35 */ - {FP_SCALE(-2.0f), FP_SCALE( 1.0f)}, /* 0x36 */ - {FP_SCALE( 3.0f), FP_SCALE( 0.0f)}, /* 0x37 */ - {FP_SCALE( 0.0f), FP_SCALE( 1.0f)}, /* 0x38 */ - {FP_SCALE( 1.0f), FP_SCALE(-2.0f)}, /* 0x39 */ - {FP_SCALE(-2.0f), FP_SCALE(-1.0f)}, /* 0x3A */ - {FP_SCALE( 1.0f), FP_SCALE( 0.0f)}, /* 0x3B */ - {FP_SCALE( 0.0f), FP_SCALE(-1.0f)}, /* 0x3C */ - {FP_SCALE(-1.0f), FP_SCALE( 2.0f)}, /* 0x3D */ - {FP_SCALE( 2.0f), FP_SCALE( 1.0f)}, /* 0x3E */ - {FP_SCALE(-1.0f), FP_SCALE( 0.0f)}, /* 0x3F */ - {FP_SCALE( 8.0f), FP_SCALE(-3.0f)}, /* 0x40 */ - {FP_SCALE(-7.0f), FP_SCALE( 2.0f)}, /* 0x41 */ - {FP_SCALE( 2.0f), FP_SCALE( 7.0f)}, /* 0x42 */ - {FP_SCALE(-3.0f), FP_SCALE(-8.0f)}, /* 0x43 */ - {FP_SCALE(-8.0f), FP_SCALE( 3.0f)}, /* 0x44 */ - {FP_SCALE( 7.0f), FP_SCALE(-2.0f)}, /* 0x45 */ - {FP_SCALE(-2.0f), FP_SCALE(-7.0f)}, /* 0x46 */ - {FP_SCALE( 3.0f), FP_SCALE( 8.0f)}, /* 0x47 */ - {FP_SCALE( 8.0f), FP_SCALE( 1.0f)}, /* 0x48 */ - {FP_SCALE(-7.0f), FP_SCALE(-2.0f)}, /* 0x49 */ - {FP_SCALE(-2.0f), FP_SCALE( 7.0f)}, /* 0x4A */ - {FP_SCALE( 1.0f), FP_SCALE(-8.0f)}, /* 0x4B */ - {FP_SCALE(-8.0f), FP_SCALE(-1.0f)}, /* 0x4C */ - {FP_SCALE( 7.0f), FP_SCALE( 2.0f)}, /* 0x4D */ - {FP_SCALE( 2.0f), FP_SCALE(-7.0f)}, /* 0x4E */ - {FP_SCALE(-1.0f), FP_SCALE( 8.0f)}, /* 0x4F */ - {FP_SCALE(-4.0f), FP_SCALE(-7.0f)}, /* 0x50 */ - {FP_SCALE( 5.0f), FP_SCALE( 6.0f)}, /* 0x51 */ - {FP_SCALE( 6.0f), FP_SCALE(-5.0f)}, /* 0x52 */ - {FP_SCALE(-7.0f), FP_SCALE( 4.0f)}, /* 0x53 */ - {FP_SCALE( 4.0f), FP_SCALE( 7.0f)}, /* 0x54 */ - {FP_SCALE(-5.0f), FP_SCALE(-6.0f)}, /* 0x55 */ - {FP_SCALE(-6.0f), FP_SCALE( 5.0f)}, /* 0x56 */ - {FP_SCALE( 7.0f), FP_SCALE(-4.0f)}, /* 0x57 */ - {FP_SCALE(-4.0f), FP_SCALE( 5.0f)}, /* 0x58 */ - {FP_SCALE( 5.0f), FP_SCALE(-6.0f)}, /* 0x59 */ - {FP_SCALE(-6.0f), FP_SCALE(-5.0f)}, /* 0x5A */ - {FP_SCALE( 5.0f), FP_SCALE( 4.0f)}, /* 0x5B */ - {FP_SCALE( 4.0f), FP_SCALE(-5.0f)}, /* 0x5C */ - {FP_SCALE(-5.0f), FP_SCALE( 6.0f)}, /* 0x5D */ - {FP_SCALE( 6.0f), FP_SCALE( 5.0f)}, /* 0x5E */ - {FP_SCALE(-5.0f), FP_SCALE(-4.0f)}, /* 0x5F */ - {FP_SCALE( 4.0f), FP_SCALE(-7.0f)}, /* 0x60 */ - {FP_SCALE(-3.0f), FP_SCALE( 6.0f)}, /* 0x61 */ - {FP_SCALE( 6.0f), FP_SCALE( 3.0f)}, /* 0x62 */ - {FP_SCALE(-7.0f), FP_SCALE(-4.0f)}, /* 0x63 */ - {FP_SCALE(-4.0f), FP_SCALE( 7.0f)}, /* 0x64 */ - {FP_SCALE( 3.0f), FP_SCALE(-6.0f)}, /* 0x65 */ - {FP_SCALE(-6.0f), FP_SCALE(-3.0f)}, /* 0x66 */ - {FP_SCALE( 7.0f), FP_SCALE( 4.0f)}, /* 0x67 */ - {FP_SCALE( 4.0f), FP_SCALE( 5.0f)}, /* 0x68 */ - {FP_SCALE(-3.0f), FP_SCALE(-6.0f)}, /* 0x69 */ - {FP_SCALE(-6.0f), FP_SCALE( 3.0f)}, /* 0x6A */ - {FP_SCALE( 5.0f), FP_SCALE(-4.0f)}, /* 0x6B */ - {FP_SCALE(-4.0f), FP_SCALE(-5.0f)}, /* 0x6C */ - {FP_SCALE( 3.0f), FP_SCALE( 6.0f)}, /* 0x6D */ - {FP_SCALE( 6.0f), FP_SCALE(-3.0f)}, /* 0x6E */ - {FP_SCALE(-5.0f), FP_SCALE( 4.0f)}, /* 0x6F */ - {FP_SCALE( 0.0f), FP_SCALE(-7.0f)}, /* 0x70 */ - {FP_SCALE( 1.0f), FP_SCALE( 6.0f)}, /* 0x71 */ - {FP_SCALE( 6.0f), FP_SCALE(-1.0f)}, /* 0x72 */ - {FP_SCALE(-7.0f), FP_SCALE( 0.0f)}, /* 0x73 */ - {FP_SCALE( 0.0f), FP_SCALE( 7.0f)}, /* 0x74 */ - {FP_SCALE(-1.0f), FP_SCALE(-6.0f)}, /* 0x75 */ - {FP_SCALE(-6.0f), FP_SCALE( 1.0f)}, /* 0x76 */ - {FP_SCALE( 7.0f), FP_SCALE( 0.0f)}, /* 0x77 */ - {FP_SCALE( 0.0f), FP_SCALE( 5.0f)}, /* 0x78 */ - {FP_SCALE( 1.0f), FP_SCALE(-6.0f)}, /* 0x79 */ - {FP_SCALE(-6.0f), FP_SCALE(-1.0f)}, /* 0x7A */ - {FP_SCALE( 5.0f), FP_SCALE( 0.0f)}, /* 0x7B */ - {FP_SCALE( 0.0f), FP_SCALE(-5.0f)}, /* 0x7C */ - {FP_SCALE(-1.0f), FP_SCALE( 6.0f)}, /* 0x7D */ - {FP_SCALE( 6.0f), FP_SCALE( 1.0f)}, /* 0x7E */ - {FP_SCALE(-5.0f), FP_SCALE( 0.0f)} /* 0x7F */ + {FP_CONSTELLATION_SCALE(-8.0f), FP_CONSTELLATION_SCALE(-3.0f)}, /* 0x00 */ + {FP_CONSTELLATION_SCALE( 9.0f), FP_CONSTELLATION_SCALE( 2.0f)}, /* 0x01 */ + {FP_CONSTELLATION_SCALE( 2.0f), FP_CONSTELLATION_SCALE(-9.0f)}, /* 0x02 */ + {FP_CONSTELLATION_SCALE(-3.0f), FP_CONSTELLATION_SCALE( 8.0f)}, /* 0x03 */ + {FP_CONSTELLATION_SCALE( 8.0f), FP_CONSTELLATION_SCALE( 3.0f)}, /* 0x04 */ + {FP_CONSTELLATION_SCALE(-9.0f), FP_CONSTELLATION_SCALE(-2.0f)}, /* 0x05 */ + {FP_CONSTELLATION_SCALE(-2.0f), FP_CONSTELLATION_SCALE( 9.0f)}, /* 0x06 */ + {FP_CONSTELLATION_SCALE( 3.0f), FP_CONSTELLATION_SCALE(-8.0f)}, /* 0x07 */ + {FP_CONSTELLATION_SCALE(-8.0f), FP_CONSTELLATION_SCALE( 1.0f)}, /* 0x08 */ + {FP_CONSTELLATION_SCALE( 9.0f), FP_CONSTELLATION_SCALE(-2.0f)}, /* 0x09 */ + {FP_CONSTELLATION_SCALE(-2.0f), FP_CONSTELLATION_SCALE(-9.0f)}, /* 0x0A */ + {FP_CONSTELLATION_SCALE( 1.0f), FP_CONSTELLATION_SCALE( 8.0f)}, /* 0x0B */ + {FP_CONSTELLATION_SCALE( 8.0f), FP_CONSTELLATION_SCALE(-1.0f)}, /* 0x0C */ + {FP_CONSTELLATION_SCALE(-9.0f), FP_CONSTELLATION_SCALE( 2.0f)}, /* 0x0D */ + {FP_CONSTELLATION_SCALE( 2.0f), FP_CONSTELLATION_SCALE( 9.0f)}, /* 0x0E */ + {FP_CONSTELLATION_SCALE(-1.0f), FP_CONSTELLATION_SCALE(-8.0f)}, /* 0x0F */ + {FP_CONSTELLATION_SCALE(-4.0f), FP_CONSTELLATION_SCALE(-3.0f)}, /* 0x10 */ + {FP_CONSTELLATION_SCALE( 5.0f), FP_CONSTELLATION_SCALE( 2.0f)}, /* 0x11 */ + {FP_CONSTELLATION_SCALE( 2.0f), FP_CONSTELLATION_SCALE(-5.0f)}, /* 0x12 */ + {FP_CONSTELLATION_SCALE(-3.0f), FP_CONSTELLATION_SCALE( 4.0f)}, /* 0x13 */ + {FP_CONSTELLATION_SCALE( 4.0f), FP_CONSTELLATION_SCALE( 3.0f)}, /* 0x14 */ + {FP_CONSTELLATION_SCALE(-5.0f), FP_CONSTELLATION_SCALE(-2.0f)}, /* 0x15 */ + {FP_CONSTELLATION_SCALE(-2.0f), FP_CONSTELLATION_SCALE( 5.0f)}, /* 0x16 */ + {FP_CONSTELLATION_SCALE( 3.0f), FP_CONSTELLATION_SCALE(-4.0f)}, /* 0x17 */ + {FP_CONSTELLATION_SCALE(-4.0f), FP_CONSTELLATION_SCALE( 1.0f)}, /* 0x18 */ + {FP_CONSTELLATION_SCALE( 5.0f), FP_CONSTELLATION_SCALE(-2.0f)}, /* 0x19 */ + {FP_CONSTELLATION_SCALE(-2.0f), FP_CONSTELLATION_SCALE(-5.0f)}, /* 0x1A */ + {FP_CONSTELLATION_SCALE( 1.0f), FP_CONSTELLATION_SCALE( 4.0f)}, /* 0x1B */ + {FP_CONSTELLATION_SCALE( 4.0f), FP_CONSTELLATION_SCALE(-1.0f)}, /* 0x1C */ + {FP_CONSTELLATION_SCALE(-5.0f), FP_CONSTELLATION_SCALE( 2.0f)}, /* 0x1D */ + {FP_CONSTELLATION_SCALE( 2.0f), FP_CONSTELLATION_SCALE( 5.0f)}, /* 0x1E */ + {FP_CONSTELLATION_SCALE(-1.0f), FP_CONSTELLATION_SCALE(-4.0f)}, /* 0x1F */ + {FP_CONSTELLATION_SCALE( 4.0f), FP_CONSTELLATION_SCALE(-3.0f)}, /* 0x20 */ + {FP_CONSTELLATION_SCALE(-3.0f), FP_CONSTELLATION_SCALE( 2.0f)}, /* 0x21 */ + {FP_CONSTELLATION_SCALE( 2.0f), FP_CONSTELLATION_SCALE( 3.0f)}, /* 0x22 */ + {FP_CONSTELLATION_SCALE(-3.0f), FP_CONSTELLATION_SCALE(-4.0f)}, /* 0x23 */ + {FP_CONSTELLATION_SCALE(-4.0f), FP_CONSTELLATION_SCALE( 3.0f)}, /* 0x24 */ + {FP_CONSTELLATION_SCALE( 3.0f), FP_CONSTELLATION_SCALE(-2.0f)}, /* 0x25 */ + {FP_CONSTELLATION_SCALE(-2.0f), FP_CONSTELLATION_SCALE(-3.0f)}, /* 0x26 */ + {FP_CONSTELLATION_SCALE( 3.0f), FP_CONSTELLATION_SCALE( 4.0f)}, /* 0x27 */ + {FP_CONSTELLATION_SCALE( 4.0f), FP_CONSTELLATION_SCALE( 1.0f)}, /* 0x28 */ + {FP_CONSTELLATION_SCALE(-3.0f), FP_CONSTELLATION_SCALE(-2.0f)}, /* 0x29 */ + {FP_CONSTELLATION_SCALE(-2.0f), FP_CONSTELLATION_SCALE( 3.0f)}, /* 0x2A */ + {FP_CONSTELLATION_SCALE( 1.0f), FP_CONSTELLATION_SCALE(-4.0f)}, /* 0x2B */ + {FP_CONSTELLATION_SCALE(-4.0f), FP_CONSTELLATION_SCALE(-1.0f)}, /* 0x2C */ + {FP_CONSTELLATION_SCALE( 3.0f), FP_CONSTELLATION_SCALE( 2.0f)}, /* 0x2D */ + {FP_CONSTELLATION_SCALE( 2.0f), FP_CONSTELLATION_SCALE(-3.0f)}, /* 0x2E */ + {FP_CONSTELLATION_SCALE(-1.0f), FP_CONSTELLATION_SCALE( 4.0f)}, /* 0x2F */ + {FP_CONSTELLATION_SCALE( 0.0f), FP_CONSTELLATION_SCALE(-3.0f)}, /* 0x30 */ + {FP_CONSTELLATION_SCALE( 1.0f), FP_CONSTELLATION_SCALE( 2.0f)}, /* 0x31 */ + {FP_CONSTELLATION_SCALE( 2.0f), FP_CONSTELLATION_SCALE(-1.0f)}, /* 0x32 */ + {FP_CONSTELLATION_SCALE(-3.0f), FP_CONSTELLATION_SCALE( 0.0f)}, /* 0x33 */ + {FP_CONSTELLATION_SCALE( 0.0f), FP_CONSTELLATION_SCALE( 3.0f)}, /* 0x34 */ + {FP_CONSTELLATION_SCALE(-1.0f), FP_CONSTELLATION_SCALE(-2.0f)}, /* 0x35 */ + {FP_CONSTELLATION_SCALE(-2.0f), FP_CONSTELLATION_SCALE( 1.0f)}, /* 0x36 */ + {FP_CONSTELLATION_SCALE( 3.0f), FP_CONSTELLATION_SCALE( 0.0f)}, /* 0x37 */ + {FP_CONSTELLATION_SCALE( 0.0f), FP_CONSTELLATION_SCALE( 1.0f)}, /* 0x38 */ + {FP_CONSTELLATION_SCALE( 1.0f), FP_CONSTELLATION_SCALE(-2.0f)}, /* 0x39 */ + {FP_CONSTELLATION_SCALE(-2.0f), FP_CONSTELLATION_SCALE(-1.0f)}, /* 0x3A */ + {FP_CONSTELLATION_SCALE( 1.0f), FP_CONSTELLATION_SCALE( 0.0f)}, /* 0x3B */ + {FP_CONSTELLATION_SCALE( 0.0f), FP_CONSTELLATION_SCALE(-1.0f)}, /* 0x3C */ + {FP_CONSTELLATION_SCALE(-1.0f), FP_CONSTELLATION_SCALE( 2.0f)}, /* 0x3D */ + {FP_CONSTELLATION_SCALE( 2.0f), FP_CONSTELLATION_SCALE( 1.0f)}, /* 0x3E */ + {FP_CONSTELLATION_SCALE(-1.0f), FP_CONSTELLATION_SCALE( 0.0f)}, /* 0x3F */ + {FP_CONSTELLATION_SCALE( 8.0f), FP_CONSTELLATION_SCALE(-3.0f)}, /* 0x40 */ + {FP_CONSTELLATION_SCALE(-7.0f), FP_CONSTELLATION_SCALE( 2.0f)}, /* 0x41 */ + {FP_CONSTELLATION_SCALE( 2.0f), FP_CONSTELLATION_SCALE( 7.0f)}, /* 0x42 */ + {FP_CONSTELLATION_SCALE(-3.0f), FP_CONSTELLATION_SCALE(-8.0f)}, /* 0x43 */ + {FP_CONSTELLATION_SCALE(-8.0f), FP_CONSTELLATION_SCALE( 3.0f)}, /* 0x44 */ + {FP_CONSTELLATION_SCALE( 7.0f), FP_CONSTELLATION_SCALE(-2.0f)}, /* 0x45 */ + {FP_CONSTELLATION_SCALE(-2.0f), FP_CONSTELLATION_SCALE(-7.0f)}, /* 0x46 */ + {FP_CONSTELLATION_SCALE( 3.0f), FP_CONSTELLATION_SCALE( 8.0f)}, /* 0x47 */ + {FP_CONSTELLATION_SCALE( 8.0f), FP_CONSTELLATION_SCALE( 1.0f)}, /* 0x48 */ + {FP_CONSTELLATION_SCALE(-7.0f), FP_CONSTELLATION_SCALE(-2.0f)}, /* 0x49 */ + {FP_CONSTELLATION_SCALE(-2.0f), FP_CONSTELLATION_SCALE( 7.0f)}, /* 0x4A */ + {FP_CONSTELLATION_SCALE( 1.0f), FP_CONSTELLATION_SCALE(-8.0f)}, /* 0x4B */ + {FP_CONSTELLATION_SCALE(-8.0f), FP_CONSTELLATION_SCALE(-1.0f)}, /* 0x4C */ + {FP_CONSTELLATION_SCALE( 7.0f), FP_CONSTELLATION_SCALE( 2.0f)}, /* 0x4D */ + {FP_CONSTELLATION_SCALE( 2.0f), FP_CONSTELLATION_SCALE(-7.0f)}, /* 0x4E */ + {FP_CONSTELLATION_SCALE(-1.0f), FP_CONSTELLATION_SCALE( 8.0f)}, /* 0x4F */ + {FP_CONSTELLATION_SCALE(-4.0f), FP_CONSTELLATION_SCALE(-7.0f)}, /* 0x50 */ + {FP_CONSTELLATION_SCALE( 5.0f), FP_CONSTELLATION_SCALE( 6.0f)}, /* 0x51 */ + {FP_CONSTELLATION_SCALE( 6.0f), FP_CONSTELLATION_SCALE(-5.0f)}, /* 0x52 */ + {FP_CONSTELLATION_SCALE(-7.0f), FP_CONSTELLATION_SCALE( 4.0f)}, /* 0x53 */ + {FP_CONSTELLATION_SCALE( 4.0f), FP_CONSTELLATION_SCALE( 7.0f)}, /* 0x54 */ + {FP_CONSTELLATION_SCALE(-5.0f), FP_CONSTELLATION_SCALE(-6.0f)}, /* 0x55 */ + {FP_CONSTELLATION_SCALE(-6.0f), FP_CONSTELLATION_SCALE( 5.0f)}, /* 0x56 */ + {FP_CONSTELLATION_SCALE( 7.0f), FP_CONSTELLATION_SCALE(-4.0f)}, /* 0x57 */ + {FP_CONSTELLATION_SCALE(-4.0f), FP_CONSTELLATION_SCALE( 5.0f)}, /* 0x58 */ + {FP_CONSTELLATION_SCALE( 5.0f), FP_CONSTELLATION_SCALE(-6.0f)}, /* 0x59 */ + {FP_CONSTELLATION_SCALE(-6.0f), FP_CONSTELLATION_SCALE(-5.0f)}, /* 0x5A */ + {FP_CONSTELLATION_SCALE( 5.0f), FP_CONSTELLATION_SCALE( 4.0f)}, /* 0x5B */ + {FP_CONSTELLATION_SCALE( 4.0f), FP_CONSTELLATION_SCALE(-5.0f)}, /* 0x5C */ + {FP_CONSTELLATION_SCALE(-5.0f), FP_CONSTELLATION_SCALE( 6.0f)}, /* 0x5D */ + {FP_CONSTELLATION_SCALE( 6.0f), FP_CONSTELLATION_SCALE( 5.0f)}, /* 0x5E */ + {FP_CONSTELLATION_SCALE(-5.0f), FP_CONSTELLATION_SCALE(-4.0f)}, /* 0x5F */ + {FP_CONSTELLATION_SCALE( 4.0f), FP_CONSTELLATION_SCALE(-7.0f)}, /* 0x60 */ + {FP_CONSTELLATION_SCALE(-3.0f), FP_CONSTELLATION_SCALE( 6.0f)}, /* 0x61 */ + {FP_CONSTELLATION_SCALE( 6.0f), FP_CONSTELLATION_SCALE( 3.0f)}, /* 0x62 */ + {FP_CONSTELLATION_SCALE(-7.0f), FP_CONSTELLATION_SCALE(-4.0f)}, /* 0x63 */ + {FP_CONSTELLATION_SCALE(-4.0f), FP_CONSTELLATION_SCALE( 7.0f)}, /* 0x64 */ + {FP_CONSTELLATION_SCALE( 3.0f), FP_CONSTELLATION_SCALE(-6.0f)}, /* 0x65 */ + {FP_CONSTELLATION_SCALE(-6.0f), FP_CONSTELLATION_SCALE(-3.0f)}, /* 0x66 */ + {FP_CONSTELLATION_SCALE( 7.0f), FP_CONSTELLATION_SCALE( 4.0f)}, /* 0x67 */ + {FP_CONSTELLATION_SCALE( 4.0f), FP_CONSTELLATION_SCALE( 5.0f)}, /* 0x68 */ + {FP_CONSTELLATION_SCALE(-3.0f), FP_CONSTELLATION_SCALE(-6.0f)}, /* 0x69 */ + {FP_CONSTELLATION_SCALE(-6.0f), FP_CONSTELLATION_SCALE( 3.0f)}, /* 0x6A */ + {FP_CONSTELLATION_SCALE( 5.0f), FP_CONSTELLATION_SCALE(-4.0f)}, /* 0x6B */ + {FP_CONSTELLATION_SCALE(-4.0f), FP_CONSTELLATION_SCALE(-5.0f)}, /* 0x6C */ + {FP_CONSTELLATION_SCALE( 3.0f), FP_CONSTELLATION_SCALE( 6.0f)}, /* 0x6D */ + {FP_CONSTELLATION_SCALE( 6.0f), FP_CONSTELLATION_SCALE(-3.0f)}, /* 0x6E */ + {FP_CONSTELLATION_SCALE(-5.0f), FP_CONSTELLATION_SCALE( 4.0f)}, /* 0x6F */ + {FP_CONSTELLATION_SCALE( 0.0f), FP_CONSTELLATION_SCALE(-7.0f)}, /* 0x70 */ + {FP_CONSTELLATION_SCALE( 1.0f), FP_CONSTELLATION_SCALE( 6.0f)}, /* 0x71 */ + {FP_CONSTELLATION_SCALE( 6.0f), FP_CONSTELLATION_SCALE(-1.0f)}, /* 0x72 */ + {FP_CONSTELLATION_SCALE(-7.0f), FP_CONSTELLATION_SCALE( 0.0f)}, /* 0x73 */ + {FP_CONSTELLATION_SCALE( 0.0f), FP_CONSTELLATION_SCALE( 7.0f)}, /* 0x74 */ + {FP_CONSTELLATION_SCALE(-1.0f), FP_CONSTELLATION_SCALE(-6.0f)}, /* 0x75 */ + {FP_CONSTELLATION_SCALE(-6.0f), FP_CONSTELLATION_SCALE( 1.0f)}, /* 0x76 */ + {FP_CONSTELLATION_SCALE( 7.0f), FP_CONSTELLATION_SCALE( 0.0f)}, /* 0x77 */ + {FP_CONSTELLATION_SCALE( 0.0f), FP_CONSTELLATION_SCALE( 5.0f)}, /* 0x78 */ + {FP_CONSTELLATION_SCALE( 1.0f), FP_CONSTELLATION_SCALE(-6.0f)}, /* 0x79 */ + {FP_CONSTELLATION_SCALE(-6.0f), FP_CONSTELLATION_SCALE(-1.0f)}, /* 0x7A */ + {FP_CONSTELLATION_SCALE( 5.0f), FP_CONSTELLATION_SCALE( 0.0f)}, /* 0x7B */ + {FP_CONSTELLATION_SCALE( 0.0f), FP_CONSTELLATION_SCALE(-5.0f)}, /* 0x7C */ + {FP_CONSTELLATION_SCALE(-1.0f), FP_CONSTELLATION_SCALE( 6.0f)}, /* 0x7D */ + {FP_CONSTELLATION_SCALE( 6.0f), FP_CONSTELLATION_SCALE( 1.0f)}, /* 0x7E */ + {FP_CONSTELLATION_SCALE(-5.0f), FP_CONSTELLATION_SCALE( 0.0f)} /* 0x7F */ }; #if defined(SPANDSP_USE_FIXED_POINTx) @@ -167,70 +166,70 @@ static const complexi16_t v17_v32bis_12000_constellation[64] = static const complexf_t v17_v32bis_12000_constellation[64] = #endif { - {FP_SCALE( 7.0f), FP_SCALE( 1.0f)}, /* 0x00 */ - {FP_SCALE(-5.0f), FP_SCALE(-1.0f)}, /* 0x01 */ - {FP_SCALE(-1.0f), FP_SCALE( 5.0f)}, /* 0x02 */ - {FP_SCALE( 1.0f), FP_SCALE(-7.0f)}, /* 0x03 */ - {FP_SCALE(-7.0f), FP_SCALE(-1.0f)}, /* 0x04 */ - {FP_SCALE( 5.0f), FP_SCALE( 1.0f)}, /* 0x05 */ - {FP_SCALE( 1.0f), FP_SCALE(-5.0f)}, /* 0x06 */ - {FP_SCALE(-1.0f), FP_SCALE( 7.0f)}, /* 0x07 */ - {FP_SCALE( 3.0f), FP_SCALE(-3.0f)}, /* 0x08 */ - {FP_SCALE(-1.0f), FP_SCALE( 3.0f)}, /* 0x09 */ - {FP_SCALE( 3.0f), FP_SCALE( 1.0f)}, /* 0x0A */ - {FP_SCALE(-3.0f), FP_SCALE(-3.0f)}, /* 0x0B */ - {FP_SCALE(-3.0f), FP_SCALE( 3.0f)}, /* 0x0C */ - {FP_SCALE( 1.0f), FP_SCALE(-3.0f)}, /* 0x0D */ - {FP_SCALE(-3.0f), FP_SCALE(-1.0f)}, /* 0x0E */ - {FP_SCALE( 3.0f), FP_SCALE( 3.0f)}, /* 0x0F */ - {FP_SCALE( 7.0f), FP_SCALE(-7.0f)}, /* 0x10 */ - {FP_SCALE(-5.0f), FP_SCALE( 7.0f)}, /* 0x11 */ - {FP_SCALE( 7.0f), FP_SCALE( 5.0f)}, /* 0x12 */ - {FP_SCALE(-7.0f), FP_SCALE(-7.0f)}, /* 0x13 */ - {FP_SCALE(-7.0f), FP_SCALE( 7.0f)}, /* 0x14 */ - {FP_SCALE( 5.0f), FP_SCALE(-7.0f)}, /* 0x15 */ - {FP_SCALE(-7.0f), FP_SCALE(-5.0f)}, /* 0x16 */ - {FP_SCALE( 7.0f), FP_SCALE( 7.0f)}, /* 0x17 */ - {FP_SCALE(-1.0f), FP_SCALE(-7.0f)}, /* 0x18 */ - {FP_SCALE( 3.0f), FP_SCALE( 7.0f)}, /* 0x19 */ - {FP_SCALE( 7.0f), FP_SCALE(-3.0f)}, /* 0x1A */ - {FP_SCALE(-7.0f), FP_SCALE( 1.0f)}, /* 0x1B */ - {FP_SCALE( 1.0f), FP_SCALE( 7.0f)}, /* 0x1C */ - {FP_SCALE(-3.0f), FP_SCALE(-7.0f)}, /* 0x1D */ - {FP_SCALE(-7.0f), FP_SCALE( 3.0f)}, /* 0x1E */ - {FP_SCALE( 7.0f), FP_SCALE(-1.0f)}, /* 0x1F */ - {FP_SCALE( 3.0f), FP_SCALE( 5.0f)}, /* 0x20 */ - {FP_SCALE(-1.0f), FP_SCALE(-5.0f)}, /* 0x21 */ - {FP_SCALE(-5.0f), FP_SCALE( 1.0f)}, /* 0x22 */ - {FP_SCALE( 5.0f), FP_SCALE(-3.0f)}, /* 0x23 */ - {FP_SCALE(-3.0f), FP_SCALE(-5.0f)}, /* 0x24 */ - {FP_SCALE( 1.0f), FP_SCALE( 5.0f)}, /* 0x25 */ - {FP_SCALE( 5.0f), FP_SCALE(-1.0f)}, /* 0x26 */ - {FP_SCALE(-5.0f), FP_SCALE( 3.0f)}, /* 0x27 */ - {FP_SCALE(-1.0f), FP_SCALE( 1.0f)}, /* 0x28 */ - {FP_SCALE( 3.0f), FP_SCALE(-1.0f)}, /* 0x29 */ - {FP_SCALE(-1.0f), FP_SCALE(-3.0f)}, /* 0x2A */ - {FP_SCALE( 1.0f), FP_SCALE( 1.0f)}, /* 0x2B */ - {FP_SCALE( 1.0f), FP_SCALE(-1.0f)}, /* 0x2C */ - {FP_SCALE(-3.0f), FP_SCALE( 1.0f)}, /* 0x2D */ - {FP_SCALE( 1.0f), FP_SCALE( 3.0f)}, /* 0x2E */ - {FP_SCALE(-1.0f), FP_SCALE(-1.0f)}, /* 0x2F */ - {FP_SCALE(-5.0f), FP_SCALE( 5.0f)}, /* 0x30 */ - {FP_SCALE( 7.0f), FP_SCALE(-5.0f)}, /* 0x31 */ - {FP_SCALE(-5.0f), FP_SCALE(-7.0f)}, /* 0x32 */ - {FP_SCALE( 5.0f), FP_SCALE( 5.0f)}, /* 0x33 */ - {FP_SCALE( 5.0f), FP_SCALE(-5.0f)}, /* 0x34 */ - {FP_SCALE(-7.0f), FP_SCALE( 5.0f)}, /* 0x35 */ - {FP_SCALE( 5.0f), FP_SCALE( 7.0f)}, /* 0x36 */ - {FP_SCALE(-5.0f), FP_SCALE(-5.0f)}, /* 0x37 */ - {FP_SCALE(-5.0f), FP_SCALE(-3.0f)}, /* 0x38 */ - {FP_SCALE( 7.0f), FP_SCALE( 3.0f)}, /* 0x39 */ - {FP_SCALE( 3.0f), FP_SCALE(-7.0f)}, /* 0x3A */ - {FP_SCALE(-3.0f), FP_SCALE( 5.0f)}, /* 0x3B */ - {FP_SCALE( 5.0f), FP_SCALE( 3.0f)}, /* 0x3C */ - {FP_SCALE(-7.0f), FP_SCALE(-3.0f)}, /* 0x3D */ - {FP_SCALE(-3.0f), FP_SCALE( 7.0f)}, /* 0x3E */ - {FP_SCALE( 3.0f), FP_SCALE(-5.0f)} /* 0x3F */ + {FP_CONSTELLATION_SCALE( 7.0f), FP_CONSTELLATION_SCALE( 1.0f)}, /* 0x00 */ + {FP_CONSTELLATION_SCALE(-5.0f), FP_CONSTELLATION_SCALE(-1.0f)}, /* 0x01 */ + {FP_CONSTELLATION_SCALE(-1.0f), FP_CONSTELLATION_SCALE( 5.0f)}, /* 0x02 */ + {FP_CONSTELLATION_SCALE( 1.0f), FP_CONSTELLATION_SCALE(-7.0f)}, /* 0x03 */ + {FP_CONSTELLATION_SCALE(-7.0f), FP_CONSTELLATION_SCALE(-1.0f)}, /* 0x04 */ + {FP_CONSTELLATION_SCALE( 5.0f), FP_CONSTELLATION_SCALE( 1.0f)}, /* 0x05 */ + {FP_CONSTELLATION_SCALE( 1.0f), FP_CONSTELLATION_SCALE(-5.0f)}, /* 0x06 */ + {FP_CONSTELLATION_SCALE(-1.0f), FP_CONSTELLATION_SCALE( 7.0f)}, /* 0x07 */ + {FP_CONSTELLATION_SCALE( 3.0f), FP_CONSTELLATION_SCALE(-3.0f)}, /* 0x08 */ + {FP_CONSTELLATION_SCALE(-1.0f), FP_CONSTELLATION_SCALE( 3.0f)}, /* 0x09 */ + {FP_CONSTELLATION_SCALE( 3.0f), FP_CONSTELLATION_SCALE( 1.0f)}, /* 0x0A */ + {FP_CONSTELLATION_SCALE(-3.0f), FP_CONSTELLATION_SCALE(-3.0f)}, /* 0x0B */ + {FP_CONSTELLATION_SCALE(-3.0f), FP_CONSTELLATION_SCALE( 3.0f)}, /* 0x0C */ + {FP_CONSTELLATION_SCALE( 1.0f), FP_CONSTELLATION_SCALE(-3.0f)}, /* 0x0D */ + {FP_CONSTELLATION_SCALE(-3.0f), FP_CONSTELLATION_SCALE(-1.0f)}, /* 0x0E */ + {FP_CONSTELLATION_SCALE( 3.0f), FP_CONSTELLATION_SCALE( 3.0f)}, /* 0x0F */ + {FP_CONSTELLATION_SCALE( 7.0f), FP_CONSTELLATION_SCALE(-7.0f)}, /* 0x10 */ + {FP_CONSTELLATION_SCALE(-5.0f), FP_CONSTELLATION_SCALE( 7.0f)}, /* 0x11 */ + {FP_CONSTELLATION_SCALE( 7.0f), FP_CONSTELLATION_SCALE( 5.0f)}, /* 0x12 */ + {FP_CONSTELLATION_SCALE(-7.0f), FP_CONSTELLATION_SCALE(-7.0f)}, /* 0x13 */ + {FP_CONSTELLATION_SCALE(-7.0f), FP_CONSTELLATION_SCALE( 7.0f)}, /* 0x14 */ + {FP_CONSTELLATION_SCALE( 5.0f), FP_CONSTELLATION_SCALE(-7.0f)}, /* 0x15 */ + {FP_CONSTELLATION_SCALE(-7.0f), FP_CONSTELLATION_SCALE(-5.0f)}, /* 0x16 */ + {FP_CONSTELLATION_SCALE( 7.0f), FP_CONSTELLATION_SCALE( 7.0f)}, /* 0x17 */ + {FP_CONSTELLATION_SCALE(-1.0f), FP_CONSTELLATION_SCALE(-7.0f)}, /* 0x18 */ + {FP_CONSTELLATION_SCALE( 3.0f), FP_CONSTELLATION_SCALE( 7.0f)}, /* 0x19 */ + {FP_CONSTELLATION_SCALE( 7.0f), FP_CONSTELLATION_SCALE(-3.0f)}, /* 0x1A */ + {FP_CONSTELLATION_SCALE(-7.0f), FP_CONSTELLATION_SCALE( 1.0f)}, /* 0x1B */ + {FP_CONSTELLATION_SCALE( 1.0f), FP_CONSTELLATION_SCALE( 7.0f)}, /* 0x1C */ + {FP_CONSTELLATION_SCALE(-3.0f), FP_CONSTELLATION_SCALE(-7.0f)}, /* 0x1D */ + {FP_CONSTELLATION_SCALE(-7.0f), FP_CONSTELLATION_SCALE( 3.0f)}, /* 0x1E */ + {FP_CONSTELLATION_SCALE( 7.0f), FP_CONSTELLATION_SCALE(-1.0f)}, /* 0x1F */ + {FP_CONSTELLATION_SCALE( 3.0f), FP_CONSTELLATION_SCALE( 5.0f)}, /* 0x20 */ + {FP_CONSTELLATION_SCALE(-1.0f), FP_CONSTELLATION_SCALE(-5.0f)}, /* 0x21 */ + {FP_CONSTELLATION_SCALE(-5.0f), FP_CONSTELLATION_SCALE( 1.0f)}, /* 0x22 */ + {FP_CONSTELLATION_SCALE( 5.0f), FP_CONSTELLATION_SCALE(-3.0f)}, /* 0x23 */ + {FP_CONSTELLATION_SCALE(-3.0f), FP_CONSTELLATION_SCALE(-5.0f)}, /* 0x24 */ + {FP_CONSTELLATION_SCALE( 1.0f), FP_CONSTELLATION_SCALE( 5.0f)}, /* 0x25 */ + {FP_CONSTELLATION_SCALE( 5.0f), FP_CONSTELLATION_SCALE(-1.0f)}, /* 0x26 */ + {FP_CONSTELLATION_SCALE(-5.0f), FP_CONSTELLATION_SCALE( 3.0f)}, /* 0x27 */ + {FP_CONSTELLATION_SCALE(-1.0f), FP_CONSTELLATION_SCALE( 1.0f)}, /* 0x28 */ + {FP_CONSTELLATION_SCALE( 3.0f), FP_CONSTELLATION_SCALE(-1.0f)}, /* 0x29 */ + {FP_CONSTELLATION_SCALE(-1.0f), FP_CONSTELLATION_SCALE(-3.0f)}, /* 0x2A */ + {FP_CONSTELLATION_SCALE( 1.0f), FP_CONSTELLATION_SCALE( 1.0f)}, /* 0x2B */ + {FP_CONSTELLATION_SCALE( 1.0f), FP_CONSTELLATION_SCALE(-1.0f)}, /* 0x2C */ + {FP_CONSTELLATION_SCALE(-3.0f), FP_CONSTELLATION_SCALE( 1.0f)}, /* 0x2D */ + {FP_CONSTELLATION_SCALE( 1.0f), FP_CONSTELLATION_SCALE( 3.0f)}, /* 0x2E */ + {FP_CONSTELLATION_SCALE(-1.0f), FP_CONSTELLATION_SCALE(-1.0f)}, /* 0x2F */ + {FP_CONSTELLATION_SCALE(-5.0f), FP_CONSTELLATION_SCALE( 5.0f)}, /* 0x30 */ + {FP_CONSTELLATION_SCALE( 7.0f), FP_CONSTELLATION_SCALE(-5.0f)}, /* 0x31 */ + {FP_CONSTELLATION_SCALE(-5.0f), FP_CONSTELLATION_SCALE(-7.0f)}, /* 0x32 */ + {FP_CONSTELLATION_SCALE( 5.0f), FP_CONSTELLATION_SCALE( 5.0f)}, /* 0x33 */ + {FP_CONSTELLATION_SCALE( 5.0f), FP_CONSTELLATION_SCALE(-5.0f)}, /* 0x34 */ + {FP_CONSTELLATION_SCALE(-7.0f), FP_CONSTELLATION_SCALE( 5.0f)}, /* 0x35 */ + {FP_CONSTELLATION_SCALE( 5.0f), FP_CONSTELLATION_SCALE( 7.0f)}, /* 0x36 */ + {FP_CONSTELLATION_SCALE(-5.0f), FP_CONSTELLATION_SCALE(-5.0f)}, /* 0x37 */ + {FP_CONSTELLATION_SCALE(-5.0f), FP_CONSTELLATION_SCALE(-3.0f)}, /* 0x38 */ + {FP_CONSTELLATION_SCALE( 7.0f), FP_CONSTELLATION_SCALE( 3.0f)}, /* 0x39 */ + {FP_CONSTELLATION_SCALE( 3.0f), FP_CONSTELLATION_SCALE(-7.0f)}, /* 0x3A */ + {FP_CONSTELLATION_SCALE(-3.0f), FP_CONSTELLATION_SCALE( 5.0f)}, /* 0x3B */ + {FP_CONSTELLATION_SCALE( 5.0f), FP_CONSTELLATION_SCALE( 3.0f)}, /* 0x3C */ + {FP_CONSTELLATION_SCALE(-7.0f), FP_CONSTELLATION_SCALE(-3.0f)}, /* 0x3D */ + {FP_CONSTELLATION_SCALE(-3.0f), FP_CONSTELLATION_SCALE( 7.0f)}, /* 0x3E */ + {FP_CONSTELLATION_SCALE( 3.0f), FP_CONSTELLATION_SCALE(-5.0f)} /* 0x3F */ }; #if defined(SPANDSP_USE_FIXED_POINTx) @@ -239,38 +238,38 @@ static const complexi16_t v17_v32bis_9600_constellation[32] = static const complexf_t v17_v32bis_9600_constellation[32] = #endif { - {FP_SCALE(-8.0f), FP_SCALE( 2.0f)}, /* 0x00 */ - {FP_SCALE(-6.0f), FP_SCALE(-4.0f)}, /* 0x01 */ - {FP_SCALE(-4.0f), FP_SCALE( 6.0f)}, /* 0x02 */ - {FP_SCALE( 2.0f), FP_SCALE( 8.0f)}, /* 0x03 */ - {FP_SCALE( 8.0f), FP_SCALE(-2.0f)}, /* 0x04 */ - {FP_SCALE( 6.0f), FP_SCALE( 4.0f)}, /* 0x05 */ - {FP_SCALE( 4.0f), FP_SCALE(-6.0f)}, /* 0x06 */ - {FP_SCALE(-2.0f), FP_SCALE(-8.0f)}, /* 0x07 */ - {FP_SCALE( 0.0f), FP_SCALE( 2.0f)}, /* 0x08 */ - {FP_SCALE(-6.0f), FP_SCALE( 4.0f)}, /* 0x09 */ - {FP_SCALE( 4.0f), FP_SCALE( 6.0f)}, /* 0x0A */ - {FP_SCALE( 2.0f), FP_SCALE( 0.0f)}, /* 0x0B */ - {FP_SCALE( 0.0f), FP_SCALE(-2.0f)}, /* 0x0C */ - {FP_SCALE( 6.0f), FP_SCALE(-4.0f)}, /* 0x0D */ - {FP_SCALE(-4.0f), FP_SCALE(-6.0f)}, /* 0x0E */ - {FP_SCALE(-2.0f), FP_SCALE( 0.0f)}, /* 0x0F */ - {FP_SCALE( 0.0f), FP_SCALE(-6.0f)}, /* 0x10 */ - {FP_SCALE( 2.0f), FP_SCALE(-4.0f)}, /* 0x11 */ - {FP_SCALE(-4.0f), FP_SCALE(-2.0f)}, /* 0x12 */ - {FP_SCALE(-6.0f), FP_SCALE( 0.0f)}, /* 0x13 */ - {FP_SCALE( 0.0f), FP_SCALE( 6.0f)}, /* 0x14 */ - {FP_SCALE(-2.0f), FP_SCALE( 4.0f)}, /* 0x15 */ - {FP_SCALE( 4.0f), FP_SCALE( 2.0f)}, /* 0x16 */ - {FP_SCALE( 6.0f), FP_SCALE( 0.0f)}, /* 0x17 */ - {FP_SCALE( 8.0f), FP_SCALE( 2.0f)}, /* 0x18 */ - {FP_SCALE( 2.0f), FP_SCALE( 4.0f)}, /* 0x19 */ - {FP_SCALE( 4.0f), FP_SCALE(-2.0f)}, /* 0x1A */ - {FP_SCALE( 2.0f), FP_SCALE(-8.0f)}, /* 0x1B */ - {FP_SCALE(-8.0f), FP_SCALE(-2.0f)}, /* 0x1C */ - {FP_SCALE(-2.0f), FP_SCALE(-4.0f)}, /* 0x1D */ - {FP_SCALE(-4.0f), FP_SCALE( 2.0f)}, /* 0x1E */ - {FP_SCALE(-2.0f), FP_SCALE( 8.0f)} /* 0x1F */ + {FP_CONSTELLATION_SCALE(-8.0f), FP_CONSTELLATION_SCALE( 2.0f)}, /* 0x00 */ + {FP_CONSTELLATION_SCALE(-6.0f), FP_CONSTELLATION_SCALE(-4.0f)}, /* 0x01 */ + {FP_CONSTELLATION_SCALE(-4.0f), FP_CONSTELLATION_SCALE( 6.0f)}, /* 0x02 */ + {FP_CONSTELLATION_SCALE( 2.0f), FP_CONSTELLATION_SCALE( 8.0f)}, /* 0x03 */ + {FP_CONSTELLATION_SCALE( 8.0f), FP_CONSTELLATION_SCALE(-2.0f)}, /* 0x04 */ + {FP_CONSTELLATION_SCALE( 6.0f), FP_CONSTELLATION_SCALE( 4.0f)}, /* 0x05 */ + {FP_CONSTELLATION_SCALE( 4.0f), FP_CONSTELLATION_SCALE(-6.0f)}, /* 0x06 */ + {FP_CONSTELLATION_SCALE(-2.0f), FP_CONSTELLATION_SCALE(-8.0f)}, /* 0x07 */ + {FP_CONSTELLATION_SCALE( 0.0f), FP_CONSTELLATION_SCALE( 2.0f)}, /* 0x08 */ + {FP_CONSTELLATION_SCALE(-6.0f), FP_CONSTELLATION_SCALE( 4.0f)}, /* 0x09 */ + {FP_CONSTELLATION_SCALE( 4.0f), FP_CONSTELLATION_SCALE( 6.0f)}, /* 0x0A */ + {FP_CONSTELLATION_SCALE( 2.0f), FP_CONSTELLATION_SCALE( 0.0f)}, /* 0x0B */ + {FP_CONSTELLATION_SCALE( 0.0f), FP_CONSTELLATION_SCALE(-2.0f)}, /* 0x0C */ + {FP_CONSTELLATION_SCALE( 6.0f), FP_CONSTELLATION_SCALE(-4.0f)}, /* 0x0D */ + {FP_CONSTELLATION_SCALE(-4.0f), FP_CONSTELLATION_SCALE(-6.0f)}, /* 0x0E */ + {FP_CONSTELLATION_SCALE(-2.0f), FP_CONSTELLATION_SCALE( 0.0f)}, /* 0x0F */ + {FP_CONSTELLATION_SCALE( 0.0f), FP_CONSTELLATION_SCALE(-6.0f)}, /* 0x10 */ + {FP_CONSTELLATION_SCALE( 2.0f), FP_CONSTELLATION_SCALE(-4.0f)}, /* 0x11 */ + {FP_CONSTELLATION_SCALE(-4.0f), FP_CONSTELLATION_SCALE(-2.0f)}, /* 0x12 */ + {FP_CONSTELLATION_SCALE(-6.0f), FP_CONSTELLATION_SCALE( 0.0f)}, /* 0x13 */ + {FP_CONSTELLATION_SCALE( 0.0f), FP_CONSTELLATION_SCALE( 6.0f)}, /* 0x14 */ + {FP_CONSTELLATION_SCALE(-2.0f), FP_CONSTELLATION_SCALE( 4.0f)}, /* 0x15 */ + {FP_CONSTELLATION_SCALE( 4.0f), FP_CONSTELLATION_SCALE( 2.0f)}, /* 0x16 */ + {FP_CONSTELLATION_SCALE( 6.0f), FP_CONSTELLATION_SCALE( 0.0f)}, /* 0x17 */ + {FP_CONSTELLATION_SCALE( 8.0f), FP_CONSTELLATION_SCALE( 2.0f)}, /* 0x18 */ + {FP_CONSTELLATION_SCALE( 2.0f), FP_CONSTELLATION_SCALE( 4.0f)}, /* 0x19 */ + {FP_CONSTELLATION_SCALE( 4.0f), FP_CONSTELLATION_SCALE(-2.0f)}, /* 0x1A */ + {FP_CONSTELLATION_SCALE( 2.0f), FP_CONSTELLATION_SCALE(-8.0f)}, /* 0x1B */ + {FP_CONSTELLATION_SCALE(-8.0f), FP_CONSTELLATION_SCALE(-2.0f)}, /* 0x1C */ + {FP_CONSTELLATION_SCALE(-2.0f), FP_CONSTELLATION_SCALE(-4.0f)}, /* 0x1D */ + {FP_CONSTELLATION_SCALE(-4.0f), FP_CONSTELLATION_SCALE( 2.0f)}, /* 0x1E */ + {FP_CONSTELLATION_SCALE(-2.0f), FP_CONSTELLATION_SCALE( 8.0f)} /* 0x1F */ }; #if defined(SPANDSP_USE_FIXED_POINTx) @@ -279,22 +278,22 @@ static const complexi16_t v17_v32bis_7200_constellation[16] = static const complexf_t v17_v32bis_7200_constellation[16] = #endif { - {FP_SCALE( 6.0f), FP_SCALE(-6.0f)}, /* 0x00 */ - {FP_SCALE(-2.0f), FP_SCALE( 6.0f)}, /* 0x01 */ - {FP_SCALE( 6.0f), FP_SCALE( 2.0f)}, /* 0x02 */ - {FP_SCALE(-6.0f), FP_SCALE(-6.0f)}, /* 0x03 */ - {FP_SCALE(-6.0f), FP_SCALE( 6.0f)}, /* 0x04 */ - {FP_SCALE( 2.0f), FP_SCALE(-6.0f)}, /* 0x05 */ - {FP_SCALE(-6.0f), FP_SCALE(-2.0f)}, /* 0x06 */ - {FP_SCALE( 6.0f), FP_SCALE( 6.0f)}, /* 0x07 */ - {FP_SCALE(-2.0f), FP_SCALE( 2.0f)}, /* 0x08 */ - {FP_SCALE( 6.0f), FP_SCALE(-2.0f)}, /* 0x09 */ - {FP_SCALE(-2.0f), FP_SCALE(-6.0f)}, /* 0x0A */ - {FP_SCALE( 2.0f), FP_SCALE( 2.0f)}, /* 0x0B */ - {FP_SCALE( 2.0f), FP_SCALE(-2.0f)}, /* 0x0C */ - {FP_SCALE(-6.0f), FP_SCALE( 2.0f)}, /* 0x0D */ - {FP_SCALE( 2.0f), FP_SCALE( 6.0f)}, /* 0x0E */ - {FP_SCALE(-2.0f), FP_SCALE(-2.0f)} /* 0x0F */ + {FP_CONSTELLATION_SCALE( 6.0f), FP_CONSTELLATION_SCALE(-6.0f)}, /* 0x00 */ + {FP_CONSTELLATION_SCALE(-2.0f), FP_CONSTELLATION_SCALE( 6.0f)}, /* 0x01 */ + {FP_CONSTELLATION_SCALE( 6.0f), FP_CONSTELLATION_SCALE( 2.0f)}, /* 0x02 */ + {FP_CONSTELLATION_SCALE(-6.0f), FP_CONSTELLATION_SCALE(-6.0f)}, /* 0x03 */ + {FP_CONSTELLATION_SCALE(-6.0f), FP_CONSTELLATION_SCALE( 6.0f)}, /* 0x04 */ + {FP_CONSTELLATION_SCALE( 2.0f), FP_CONSTELLATION_SCALE(-6.0f)}, /* 0x05 */ + {FP_CONSTELLATION_SCALE(-6.0f), FP_CONSTELLATION_SCALE(-2.0f)}, /* 0x06 */ + {FP_CONSTELLATION_SCALE( 6.0f), FP_CONSTELLATION_SCALE( 6.0f)}, /* 0x07 */ + {FP_CONSTELLATION_SCALE(-2.0f), FP_CONSTELLATION_SCALE( 2.0f)}, /* 0x08 */ + {FP_CONSTELLATION_SCALE( 6.0f), FP_CONSTELLATION_SCALE(-2.0f)}, /* 0x09 */ + {FP_CONSTELLATION_SCALE(-2.0f), FP_CONSTELLATION_SCALE(-6.0f)}, /* 0x0A */ + {FP_CONSTELLATION_SCALE( 2.0f), FP_CONSTELLATION_SCALE( 2.0f)}, /* 0x0B */ + {FP_CONSTELLATION_SCALE( 2.0f), FP_CONSTELLATION_SCALE(-2.0f)}, /* 0x0C */ + {FP_CONSTELLATION_SCALE(-6.0f), FP_CONSTELLATION_SCALE( 2.0f)}, /* 0x0D */ + {FP_CONSTELLATION_SCALE( 2.0f), FP_CONSTELLATION_SCALE( 6.0f)}, /* 0x0E */ + {FP_CONSTELLATION_SCALE(-2.0f), FP_CONSTELLATION_SCALE(-2.0f)} /* 0x0F */ }; /* This one does not exist in V.17 as a data constellation. It is only @@ -305,10 +304,10 @@ static const complexi16_t v17_v32bis_4800_constellation[4] = static const complexf_t v17_v32bis_4800_constellation[4] = #endif { - {FP_SCALE(-6.0f), FP_SCALE(-2.0f)}, /* 0x00 */ - {FP_SCALE(-2.0f), FP_SCALE( 6.0f)}, /* 0x01 */ - {FP_SCALE( 2.0f), FP_SCALE(-6.0f)}, /* 0x02 */ - {FP_SCALE( 6.0f), FP_SCALE( 2.0f)} /* 0x03 */ + {FP_CONSTELLATION_SCALE(-6.0f), FP_CONSTELLATION_SCALE(-2.0f)}, /* 0x00 */ + {FP_CONSTELLATION_SCALE(-2.0f), FP_CONSTELLATION_SCALE( 6.0f)}, /* 0x01 */ + {FP_CONSTELLATION_SCALE( 2.0f), FP_CONSTELLATION_SCALE(-6.0f)}, /* 0x02 */ + {FP_CONSTELLATION_SCALE( 6.0f), FP_CONSTELLATION_SCALE( 2.0f)} /* 0x03 */ }; #if defined(SPANDSP_USE_FIXED_POINTx) @@ -317,10 +316,10 @@ static const complexi16_t v17_v32bis_abcd_constellation[4] = static const complexf_t v17_v32bis_abcd_constellation[4] = #endif { - {FP_SCALE(-6.0f), FP_SCALE(-2.0f)}, /* A */ - {FP_SCALE( 2.0f), FP_SCALE(-6.0f)}, /* B */ - {FP_SCALE( 6.0f), FP_SCALE( 2.0f)}, /* C */ - {FP_SCALE(-2.0f), FP_SCALE( 6.0f)} /* D */ + {FP_CONSTELLATION_SCALE(-6.0f), FP_CONSTELLATION_SCALE(-2.0f)}, /* A */ + {FP_CONSTELLATION_SCALE( 2.0f), FP_CONSTELLATION_SCALE(-6.0f)}, /* B */ + {FP_CONSTELLATION_SCALE( 6.0f), FP_CONSTELLATION_SCALE( 2.0f)}, /* C */ + {FP_CONSTELLATION_SCALE(-2.0f), FP_CONSTELLATION_SCALE( 6.0f)} /* D */ }; /*- End of file ------------------------------------------------------------*/ diff --git a/libs/spandsp/src/v17rx.c b/libs/spandsp/src/v17rx.c index 46480ee19b..9aae8bfbf1 100644 --- a/libs/spandsp/src/v17rx.c +++ b/libs/spandsp/src/v17rx.c @@ -69,11 +69,14 @@ #define FP_SCALE(x) FP_Q_6_10(x) #define FP_FACTOR 1024 #define FP_SHIFT_FACTOR 12 -#include "v17_v32bis_rx_fixed_rrc.h" #else #define FP_SCALE(x) (x) -#include "v17_v32bis_rx_floating_rrc.h" #endif + +#include "v17_v32bis_rx_rrc.h" + +#define FP_CONSTELLATION_SCALE(x) FP_SCALE(x) + #include "v17_v32bis_tx_constellation_maps.h" #include "v17_v32bis_rx_constellation_maps.h" diff --git a/libs/spandsp/src/v17tx.c b/libs/spandsp/src/v17tx.c index 56d3fa13a0..fe361d7744 100644 --- a/libs/spandsp/src/v17tx.c +++ b/libs/spandsp/src/v17tx.c @@ -63,44 +63,42 @@ #include "spandsp/private/v17tx.h" #if defined(SPANDSP_USE_FIXED_POINT) -#define FP_SCALE(x) ((int16_t) x) +#define FP_SCALE(x) ((int16_t) x) #else -#define FP_SCALE(x) (x) +#define FP_SCALE(x) (x) #endif +#define FP_CONSTELLATION_SCALE(x) FP_SCALE(x) + #include "v17_v32bis_tx_constellation_maps.h" -#if defined(SPANDSP_USE_FIXED_POINT) -#include "v17_v32bis_tx_fixed_rrc.h" -#else -#include "v17_v32bis_tx_floating_rrc.h" -#endif +#include "v17_v32bis_tx_rrc.h" /*! The nominal frequency of the carrier, in Hertz */ -#define CARRIER_NOMINAL_FREQ 1800.0f +#define CARRIER_NOMINAL_FREQ 1800.0f /* Segments of the training sequence */ /*! The start of the optional TEP, that may preceed the actual training, in symbols */ -#define V17_TRAINING_SEG_TEP_A 0 +#define V17_TRAINING_SEG_TEP_A 0 /*! The mid point of the optional TEP, that may preceed the actual training, in symbols */ -#define V17_TRAINING_SEG_TEP_B (V17_TRAINING_SEG_TEP_A + 480) +#define V17_TRAINING_SEG_TEP_B (V17_TRAINING_SEG_TEP_A + 480) /*! The start of training segment 1, in symbols */ -#define V17_TRAINING_SEG_1 (V17_TRAINING_SEG_TEP_B + 48) +#define V17_TRAINING_SEG_1 (V17_TRAINING_SEG_TEP_B + 48) /*! The start of training segment 2, in symbols */ -#define V17_TRAINING_SEG_2 (V17_TRAINING_SEG_1 + 256) +#define V17_TRAINING_SEG_2 (V17_TRAINING_SEG_1 + 256) /*! The start of training segment 3, in symbols */ -#define V17_TRAINING_SEG_3 (V17_TRAINING_SEG_2 + 2976) +#define V17_TRAINING_SEG_3 (V17_TRAINING_SEG_2 + 2976) /*! The start of training segment 4, in symbols */ -#define V17_TRAINING_SEG_4 (V17_TRAINING_SEG_3 + 64) +#define V17_TRAINING_SEG_4 (V17_TRAINING_SEG_3 + 64) /*! The start of training segment 4 in short training mode, in symbols */ -#define V17_TRAINING_SHORT_SEG_4 (V17_TRAINING_SEG_2 + 38) +#define V17_TRAINING_SHORT_SEG_4 (V17_TRAINING_SEG_2 + 38) /*! The end of the training, in symbols */ -#define V17_TRAINING_END (V17_TRAINING_SEG_4 + 48) -#define V17_TRAINING_SHUTDOWN_A (V17_TRAINING_END + 32) +#define V17_TRAINING_END (V17_TRAINING_SEG_4 + 48) +#define V17_TRAINING_SHUTDOWN_A (V17_TRAINING_END + 32) /*! The end of the shutdown sequence, in symbols */ -#define V17_TRAINING_SHUTDOWN_END (V17_TRAINING_SHUTDOWN_A + 48) +#define V17_TRAINING_SHUTDOWN_END (V17_TRAINING_SHUTDOWN_A + 48) /*! The 16 bit pattern used in the bridge section of the training sequence */ -#define V17_BRIDGE_WORD 0x8880 +#define V17_BRIDGE_WORD 0x8880 static __inline__ int scramble(v17_tx_state_t *s, int in_bit) { diff --git a/libs/spandsp/src/v22bis_rx.c b/libs/spandsp/src/v22bis_rx.c index c4898cf1cd..c00c62b47c 100644 --- a/libs/spandsp/src/v22bis_rx.c +++ b/libs/spandsp/src/v22bis_rx.c @@ -75,14 +75,13 @@ #if defined(SPANDSP_USE_FIXED_POINT) #define FP_SHIFT_FACTOR 10 #define FP_SCALE FP_Q_6_10 -#include "v22bis_rx_1200_fixed_rrc.h" -#include "v22bis_rx_2400_fixed_rrc.h" #else #define FP_SCALE(x) (x) -#include "v22bis_rx_1200_floating_rrc.h" -#include "v22bis_rx_2400_floating_rrc.h" #endif +#include "v22bis_rx_1200_rrc.h" +#include "v22bis_rx_2400_rrc.h" + #define ms_to_symbols(t) (((t)*600)/1000) /*! The adaption rate coefficient for the equalizer */ diff --git a/libs/spandsp/src/v22bis_tx.c b/libs/spandsp/src/v22bis_tx.c index 8b5068803e..0c43b95a07 100644 --- a/libs/spandsp/src/v22bis_tx.c +++ b/libs/spandsp/src/v22bis_tx.c @@ -64,12 +64,12 @@ #if defined(SPANDSP_USE_FIXED_POINT) #define FP_SCALE FP_Q_6_10 -#include "v22bis_tx_fixed_rrc.h" #else #define FP_SCALE(x) (x) -#include "v22bis_tx_floating_rrc.h" #endif +#include "v22bis_tx_rrc.h" + /* Quoting from the V.22bis spec. 6.3.1.1 Interworking at 2400 bit/s diff --git a/libs/spandsp/src/v27ter_rx.c b/libs/spandsp/src/v27ter_rx.c index ce0537b560..7e1fb9929b 100644 --- a/libs/spandsp/src/v27ter_rx.c +++ b/libs/spandsp/src/v27ter_rx.c @@ -68,14 +68,13 @@ #define FP_SCALE FP_Q_6_10 #define FP_FACTOR 4096 #define FP_SHIFT_FACTOR 12 -#include "v27ter_rx_4800_fixed_rrc.h" -#include "v27ter_rx_2400_fixed_rrc.h" #else #define FP_SCALE(x) (x) -#include "v27ter_rx_4800_floating_rrc.h" -#include "v27ter_rx_2400_floating_rrc.h" #endif +#include "v27ter_rx_4800_rrc.h" +#include "v27ter_rx_2400_rrc.h" + /* V.27ter is a DPSK modem, but this code treats it like QAM. It nails down the signal to a static constellation, even though dealing with differences is all that is necessary. */ @@ -272,6 +271,34 @@ static void tune_equalizer(v27ter_rx_state_t *s, const complexf_t *z, const comp #endif /*- End of function --------------------------------------------------------*/ +#if defined(SPANDSP_USE_FIXED_POINT) +static __inline__ void track_carrier(v27ter_rx_state_t *s, const complexi16_t *z, const complexi16_t *target) +#else +static __inline__ void track_carrier(v27ter_rx_state_t *s, const complexf_t *z, const complexf_t *target) +#endif +{ +#if defined(SPANDSP_USE_FIXED_POINT) + int32_t error; +#else + float error; +#endif + + /* For small errors the imaginary part of the difference between the actual and the target + positions is proportional to the phase error, for any particular target. However, the + different amplitudes of the various target positions scale things. */ +#if defined(SPANDSP_USE_FIXED_POINT) + error = ((int32_t) z->im*target->re - (int32_t) z->re*target->im) >> 10; + s->carrier_phase_rate += ((s->carrier_track_i*error) >> FP_SHIFT_FACTOR); + s->carrier_phase += ((s->carrier_track_p*error) >> FP_SHIFT_FACTOR); +#else + error = z->im*target->re - z->re*target->im; + s->carrier_phase_rate += (int32_t) (s->carrier_track_i*error); + s->carrier_phase += (int32_t) (s->carrier_track_p*error); + //span_log(&s->logging, SPAN_LOG_FLOW, "Im = %15.5f f = %15.5f\n", error, dds_frequencyf(s->carrier_phase_rate)); +#endif +} +/*- End of function --------------------------------------------------------*/ + #if defined(SPANDSP_USE_FIXED_POINT) static __inline__ int find_quadrant(const complexi16_t *z) #else @@ -337,38 +364,11 @@ static __inline__ int find_octant(complexf_t *z) } /*- End of function --------------------------------------------------------*/ -#if defined(SPANDSP_USE_FIXED_POINT) -static __inline__ void track_carrier(v27ter_rx_state_t *s, const complexi16_t *z, const complexi16_t *target) -#else -static __inline__ void track_carrier(v27ter_rx_state_t *s, const complexf_t *z, const complexf_t *target) -#endif -{ -#if defined(SPANDSP_USE_FIXED_POINT) - int32_t error; -#else - float error; -#endif - - /* For small errors the imaginary part of the difference between the actual and the target - positions is proportional to the phase error, for any particular target. However, the - different amplitudes of the various target positions scale things. */ -#if defined(SPANDSP_USE_FIXED_POINT) - error = ((int32_t) z->im*target->re - (int32_t) z->re*target->im) >> 10; - s->carrier_phase_rate += ((s->carrier_track_i*error) >> FP_SHIFT_FACTOR); - s->carrier_phase += ((s->carrier_track_p*error) >> FP_SHIFT_FACTOR); -#else - error = z->im*target->re - z->re*target->im; - s->carrier_phase_rate += (int32_t) (s->carrier_track_i*error); - s->carrier_phase += (int32_t) (s->carrier_track_p*error); - //span_log(&s->logging, SPAN_LOG_FLOW, "Im = %15.5f f = %15.5f\n", error, dds_frequencyf(s->carrier_phase_rate)); -#endif -} -/*- End of function --------------------------------------------------------*/ - static __inline__ int descramble(v27ter_rx_state_t *s, int in_bit) { int out_bit; + in_bit &= 1; out_bit = (in_bit ^ (s->scramble_reg >> 5) ^ (s->scramble_reg >> 6)) & 1; if (s->scrambler_pattern_count >= 33) { diff --git a/libs/spandsp/src/v27ter_tx.c b/libs/spandsp/src/v27ter_tx.c index a877915271..f1d7ce263d 100644 --- a/libs/spandsp/src/v27ter_tx.c +++ b/libs/spandsp/src/v27ter_tx.c @@ -60,14 +60,13 @@ #if defined(SPANDSP_USE_FIXED_POINT) #define FP_SCALE FP_Q_6_10 -#include "v27ter_tx_4800_fixed_rrc.h" -#include "v27ter_tx_2400_fixed_rrc.h" #else #define FP_SCALE(x) (x) -#include "v27ter_tx_4800_floating_rrc.h" -#include "v27ter_tx_2400_floating_rrc.h" #endif +#include "v27ter_tx_4800_rrc.h" +#include "v27ter_tx_2400_rrc.h" + /*! The nominal frequency of the carrier, in Hertz */ #define CARRIER_NOMINAL_FREQ 1800.0f diff --git a/libs/spandsp/src/v29rx.c b/libs/spandsp/src/v29rx.c index 33e4d0b161..525532a392 100644 --- a/libs/spandsp/src/v29rx.c +++ b/libs/spandsp/src/v29rx.c @@ -67,14 +67,16 @@ #define FP_SCALE FP_Q_4_12 #define FP_FACTOR 4096 #define FP_SHIFT_FACTOR 12 -#include "v29tx_constellation_maps.h" -#include "v29rx_fixed_rrc.h" #else #define FP_SCALE(x) (x) -#include "v29tx_constellation_maps.h" -#include "v29rx_floating_rrc.h" #endif +#include "v29rx_rrc.h" + +#define FP_CONSTELLATION_SCALE(x) FP_SCALE(x) + +#include "v29tx_constellation_maps.h" + /*! The nominal frequency of the carrier, in Hertz */ #define CARRIER_NOMINAL_FREQ 1700.0f /*! The nominal baud or symbol rate */ @@ -104,6 +106,7 @@ enum static const uint8_t space_map_9600[20][20] = { + /* Middle V Middle */ {13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11}, {13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11}, {13, 13, 13, 13, 13, 13, 13, 4, 4, 4, 4, 4, 4, 11, 11, 11, 11, 11, 11, 11}, @@ -113,8 +116,8 @@ static const uint8_t space_map_9600[20][20] = {14, 13, 13, 13, 13, 13, 5, 5, 5, 5, 3, 3, 3, 3, 11, 11, 11, 11, 11, 10}, {14, 14, 6, 6, 6, 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, 2, 2, 2, 10, 10}, {14, 14, 6, 6, 6, 6, 5, 5, 5, 5, 3, 3, 3, 3, 2, 2, 2, 2, 10, 10}, - {14, 14, 6, 6, 6, 6, 5, 5, 5, 5, 3, 3, 3, 3, 2, 2, 2, 2, 10, 10}, - {14, 14, 6, 6, 6, 6, 7, 7, 7, 7, 1, 1, 1, 1, 2, 2, 2, 2, 10, 10}, + {14, 14, 6, 6, 6, 6, 5, 5, 5, 5, 3, 3, 3, 3, 2, 2, 2, 2, 10, 10}, /* << Middle */ + {14, 14, 6, 6, 6, 6, 7, 7, 7, 7, 1, 1, 1, 1, 2, 2, 2, 2, 10, 10}, /* << Middle */ {14, 14, 6, 6, 6, 6, 7, 7, 7, 7, 1, 1, 1, 1, 2, 2, 2, 2, 10, 10}, {14, 14, 6, 6, 6, 7, 7, 7, 7, 7, 1, 1, 1, 1, 1, 2, 2, 2, 10, 10}, {14, 15, 15, 15, 15, 15, 7, 7, 7, 7, 1, 1, 1, 1, 9, 9, 9, 9, 9, 10}, @@ -124,6 +127,7 @@ static const uint8_t space_map_9600[20][20] = {15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9}, {15, 15, 15, 15, 15, 15, 15, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9}, {15, 15, 15, 15, 15, 15, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9} + /* Middle ^ Middle */ }; /* Coefficients for the band edge symbol timing synchroniser (alpha = 0.99) */ diff --git a/libs/spandsp/src/v29tx.c b/libs/spandsp/src/v29tx.c index 7604ae4ac1..868b9ac341 100644 --- a/libs/spandsp/src/v29tx.c +++ b/libs/spandsp/src/v29tx.c @@ -58,13 +58,18 @@ #include "spandsp/private/logging.h" #include "spandsp/private/v29tx.h" -#include "v29tx_constellation_maps.h" #if defined(SPANDSP_USE_FIXED_POINT) -#include "v29tx_fixed_rrc.h" +#define FP_SCALE(x) ((int16_t) x) #else -#include "v29tx_floating_rrc.h" +#define FP_SCALE(x) (x) #endif +#define FP_CONSTELLATION_SCALE(x) FP_SCALE(x) + +#include "v29tx_constellation_maps.h" + +#include "v29tx_rrc.h" + /*! The nominal frequency of the carrier, in Hertz */ #define CARRIER_NOMINAL_FREQ 1700.0f diff --git a/libs/spandsp/src/v29tx_constellation_maps.h b/libs/spandsp/src/v29tx_constellation_maps.h index f141b336bb..2178ad2ace 100644 --- a/libs/spandsp/src/v29tx_constellation_maps.h +++ b/libs/spandsp/src/v29tx_constellation_maps.h @@ -6,7 +6,7 @@ * * Written by Steve Underwood * - * Copyright (C) 2008 Steve Underwood + * Copyright (C) 2008, 2012 Steve Underwood * * All rights reserved. * @@ -24,26 +24,18 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#if !defined(FP_SCALE) -#if defined(SPANDSP_USE_FIXED_POINT) -#define FP_SCALE(x) ((int16_t) x) -#else -#define FP_SCALE(x) (x) -#endif -#endif - #if defined(SPANDSP_USE_FIXED_POINT) static const complexi16_t v29_abab_constellation[6] = #else static const complexf_t v29_abab_constellation[6] = #endif { - {FP_SCALE( 3.0f), FP_SCALE(-3.0f)}, /* 315deg high 9600 */ - {FP_SCALE(-3.0f), FP_SCALE( 0.0f)}, /* 180deg low */ - {FP_SCALE( 1.0f), FP_SCALE(-1.0f)}, /* 315deg low 7200 */ - {FP_SCALE(-3.0f), FP_SCALE( 0.0f)}, /* 180deg low */ - {FP_SCALE( 0.0f), FP_SCALE(-3.0f)}, /* 270deg low 4800 */ - {FP_SCALE(-3.0f), FP_SCALE( 0.0f)} /* 180deg low */ + {FP_CONSTELLATION_SCALE( 3.0f), FP_CONSTELLATION_SCALE(-3.0f)}, /* 315deg high 9600 */ + {FP_CONSTELLATION_SCALE(-3.0f), FP_CONSTELLATION_SCALE( 0.0f)}, /* 180deg low */ + {FP_CONSTELLATION_SCALE( 1.0f), FP_CONSTELLATION_SCALE(-1.0f)}, /* 315deg low 7200 */ + {FP_CONSTELLATION_SCALE(-3.0f), FP_CONSTELLATION_SCALE( 0.0f)}, /* 180deg low */ + {FP_CONSTELLATION_SCALE( 0.0f), FP_CONSTELLATION_SCALE(-3.0f)}, /* 270deg low 4800 */ + {FP_CONSTELLATION_SCALE(-3.0f), FP_CONSTELLATION_SCALE( 0.0f)} /* 180deg low */ }; #if defined(SPANDSP_USE_FIXED_POINT) @@ -52,12 +44,12 @@ static const complexi16_t v29_cdcd_constellation[6] = static const complexf_t v29_cdcd_constellation[6] = #endif { - {FP_SCALE( 3.0f), FP_SCALE( 0.0f)}, /* 0deg low 9600 */ - {FP_SCALE(-3.0f), FP_SCALE( 3.0f)}, /* 135deg high */ - {FP_SCALE( 3.0f), FP_SCALE( 0.0f)}, /* 0deg low 7200 */ - {FP_SCALE(-1.0f), FP_SCALE( 1.0f)}, /* 135deg low */ - {FP_SCALE( 3.0f), FP_SCALE( 0.0f)}, /* 0deg low 4800 */ - {FP_SCALE( 0.0f), FP_SCALE( 3.0f)} /* 90deg low */ + {FP_CONSTELLATION_SCALE( 3.0f), FP_CONSTELLATION_SCALE( 0.0f)}, /* 0deg low 9600 */ + {FP_CONSTELLATION_SCALE(-3.0f), FP_CONSTELLATION_SCALE( 3.0f)}, /* 135deg high */ + {FP_CONSTELLATION_SCALE( 3.0f), FP_CONSTELLATION_SCALE( 0.0f)}, /* 0deg low 7200 */ + {FP_CONSTELLATION_SCALE(-1.0f), FP_CONSTELLATION_SCALE( 1.0f)}, /* 135deg low */ + {FP_CONSTELLATION_SCALE( 3.0f), FP_CONSTELLATION_SCALE( 0.0f)}, /* 0deg low 4800 */ + {FP_CONSTELLATION_SCALE( 0.0f), FP_CONSTELLATION_SCALE( 3.0f)} /* 90deg low */ }; #if defined(SPANDSP_USE_FIXED_POINT) @@ -66,22 +58,22 @@ static const complexi16_t v29_9600_constellation[16] = static const complexf_t v29_9600_constellation[16] = #endif { - {FP_SCALE( 3.0f), FP_SCALE( 0.0f)}, /* 0deg low */ - {FP_SCALE( 1.0f), FP_SCALE( 1.0f)}, /* 45deg low */ - {FP_SCALE( 0.0f), FP_SCALE( 3.0f)}, /* 90deg low */ - {FP_SCALE(-1.0f), FP_SCALE( 1.0f)}, /* 135deg low */ - {FP_SCALE(-3.0f), FP_SCALE( 0.0f)}, /* 180deg low */ - {FP_SCALE(-1.0f), FP_SCALE(-1.0f)}, /* 225deg low */ - {FP_SCALE( 0.0f), FP_SCALE(-3.0f)}, /* 270deg low */ - {FP_SCALE( 1.0f), FP_SCALE(-1.0f)}, /* 315deg low */ - {FP_SCALE( 5.0f), FP_SCALE( 0.0f)}, /* 0deg high */ - {FP_SCALE( 3.0f), FP_SCALE( 3.0f)}, /* 45deg high */ - {FP_SCALE( 0.0f), FP_SCALE( 5.0f)}, /* 90deg high */ - {FP_SCALE(-3.0f), FP_SCALE( 3.0f)}, /* 135deg high */ - {FP_SCALE(-5.0f), FP_SCALE( 0.0f)}, /* 180deg high */ - {FP_SCALE(-3.0f), FP_SCALE(-3.0f)}, /* 225deg high */ - {FP_SCALE( 0.0f), FP_SCALE(-5.0f)}, /* 270deg high */ - {FP_SCALE( 3.0f), FP_SCALE(-3.0f)} /* 315deg high */ + {FP_CONSTELLATION_SCALE( 3.0f), FP_CONSTELLATION_SCALE( 0.0f)}, /* 0deg low */ + {FP_CONSTELLATION_SCALE( 1.0f), FP_CONSTELLATION_SCALE( 1.0f)}, /* 45deg low */ + {FP_CONSTELLATION_SCALE( 0.0f), FP_CONSTELLATION_SCALE( 3.0f)}, /* 90deg low */ + {FP_CONSTELLATION_SCALE(-1.0f), FP_CONSTELLATION_SCALE( 1.0f)}, /* 135deg low */ + {FP_CONSTELLATION_SCALE(-3.0f), FP_CONSTELLATION_SCALE( 0.0f)}, /* 180deg low */ + {FP_CONSTELLATION_SCALE(-1.0f), FP_CONSTELLATION_SCALE(-1.0f)}, /* 225deg low */ + {FP_CONSTELLATION_SCALE( 0.0f), FP_CONSTELLATION_SCALE(-3.0f)}, /* 270deg low */ + {FP_CONSTELLATION_SCALE( 1.0f), FP_CONSTELLATION_SCALE(-1.0f)}, /* 315deg low */ + {FP_CONSTELLATION_SCALE( 5.0f), FP_CONSTELLATION_SCALE( 0.0f)}, /* 0deg high */ + {FP_CONSTELLATION_SCALE( 3.0f), FP_CONSTELLATION_SCALE( 3.0f)}, /* 45deg high */ + {FP_CONSTELLATION_SCALE( 0.0f), FP_CONSTELLATION_SCALE( 5.0f)}, /* 90deg high */ + {FP_CONSTELLATION_SCALE(-3.0f), FP_CONSTELLATION_SCALE( 3.0f)}, /* 135deg high */ + {FP_CONSTELLATION_SCALE(-5.0f), FP_CONSTELLATION_SCALE( 0.0f)}, /* 180deg high */ + {FP_CONSTELLATION_SCALE(-3.0f), FP_CONSTELLATION_SCALE(-3.0f)}, /* 225deg high */ + {FP_CONSTELLATION_SCALE( 0.0f), FP_CONSTELLATION_SCALE(-5.0f)}, /* 270deg high */ + {FP_CONSTELLATION_SCALE( 3.0f), FP_CONSTELLATION_SCALE(-3.0f)} /* 315deg high */ }; /*- End of file ------------------------------------------------------------*/ diff --git a/libs/spandsp/tests/regression_tests.sh b/libs/spandsp/tests/regression_tests.sh index 224fb5fd62..31aeb5a952 100755 --- a/libs/spandsp/tests/regression_tests.sh +++ b/libs/spandsp/tests/regression_tests.sh @@ -25,6 +25,15 @@ STDERR_DEST=xyzzy2 echo Performing basic spandsp regression tests echo +./ademco_contactid_tests >$STDOUT_DEST 2>$STDERR_DEST +RETVAL=$? +if [ $RETVAL != 0 ] +then + echo ademco_contactid_tests failed! + exit $RETVAL +fi +echo ademco_contactid_tests completed OK + ./adsi_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ]