g168models.h

Go to the documentation of this file.
00001 /*
00002  * SpanDSP - a series of DSP components for telephony
00003  *
00004  * g168models.h - line models for echo cancellation tests against the G.168
00005  *                spec.
00006  *
00007  * Written by Steve Underwood <steveu@coppice.org>
00008  *
00009  * Copyright (C) 2001 Steve Underwood
00010  *
00011  * All rights reserved.
00012  *
00013  * This program is free software; you can redistribute it and/or modify
00014  * it under the terms of the GNU Lesser General Public License version 2.1,
00015  * as published by the Free Software Foundation.
00016  *
00017  * This program is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  * GNU Lesser General Public License for more details.
00021  *
00022  * You should have received a copy of the GNU Lesser General Public
00023  * License along with this program; if not, write to the Free Software
00024  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00025  *
00026  * $Id: g168models.h,v 1.9 2008/08/29 09:28:13 steveu Exp $
00027  */
00028 
00029 /*! \file */
00030 
00031 #if !defined(_SPANDSP_G168MODELS_H_)
00032 #define _SPANDSP_G168MODELS_H_
00033 
00034 /*! \page g168_test_data_page The test data from the G.168 specification
00035 */
00036 
00037 /*!
00038     The line model from section D.2 of G.168.
00039 
00040     These are the coefficients for the line simulation model defined in
00041     section D.2 of G.168. It may be used with the fir32_xxx
00042     routines to build a line simulator.
00043 */
00044 const int32_t line_model_d2_coeffs[] =
00045 {
00046       -436,   -829,  -2797,  -4208, -17968, -11215,  46150,  34480,
00047     -10427,   9049,  -1309,  -6320,    390,  -8191,  -1751,  -6051,
00048      -3796,  -4055,  -3948,  -2557,  -3372,  -1808,  -2259,  -1300, 
00049      -1098,   -618,   -340,    -61,    323,    419,    745,    716,
00050        946,    880,   1014,    976,   1033,   1091,   1053,   1042,
00051        794,    831,    899,    716,    390,    313,    304,    304, 
00052         73,   -119,   -109,   -176,   -359,   -407,   -512,   -580,
00053       -704,   -618,   -685,   -791,   -772,   -820,   -839,   -724  
00054 };
00055 #define LINE_MODEL_D2_GAIN      1.39E-5f
00056 
00057 /*!
00058     The line model from section D.3 of G.168.
00059 
00060     These are the coefficients for the line simulation model defined in
00061     section D.3 of G.168. It may be used with the fir32_xxx
00062     routines to build a line simulator.
00063 */
00064 const int32_t line_model_d3_coeffs[] =
00065 {
00066       -381,    658,   1730,    -51,  -3511,  -1418,   7660,   8861,
00067      -8106, -21370,  -5307,  23064,  24020,   1020, -12374, -16296,
00068     -19524,  -7480,  13509,  17115,  13952,  13952,     97,  -9326,
00069      -9046, -15208,  -9853,  -3858,  -1979,   6029,   5616,   7214,
00070       6820,   3935,   3919,    921,   1316,   -693,   -759,  -1517,
00071      -2176,  -2028,  -2654,  -1814,  -2077,  -1468,  -1221,   -842,
00072       -463,   -298,    -68,     64,    493,    723,    789,    954,
00073        756,    839,    872,   1020,    789,    822,    558,    658,
00074        476,    377,    377,    262,     97,    -68,   -183,   -232,
00075       -331,   -347,   -430,   -314,   -430,   -463,   -463,   -414,
00076       -381,   -479,   -479,   -512,   -479,   -397,   -430,   -397,
00077       -298,   -265,   -249,   -216,   -249,   -265,   -166,   -232
00078 };
00079 #define LINE_MODEL_D3_GAIN      1.44E-5f
00080 
00081 /*!
00082     The line model from section D.4 of G.168.
00083 
00084     These are the coefficients for the line simulation model defined in
00085     section D.4 of G.168. It may be used with the fir32_xxx
00086     routines to build a line simulator.
00087 */
00088 const int32_t line_model_d4_coeffs[] =
00089 {
00090       -448,   -436,   2230,   2448,  -4178,  -7050,   5846,  18581,
00091       2322, -26261, -16249,  21637,  25649,  -2267, -10311,  -4693,
00092     -12690,  -7428,  14164,  13467,   4438,   8627,    456, -11879,
00093      -6352,  -5104,  -7496,   3271,   6566,   4277,  11131,   7562,
00094       1475,   3728,  -3525,  -7301,  -3101,  -9269,  -6146,  -2553,
00095      -6272,    811,    124,    788,   5147,   2172,   5387,   4598,
00096       3535,   4004,   2311,   2150,   1017,    330,   -139,   -573,
00097      -1100,  -1157,  -1180,  -1455,  -1123,  -1386,  -1123,  -1066,
00098      -1020,  -1100,  -1008,  -1077,  -1088,   -917,   -917,   -963,
00099       -814,   -871,   -734,   -642,   -562,   -356,   -379,   -345,
00100       -230,   -233,   -333,   -356,   -390,   -310,   -265,   -368,
00101       -310,   -310,   -390,   -482,   -459,   -482,   -551,   -573
00102 };
00103 #define LINE_MODEL_D4_GAIN      1.52E-5f
00104 
00105 /*!
00106     The line model from section D.5 of G.168.
00107 
00108     These are the coefficients for the line simulation model defined in
00109     section D.5 of G.168. It may be used with the fir32_xxx
00110     routines to build a line simulator.
00111 */
00112 const int32_t line_model_d5_coeffs[] =
00113 {
00114        160,    312,   -241,   -415,    897,    908,  -1326,  -1499,
00115       2405,   3347,  -3624,  -7733,   4041,  14484,  -1477, -21739,
00116      -4470,  25356,  11458, -19696, -11800,   5766,    789,   6633,
00117      14624,  -6975, -17156,   -187,    149,   1515,  14907,   4345,
00118      -7128,  -2757, -10185,  -7083,   6850,   3944,   6969,   8694,
00119      -4068,  -3852,  -5793,  -9371,    453,   1060,   3965,   9463, 
00120       2393,   2784,   -892,  -7366,  -3376,  -5847,  -2399,   3011,
00121       1537,   6623,   4205,   1602,   1592,  -4752,  -3646,  -5207,
00122      -5577,   -501,  -1174,   4041,   5647,   4628,   7252,   2123, 
00123       2654,   -881,  -4113,  -3244,  -7289,  -3830,  -4600,  -2508,
00124        431,   -144,   4184,   2372,   4617,   3576,   2382,   2839,
00125       -404,    539,  -1803,  -1401,  -1705,  -2269,   -783,  -1608, 
00126       -220,   -306,    257,    615,    225,    561,      8,    344,
00127        127,    -57,    182,     41,    203,   -111,     95,    -79,
00128         30,     84,    -13,    -68,   -241,    -68,    -24,     19, 
00129        -57,    -24,     30,    -68,     84,   -155,    -68,     19
00130 };
00131 #define LINE_MODEL_D5_GAIN      1.77E-5f
00132 
00133 /*!
00134     The line model from section D.6 of G.168.
00135 
00136     These are the coefficients for the line simulation model defined in
00137     section D.6 of G.168. It may be used with the fir32_xxx
00138     routines to build a line simulator.
00139 */
00140 const int32_t line_model_d6_coeffs[] =
00141 {
00142        293,    268,    475,    460,    517,    704,    581,    879,
00143        573,    896,    604,    787,    561,    538,    440,     97,
00144        265,   -385,     20,   -938,   -523,  -1438,  -1134,  -1887,
00145      -1727,  -1698,  -4266, -22548, -43424,   2743,  25897,   7380,
00146      21499,  11983,  10400,  11667,   3889,   7241,    925,   2018,
00147       -821,  -2068,  -2236,  -4283,  -3406,  -5022,  -4039,  -4842,
00148      -4104,  -4089,  -3582,  -2978,  -2734,  -1805,  -1608,   -645,
00149       -495,    279,    471,    947,   1186,   1438,   1669,   1640,
00150       1901,   1687,   1803,   1543,   1566,   1342,   1163,    963, 
00151        733,    665,    323,    221,    -14,   -107,   -279,   -379,
00152       -468,   -513,   -473,   -588,   -612,   -652,   -616,   -566,
00153       -515,   -485,   -404,   -344,   -290,   -202,   -180,   -123
00154 };
00155 #define LINE_MODEL_D6_GAIN      9.33E-6f
00156 
00157 /*!
00158     The line model from section D.7 of G.168.
00159 
00160     These are the coefficients for the line simulation model defined in
00161     section D.8 of G.168. It may be used with the fir32_xxx
00162     routines to build a line simulator.
00163 */
00164 const int32_t line_model_d7_coeffs[] =
00165 {
00166         29,    109,    -83,    198,   -294,   -135,   -415,   -202,
00167       -444,   -337,   -313,   -450,   -105,   -503,    145,   -490,
00168        267,   -231,    340,     77,    343,    783,    158,   1341,
00169        195,   1798,    344,   1845,    629,   1604,   1182,    940,
00170       5163,  19522,   8421, -50953,  -9043,  18046, -13553,  13336,
00171      -3471,   -107,   1788,  -7409,   2469,  -7994,    490,  -3860,
00172       -837,    490,   -636,   3682,   1141,   5019,   2635,   5025,
00173       3946,   4414,   4026,   3005,   3380,   1616,   2007,    158,
00174        388,  -1198,  -1117,  -2134,  -2547,  -2589,  -3310,  -2778,
00175      -3427,  -2779,  -3116,  -2502,  -2399,  -1956,  -1539,  -1239,
00176       -570,   -377,    251,    331,    964,   1177,   1449,   1564, 
00177       1724,   1871,   1767,   1802,   1630,   1632,   1379,   1271,
00178       1063,    856,    711,    482,    289,     54,   -137,   -321,
00179       -490,   -638,   -764,   -836,   -800,   -859,   -838,   -837,
00180       -834,   -740,   -673,   -581,   -493,   -436,   -327,   -201
00181 };
00182 #define LINE_MODEL_D7_GAIN      1.51E-5f
00183 
00184 /*!
00185     The line model from section D.8 of G.168.
00186 
00187     These are the coefficients for the line simulation model defined in
00188     section D.8 of G.168. It may be used with the fir32_xxx
00189     routines to build a line simulator.
00190 */
00191 const int32_t line_model_d8_coeffs[] =
00192 {
00193        258,   -111,    337,   -319,    347,   -434,    192,   -450,
00194       -108,   -343,   -596,   -177,  -1187,    -52,  -1781,   -147,
00195      -1959,   -326,  -1601,  -1389, -13620,   -720,  33818, -10683,
00196      -6742,  12489,  -9862,   8950,  -1574,    758,   3526,  -3118,
00197       2421,  -8966,  -4901,  11385,  18072, -14410,  -7473,  19836,
00198     -16854,  -3115,   9483, -17799,   7399,  -4342,  -7415,   7929,
00199     -10726,   6239,  -2526,  -1317,   5345,  -4565,   6868,  -2195,
00200       3425,   1969,   -109,   3963,  -1275,   3087,   -892,   1239,
00201          2,   -427,    596,  -1184,    551,  -1244,    141,   -743, 
00202       -415,   -372,   -769,   -183,   -785,   -270,   -659,   -377,
00203       -523,   -325,   -245,   -255,    -60,     35,    218,    149,
00204        340,    233,    365,    303,    251,    230,    209,    179
00205 };
00206 #define LINE_MODEL_D8_GAIN      2.33E-5f
00207 
00208 /*!
00209     The line model from section D.9 of G.168.
00210 
00211     These are the coefficients for the line simulation model defined in
00212     section D.9 of G.168. It may be used with the fir32_xxx
00213     routines to build a line simulator.
00214 */
00215 const int32_t line_model_d9_coeffs[] =
00216 {
00217         80,     31,      4,     42,     42,    -61,    -81,    -64,
00218        121,   -102,    -26,   1002,  -9250, -22562,  39321,  35681,
00219     -35289,  25312,  -1457,   -229,  15659,  -6786,  16791,   3860,
00220       2239, -28730, -11885,  33871,   -176, -16421,  18173,  -9669,
00221     -10163,   9941, -19365,   3592,  -5907, -10257,   5336, -12933,
00222       4348,  -4802,  -1791,   3035,  -4433,   5553,  -2596,   3992,
00223       1255,   1450,   4079,    324,   4340,   1059,   3083,   1917,
00224       1756,   2478,   1027,   1871,    845,   1284,    813,    806,
00225        869,    471,    646,    438,    449,    432,    473,    394,
00226        452,    538,    717,    723,    850,    756,    753,    899,
00227        555,    669,    619,    500,    650,    615,    516,    492,
00228        427,    291,    356,    147,    107,    -50,    -88,    -59,
00229       -238,   -165,   -183
00230 };
00231 #define LINE_MODEL_D9_GAIN      1.33E-5f
00232 
00233 /*!
00234     The filter coefficients for the bandpass filter specified for level measurements
00235     in section 6.4.1.2.1 of G.168.
00236 */
00237 const float level_measurement_bp_coeffs[] =
00238 {
00239     0.0000,    0.0006,    0.0005,    0.0004,    0.0011,
00240     0.0000,    0.0015,   -0.0003,    0.0012,   -0.0002,
00241     0.0000,    0.0002,   -0.0020,    0.0005,   -0.0040,
00242     0.0000,   -0.0047,   -0.0019,   -0.0033,   -0.0047,
00243     0.0000,   -0.0068,    0.0036,   -0.0057,    0.0054,
00244     0.0000,    0.0044,    0.0095,    0.0017,    0.0188,
00245     0.0000,    0.0225,    0.0024,    0.0163,    0.0092,
00246     0.0000,    0.0164,   -0.0210,    0.0161,   -0.0375,
00247     0.0000,   -0.0406,   -0.0357,   -0.0267,   -0.0871,
00248     0.0000,   -0.1420,    0.0289,   -0.1843,    0.0475,
00249     0.8006,    0.0475,   -0.1843,    0.0289,   -0.1420,
00250     0.0000,   -0.0871,   -0.0267,   -0.0357,   -0.0406,
00251     0.0000,   -0.0375,    0.0161,   -0.0210,    0.0164,
00252     0.0000,    0.0092,    0.0163,    0.0024,    0.0225,
00253     0.0000,    0.0188,    0.0017,    0.0095,    0.0044,
00254     0.0000,    0.0054,   -0.0057,    0.0036,   -0.0068,
00255     0.0000,   -0.0047,   -0.0033,   -0.0019,   -0.0047,
00256     0.0000,   -0.0040,    0.0005,   -0.0020,    0.0002,
00257     0.0000,   -0.0002,    0.0012,   -0.0003,    0.0015,
00258     0.0000,    0.0011,    0.0004,    0.0005,    0.0006,
00259     0.0000
00260 };
00261 
00262 /*!
00263     The composite source signal "voiced" section from section C.1 of G.168.
00264 */
00265 const int css_c1[] =
00266 {
00267      -155,   276,   517,   578,   491,   302,    86,  -103,
00268      -207,  -198,    60,   190,   543,   948,  1362,  1741,
00269      2043,  2276,  2422,  2500,  2552,  2595,  2655,  2758,
00270      2896,  3060,  3224,  3370,  3500,  3569,  3603,  3603,
00271      3595,  3586,  3595,  3638,  3724,  3819,  3922,  4000,
00272      4043,  4034,  3974,  3862,  3724,  3577,  3439,  3336,
00273      3267,  3224,  3198,  3172,  3129,  3043,  2914,  2750,
00274      2560,  2353,  2155,  1991,  1853,  1750,  1672,  1603,
00275      1534,  1440,  1310,  1146,   965,   776,   603,   448,
00276       345,   276,   250,   250,   267,   267,   241,   190,
00277       103,    -9,  -138,  -267,  -388,  -491,  -569,  -638,
00278      -698,  -759,  -813,  -888,  -957, -1034, -1103, -1146,
00279     -1181, -1190, -1198, -1215, -1259, -1327, -1457, -1629,
00280     -1853, -2121, -2414, -2707, -3017, -3319, -3612, -3913,
00281     -4224, -4560, -4922, -5301, -5715, -6137, -6560, -6948,
00282     -7301, -7568, -7732, -7758, -7620, -7310, -6810, -6155,
00283     -5344, -4439, -3474, -2508, -1595,  -802
00284 };
00285 
00286 /*!
00287     The composite source signal "voiced" section from section C.3 of G.168.
00288 */
00289 const int css_c3[] =
00290 {
00291      -198,  -112,    -9,   103,   233,   388,   543,   724,
00292       896,  1060,  1233,  1388,  1517,  1638,  1747,  1810,
00293      1845,  1845,  1802,  1707,  1569,  1379,  1146,   871,
00294       560,   233,  -121,  -491,  -871, -1250, -1638, -2043,
00295     -2465, -2896, -3345, -3819, -4310, -4810, -5319, -5836,
00296     -6353, -6853, -7353, -7836, -8292, -8715, -9077, -9370,
00297     -9542, -9542, -9361, -8956, -8327, -7465, -6396, -5163,
00298     -3827, -2448, -1103,   155,  1293,  2241,  3034,  3655,
00299      4138,  4517,  4827,  5094,  5344,  5594,  5827,  6043,
00300      6215,  6344,  6413,  6422,  6379,  6310,  6215,  6120,
00301      6051,  6000,  5991,  5991,  6000,  6008,  5991,  5939,
00302      5853,  5715,  5560,  5387,  5215,  5043,  4879,  4732,
00303      4586,  4439,  4276,  4086,  3870,  3629,  3370,  3086,
00304      2801,  2534,  2267,  2034,  1819,  1612,  1422,  1224,
00305      1026,   819,   603,   388,   181,     9,  -181,  -328,
00306      -448,  -543,  -629,  -707,  -784,  -871,  -948, -1026,
00307     -1112, -1181, -1241, -1276, -1293, -1302, -1293, -1267,
00308     -1250, -1233, -1224, -1224, -1224, -1224, -1215, -1198,
00309     -1172, -1129, -1077, -1026,  -974,  -922,  -888,  -871,
00310      -845,  -828,  -810,  -793,  -767,  -741,  -698,  -672,
00311      -638,  -603,  -595,  -586,  -595,  -603,  -621,  -629,
00312      -938,  -638,  -638,  -638,  -638,  -638,  -647,  -664,
00313      -690,  -724,  -767,  -793,  -819,  -845,  -853,  -871,
00314      -879,  -888,  -896,  -922,  -948,  -974, -1009, -1026,
00315     -1052, -1069, -1077, -1069, -1060, -1060, -1052, -1043,
00316     -1043, -1052, -1060, -1060, -1060, -1052, -1034, -1017,
00317      -991,  -957,  -931,  -905,  -888,  -862,  -845,  -819,
00318      -793,  -767,  -724,  -672,  -621,  -560,  -509,  -457,
00319      -397,  -345,  -276,  -207,  -112
00320 };
00321 
00322 /*!
00323     From section 6.4.2.7 of G.168 - Test No. 6 Non-divergence on narrow-band signals.
00324     These tones and tone pairs are each applied for 5 seconds.
00325 */
00326 const int tones_6_4_2_7[][2] =
00327 {
00328     { 697,    0},
00329     { 941,    0},
00330     {1336,    0},
00331     {1633,    0},
00332     { 697, 1209},
00333     { 770, 1336},
00334     { 852, 1477},
00335     { 941, 1633},
00336     {   0,    0}
00337 };
00338 
00339 #endif
00340 /*- End of file ------------------------------------------------------------*/

Generated on Tue Oct 7 20:25:46 2008 for spandsp by  doxygen 1.5.6