xpmr_coef.h
来自「asterisk 是一个很有知名度开源软件」· C头文件 代码 · 共 952 行
H
952 行
/* * xpmr_coef.h - for Xelatec Private Mobile Radio Processes * * All Rights Reserved. Copyright (C)2007, Xelatec, LLC * * 20070808 1235 Steven Henke, W9SH, sph@xelatec.com * * See http://www.asterisk.org for more information about * the Asterisk project. Please do not directly contact * any of the maintainers of this project for assistance; * the project provides a web site, mailing lists and IRC * channels for your use. * * This program is free software, distributed under the terms of * the GNU General Public License Version 2. See the LICENSE file * at the top of the source tree. *//*! \file * * \brief Private Land Mobile Radio Channel Voice and Signaling Processor * * \author Steven Henke, W9SH <sph@xelatec.com> Xelatec, LLC */#ifndef XPMR_COEF_H#define XMPR_COEF_H 1// frequencies in 0.1 Hzconst u32 dtmf_row[] ={ 6970, 7700, 8520, 9410};const u32 dtmf_col[] ={ 12090, 13360, 14770, 16330};const i16 coef_dcs_rx = 1488; // dcs rx data divisor for oversampling 8000/134.4const i16 coef_dcs_tx = 5952; // dcs tx data divisorconst i16 coef_lsd_div = 672; // low speed data divisorconst u32 coef_lsd_sync = 0x158; // 000101011000const u32 coef_lsd_sync_pattern[] = {0x0000000F, 0x0F0FF000};#define CTCSS_COEF_INT 120#define CTCSS_SAMPLE_RATE 8000#define TDIV(x) ((CTCSS_SAMPLE_RATE*1000/x)+5)/10i32 coef_ctcss[4][5]={ // freq, divisor, integrator, filter {770,TDIV(770),CTCSS_COEF_INT,0,0}, {1000,TDIV(1000),CTCSS_COEF_INT,0,0}, {1035,TDIV(1035),CTCSS_COEF_INT,0,0}, {0,0,0,0}};i16 coef_ctcss_div[]={2985, // 00 067.02782, // 01 071.92688, // 02 074.42597, // 03 077.02509, // 04 079.72424, // 05 082.52342, // 06 085.42260, // 07 088.52186, // 08 091.52110, // 09 094.82053, // 10 097.42000, // 11 100.01932, // 12 103.51866, // 13 107.21803, // 14 110.91742, // 15 114.81684, // 16 118.81626, // 17 123.01571, // 18 127.31517, // 19 131.81465, // 20 136.51415, // 21 141.31368, // 22 146.21321, // 23 151.41276, // 24 156.71233, // 25 162.21191, // 26 167.91151, // 27 173.81112, // 28 179.91074, // 29 186.21037, // 30 192.8983, // 31 203.5949, // 32 210.7917, // 33 218.1886, // 34 225.7856, // 35 233.6827, // 36 241.8799 // 37 250.3};float freq_ctcss[]={067.0, // 00 071.9, // 01 074.4, // 02 077.0, // 03 079.7, // 04 082.5, // 05 085.4, // 06 088.5, // 07 091.5, // 08 094.8, // 09 097.4, // 10 100.0, // 11 103.5, // 12 107.2, // 13 110.9, // 14 114.8, // 15 118.8, // 16 123.0, // 17 127.3, // 18 131.8, // 19 136.5, // 20 141.3, // 21 146.2, // 22 151.4, // 23 156.7, // 24 162.2, // 25 167.9, // 26 173.8, // 27 179.9, // 28 186.2, // 29 192.8, // 30 203.5, // 31 210.7 , // 32 218.1 , // 33 225.7 , // 34 233.6 , // 35 241.8 , // 36 250.3 // 37 };/* noise squelch carrier detect filter*/static const int16_t taps_fir_bpf_noise_1 = 66;static const int32_t gain_fir_bpf_noise_1 = 65536;static const int16_t coef_fir_bpf_noise_1[] = { 139, -182, -269, -66, 56, 59, 250, 395, -80, -775, -557, 437, 779, 210, -17, 123, -692, -1664, -256, 2495, 2237, -1018, -2133, -478, -1134, -2711, 2642, 10453, 4010, -14385, -16488, 6954, 23030, 6954, -16488, -14385, 4010, 10453, 2642, -2711, -1134, -478, -2133, -1018, 2237, 2495, -256, -1664, -692, 123, -17, 210, 779, 437, -557, -775, -80, 395, 250, 59, 56, -66, -269, -182, 139, 257};/* tbd*/static const int16_t taps_fir_lpf_3K_1 = 66;static const int32_t gain_fir_lpf_3K_1 = 131072;static const int16_t coef_fir_lpf_3K_1[] = { 259, 58, -185, -437, -654, -793, -815, -696, -434, -48, 414, 886, 1284, 1523, 1529, 1254, 691, -117, -1078, -2049, -2854, -3303, -3220, -2472, -995, 1187, 3952, 7086, 10300, 13270, 15672, 17236, 17778, 17236, 15672, 13270, 10300, 7086, 3952, 1187, -995, -2472, -3220, -3303, -2854, -2049, -1078, -117, 691, 1254, 1529, 1523, 1284, 886, 414, -48, -434, -696, -815, -793, -654, -437, -185, 58, 259, 393};/**************************************************************Filter type: Low PassFilter model: ButterworthFilter order: 9Sampling Frequency: 8 KHzCut Frequency: 0.250000 KHzCoefficents Quantization: 16-bit***************************************************************/static const int16_t taps_fir_lpf_250_11_64 = 64;static const int32_t gain_fir_lpf_250_11_64 = 262144;static const int16_t coef_fir_lpf_250_11_64[] = { 366, -3, -418, -865, -1328, -1788, -2223, -2609, -2922, -3138, -3232, -3181, -2967, -2573, -1988, -1206, -228, 937, 2277, 3767, 5379, 7077, 8821, 10564, 12259, 13855, 15305, 16563, 17588, 18346, 18812, 18968, 18812, 18346, 17588, 16563, 15305, 13855, 12259, 10564, 8821, 7077, 5379, 3767, 2277, 937, -228, -1206, -1988, -2573, -2967, -3181, -3232, -3138, -2922, -2609, -2223, -1788, -1328, -865, -418, -3, 366, 680};// de-emphasis integrator 300 Hz with 8KS/s// a0, b1static const int16_t taps_int_lpf_300_1_2 = 2;static const int32_t gain_int_lpf_300_1_2 = 8182;static const int16_t coef_int_lpf_300_1_2[]={6878,25889};// pre-emphasis differentiator 4000 Hz with 8KS/s// a0,a1,b0,static const int16_t taps_int_hpf_4000_1_2 = 2;static const int32_t gain_int_hpf_4000_1_2 = 16384;static const int16_t coef_int_hpf_4000_1_2[]={17610,-17610,2454};/* ltr crc table from http://www.radioreference.com/forums/showthread.php?t=24126*/static const u8 ltr_table[]={0x38, // 00 Area 01110000x1c, // 01 Channel 4 00111000x0e, // 02 Channel 3 00011100x46, // 03 Channel 2 10001100x23, // 04 Channel 1 01000110x51, // 05 Channel 0 10100010x68, // 06 Home 4 11010000x75, // 07 Home 3 11101010x7a, // 08 Home 2 11110100x3d, // 09 Home 1 01111010x1f, // 10 Home 0 00111110x4f, // 11 Group 7 10011110x26, // 12 Group 6 01001100x52, // 13 Group 5 10100100x29, // 14 Group 4 01010010x15, // 15 Group 3 00101010x0d, // 16 Group 2 00011010x45, // 17 Group 1 10001010x62, // 18 Group 0 11000100x31, // 19 Free 4 01100010x19, // 20 Free 3 00110010x0d, // 21 Free 2 00011010x07, // 22 Free 1 00001110x43 // 23 Free 0 1000011};static const i16 bitWeight[]={0, // 01, // 11, // 22, // 31, // 42, // 52, // 63, // 71, // 82, // 92, // 103, // 112, // 123, // 133, // 144, // 151, // 162, // 172, // 183, // 192, // 203, // 213, // 224, // 232, // 243, // 253, // 264, // 273, // 284, // 294, // 305, // 311, // 322, // 332, // 343, // 352, // 363, // 373, // 384, // 392, // 403, // 413, // 424, // 433, // 444, // 454, // 465, // 472, // 483, // 493, // 504, // 513, // 524, // 534, // 545, // 553, // 564, // 574, // 585, // 594, // 605, // 615, // 626, // 631, // 642, // 652, // 663, // 672, // 683, // 693, // 704, // 712, // 723, // 733, // 744, // 753, // 764, // 774, // 785, // 792, // 803, // 813, // 824, // 833, // 844, // 854, // 865, // 873, // 884, // 894, // 905, // 914, // 925, // 935, // 946, // 952, // 963, // 973, // 984, // 993, // 1004, // 1014, // 1025, // 1033, // 1044, // 1054, // 1065, // 1074, // 1085, // 1095, // 1106, // 1113, // 1124, // 1134, // 1145, // 1154, // 1165, // 1175, // 1186, // 1194, // 1205, // 1215, // 1226, // 1235, // 1246, // 1256, // 1267, // 1271, // 1282, // 1292, // 1303, // 1312, // 1323, // 1333, // 1344, // 1352, // 1363, // 1373, // 1384, // 1393, // 1404, // 1414, // 1425, // 1432, // 1443, // 1453, // 1464, // 1473, // 1484, // 1494, // 1505, // 1513, // 1524, // 1534, // 1545, // 1554, // 1565, // 1575, // 1586, // 1592, // 1603, // 1613, // 1624, // 1633, // 1644, // 1654, // 1665, // 1673, // 1684, // 1694, // 1705, // 1714, // 1725, // 1735, // 1746, // 1753, // 1764, // 1774, // 1785, // 1794, // 1805, // 1815, // 1826, // 1834, // 1845, // 1855, // 1866, // 1875, // 1886, // 1896, // 1907, // 1912, // 1923, // 1933, // 1944, // 1953, // 1964, // 1974, // 1985, // 1993, // 2004, // 2014, // 2025, // 2034, // 2045, // 2055, // 2066, // 2073, // 2084, // 2094, // 2105, // 2114, // 2125, // 2135, // 2146, // 2154, // 2165, // 2175, // 2186, // 2195, // 2206, // 2216, // 2227, // 2233, // 2244, // 2254, // 2265, // 2274, // 2285, // 2295, // 2306, // 2314, // 2325, // 2335, // 2346, // 2355, // 2366, // 2376, // 2387, // 2394, // 2405, // 2415, // 2426, // 2435, // 2446, // 2456, // 2467, // 2475, // 2486, // 2496, // 2507, // 2516, // 2527, // 2537, // 2548 // 255};/* ctcss decode filter*//**************************************************************Filter type: Low PassFilter model: ButterworthFilter order: 9Sampling Frequency: 8 KHzCut Frequency: 0.250000 KHzCoefficents Quantization: 16-bit***************************************************************/static const int16_t taps_fir_lpf_250_9_66 = 66;static const int32_t gain_fir_lpf_250_9_66 = 262144;static const int16_t coef_fir_lpf_250_9_66[] = { 676, 364, -3, -415, -860,-1320,-1777,-2209,-2593,-2904,-3119,-3212,-3162,-2949,-2557,-1975,-1198, -226, 932, 2263, 3744, 5346, 7034, 8767,10499,12184,13770,15211,16462,17480,18234,18696,18852,18696,18234,17480,16462,15211,13770,12184,10499, 8767, 7034, 5346, 3744, 2263, 932, -226,-1198,-1975,-2557,-2949,-3162,-3212,-3119,-2904,-2593,-2209,-1777,-1320, -860, -415, -3, 364, 676, 927};/* *************************************************************Filter type: Low PassFilter model: ButterworthFilter order: 9Sampling Frequency: 8 KHzCut Frequency: 0.215 KHzCoefficents Quantization: 16-bit***************************************************************/static const int16_t taps_fir_lpf_215_9_88 = 88;static const int32_t gain_fir_lpf_215_9_88 = 524288;static const int16_t coef_fir_lpf_215_9_88[] = { 2038, 2049, 1991, 1859, 1650, 1363, 999, 562, 58, -502,-1106,-1739,-2382,-3014,-3612,-4153,-4610,-4959,-5172,-5226,-5098,-4769,-4222,-3444,-2430,-1176, 310, 2021, 3937, 6035, 8284,10648,13086,15550,17993,20363,22608,24677,26522,28099,29369,30299,30867,31058,30867,30299,29369,28099,26522,24677,22608,20363,17993,15550,13086,10648, 8284, 6035, 3937, 2021, 310,-1176,-2430,-3444,-4222,-4769,-5098,-5226,-5172,-4959,-4610,-4153,-3612,-3014,-2382,-1739,-1106, -502, 58, 562, 999, 1363, 1650, 1859, 1991, 2049, 2038, 1966};// end coef fir_lpf_215_9_88///**************************************************************Filter type: High PassFilter model: ButterworthFilter order: 9Sampling Frequency: 8 KHzCut Frequency: 0.300000 KHzCoefficents Quantization: 16-bit***************************************************************/static const int16_t taps_fir_hpf_300_9_66 = 66;static const int32_t gain_fir_hpf_300_9_66 = 32768;static const int16_t coef_fir_hpf_300_9_66[] = { -141, -114, -77, -30, 23, 83, 147, 210, 271, 324, 367, 396, 407, 396, 362, 302, 216, 102, -36, -199, -383, -585, -798,-1017,-1237,-1452,-1653,-1836,-1995,-2124,-2219,-2278,30463,-2278,-2219,-2124,-1995,-1836,-1653,-1452,-1237,-1017, -798, -585, -383, -199, -36, 102, 216, 302, 362, 396, 407, 396, 367, 324, 271, 210, 147, 83, 23, -30, -77, -114, -141, -158 };#endif /* !XPMR_COEF_H *//* end of file */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?