Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

data_windows.c 23KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  1. #include <stdint.h>
  2. const int16_t AudioWindowHanning256[] __attribute__ ((aligned (4))) = {
  3. 0, 5, 20, 45, 80, 124, 179, 243, 317, 401,
  4. 495, 598, 711, 833, 965, 1106, 1257, 1416, 1585, 1763,
  5. 1949, 2145, 2349, 2561, 2782, 3011, 3249, 3494, 3747, 4008,
  6. 4276, 4552, 4834, 5124, 5421, 5724, 6034, 6350, 6672, 7000,
  7. 7334, 7673, 8018, 8367, 8722, 9081, 9445, 9812, 10184, 10560,
  8. 10939, 11321, 11707, 12095, 12486, 12879, 13274, 13672, 14070, 14471,
  9. 14872, 15275, 15678, 16081, 16485, 16889, 17292, 17695, 18097, 18498,
  10. 18897, 19295, 19692, 20086, 20478, 20868, 21255, 21639, 22019, 22397,
  11. 22770, 23140, 23506, 23867, 24224, 24576, 24923, 25265, 25602, 25932,
  12. 26258, 26577, 26890, 27196, 27496, 27789, 28076, 28355, 28627, 28892,
  13. 29148, 29398, 29639, 29872, 30097, 30314, 30522, 30722, 30913, 31095,
  14. 31268, 31432, 31588, 31733, 31870, 31997, 32115, 32223, 32321, 32410,
  15. 32489, 32558, 32618, 32667, 32707, 32737, 32757, 32767, 32767, 32757,
  16. 32737, 32707, 32667, 32618, 32558, 32489, 32410, 32321, 32223, 32115,
  17. 31997, 31870, 31733, 31588, 31432, 31268, 31095, 30913, 30722, 30522,
  18. 30314, 30097, 29872, 29639, 29398, 29148, 28892, 28627, 28355, 28076,
  19. 27789, 27496, 27196, 26890, 26577, 26258, 25932, 25602, 25265, 24923,
  20. 24576, 24224, 23867, 23506, 23140, 22770, 22397, 22019, 21639, 21255,
  21. 20868, 20478, 20086, 19692, 19295, 18897, 18498, 18097, 17695, 17292,
  22. 16889, 16485, 16081, 15678, 15275, 14872, 14471, 14070, 13672, 13274,
  23. 12879, 12486, 12095, 11707, 11321, 10939, 10560, 10184, 9812, 9445,
  24. 9081, 8722, 8367, 8018, 7673, 7334, 7000, 6672, 6350, 6034,
  25. 5724, 5421, 5124, 4834, 4552, 4276, 4008, 3747, 3494, 3249,
  26. 3011, 2782, 2561, 2349, 2145, 1949, 1763, 1585, 1416, 1257,
  27. 1106, 965, 833, 711, 598, 495, 401, 317, 243, 179,
  28. 124, 80, 45, 20, 5, 0,
  29. };
  30. const int16_t AudioWindowBartlett256[] __attribute__ ((aligned (4))) = {
  31. 128, 384, 640, 896, 1152, 1408, 1664, 1920, 2176, 2432,
  32. 2688, 2944, 3200, 3456, 3712, 3968, 4224, 4480, 4736, 4992,
  33. 5248, 5504, 5760, 6016, 6272, 6528, 6784, 7040, 7296, 7552,
  34. 7808, 8064, 8320, 8576, 8832, 9088, 9344, 9600, 9856, 10112,
  35. 10368, 10624, 10880, 11136, 11392, 11648, 11904, 12160, 12416, 12672,
  36. 12928, 13184, 13440, 13696, 13952, 14208, 14464, 14720, 14976, 15232,
  37. 15488, 15744, 16000, 16256, 16512, 16768, 17024, 17280, 17536, 17792,
  38. 18048, 18304, 18560, 18816, 19072, 19328, 19584, 19840, 20096, 20352,
  39. 20608, 20864, 21120, 21376, 21632, 21888, 22144, 22400, 22656, 22912,
  40. 23168, 23424, 23680, 23936, 24192, 24448, 24704, 24960, 25216, 25472,
  41. 25728, 25984, 26240, 26496, 26752, 27008, 27264, 27520, 27776, 28032,
  42. 28288, 28544, 28800, 29056, 29312, 29568, 29824, 30080, 30336, 30592,
  43. 30848, 31104, 31360, 31616, 31872, 32128, 32384, 32640, 32640, 32384,
  44. 32128, 31872, 31616, 31360, 31104, 30848, 30592, 30336, 30080, 29824,
  45. 29568, 29312, 29056, 28800, 28544, 28288, 28032, 27776, 27520, 27264,
  46. 27008, 26752, 26496, 26240, 25984, 25728, 25472, 25216, 24960, 24704,
  47. 24448, 24192, 23936, 23680, 23424, 23168, 22912, 22656, 22400, 22144,
  48. 21888, 21632, 21376, 21120, 20864, 20608, 20352, 20096, 19840, 19584,
  49. 19328, 19072, 18816, 18560, 18304, 18048, 17792, 17536, 17280, 17024,
  50. 16768, 16512, 16256, 16000, 15744, 15488, 15232, 14976, 14720, 14464,
  51. 14208, 13952, 13696, 13440, 13184, 12928, 12672, 12416, 12160, 11904,
  52. 11648, 11392, 11136, 10880, 10624, 10368, 10112, 9856, 9600, 9344,
  53. 9088, 8832, 8576, 8320, 8064, 7808, 7552, 7296, 7040, 6784,
  54. 6528, 6272, 6016, 5760, 5504, 5248, 4992, 4736, 4480, 4224,
  55. 3968, 3712, 3456, 3200, 2944, 2688, 2432, 2176, 1920, 1664,
  56. 1408, 1152, 896, 640, 384, 128,
  57. };
  58. const int16_t AudioWindowBlackman256[] __attribute__ ((aligned (4))) = {
  59. 0, 2, 7, 16, 29, 45, 65, 89, 116, 148,
  60. 183, 222, 266, 314, 366, 422, 483, 549, 620, 695,
  61. 776, 862, 953, 1050, 1153, 1261, 1376, 1496, 1623, 1757,
  62. 1897, 2043, 2197, 2358, 2526, 2701, 2883, 3074, 3272, 3477,
  63. 3691, 3912, 4142, 4380, 4626, 4880, 5142, 5413, 5692, 5979,
  64. 6275, 6579, 6891, 7211, 7540, 7876, 8220, 8572, 8932, 9299,
  65. 9674, 10056, 10445, 10840, 11242, 11651, 12065, 12485, 12911, 13342,
  66. 13778, 14218, 14662, 15111, 15563, 16017, 16475, 16935, 17397, 17860,
  67. 18324, 18789, 19253, 19718, 20182, 20644, 21104, 21563, 22018, 22470,
  68. 22919, 23363, 23802, 24237, 24665, 25087, 25503, 25911, 26312, 26704,
  69. 27088, 27462, 27828, 28183, 28527, 28861, 29183, 29494, 29793, 30079,
  70. 30352, 30613, 30859, 31092, 31311, 31515, 31705, 31880, 32039, 32183,
  71. 32312, 32425, 32522, 32603, 32668, 32717, 32750, 32766, 32766, 32750,
  72. 32717, 32668, 32603, 32522, 32425, 32312, 32183, 32039, 31880, 31705,
  73. 31515, 31311, 31092, 30859, 30613, 30352, 30079, 29793, 29494, 29183,
  74. 28861, 28527, 28183, 27828, 27462, 27088, 26704, 26312, 25911, 25503,
  75. 25087, 24665, 24237, 23802, 23363, 22919, 22470, 22018, 21563, 21104,
  76. 20644, 20182, 19718, 19253, 18789, 18324, 17860, 17397, 16935, 16475,
  77. 16017, 15563, 15111, 14662, 14218, 13778, 13342, 12911, 12485, 12065,
  78. 11651, 11242, 10840, 10445, 10056, 9674, 9299, 8932, 8572, 8220,
  79. 7876, 7540, 7211, 6891, 6579, 6275, 5979, 5692, 5413, 5142,
  80. 4880, 4626, 4380, 4142, 3912, 3691, 3477, 3272, 3074, 2883,
  81. 2701, 2526, 2358, 2197, 2043, 1897, 1757, 1623, 1496, 1376,
  82. 1261, 1153, 1050, 953, 862, 776, 695, 620, 549, 483,
  83. 422, 366, 314, 266, 222, 183, 148, 116, 89, 65,
  84. 45, 29, 16, 7, 2, 0,
  85. };
  86. const int16_t AudioWindowFlattop256[] __attribute__ ((aligned (4))) = {
  87. 0, 0, -1, -3, -6, -9, -14, -20, -27, -35,
  88. -45, -56, -68, -83, -99, -117, -137, -160, -185, -213,
  89. -243, -276, -312, -351, -393, -438, -487, -538, -593, -651,
  90. -713, -777, -844, -914, -987, -1062, -1139, -1218, -1298, -1380,
  91. -1462, -1544, -1626, -1707, -1787, -1865, -1939, -2010, -2077, -2139,
  92. -2194, -2243, -2284, -2316, -2339, -2351, -2352, -2339, -2314, -2273,
  93. -2217, -2144, -2054, -1945, -1817, -1668, -1498, -1306, -1090, -851,
  94. -588, -300, 13, 352, 718, 1111, 1530, 1976, 2449, 2949,
  95. 3475, 4027, 4605, 5209, 5837, 6489, 7163, 7860, 8577, 9313,
  96. 10068, 10840, 11626, 12426, 13238, 14059, 14889, 15724, 16563, 17404,
  97. 18244, 19082, 19914, 20740, 21555, 22358, 23147, 23920, 24673, 25405,
  98. 26113, 26796, 27451, 28076, 28669, 29228, 29752, 30238, 30685, 31092,
  99. 31458, 31780, 32058, 32291, 32479, 32620, 32715, 32762, 32762, 32715,
  100. 32620, 32479, 32291, 32058, 31780, 31458, 31092, 30685, 30238, 29752,
  101. 29228, 28669, 28076, 27451, 26796, 26113, 25405, 24673, 23920, 23147,
  102. 22358, 21555, 20740, 19914, 19082, 18244, 17404, 16563, 15724, 14889,
  103. 14059, 13238, 12426, 11626, 10840, 10068, 9313, 8577, 7860, 7163,
  104. 6489, 5837, 5209, 4605, 4027, 3475, 2949, 2449, 1976, 1530,
  105. 1111, 718, 352, 13, -300, -588, -851, -1090, -1306, -1498,
  106. -1668, -1817, -1945, -2054, -2144, -2217, -2273, -2314, -2339, -2352,
  107. -2351, -2339, -2316, -2284, -2243, -2194, -2139, -2077, -2010, -1939,
  108. -1865, -1787, -1707, -1626, -1544, -1462, -1380, -1298, -1218, -1139,
  109. -1062, -987, -914, -844, -777, -713, -651, -593, -538, -487,
  110. -438, -393, -351, -312, -276, -243, -213, -185, -160, -137,
  111. -117, -99, -83, -68, -56, -45, -35, -27, -20, -14,
  112. -9, -6, -3, -1, 0, 0,
  113. };
  114. const int16_t AudioWindowBlackmanHarris256[] __attribute__ ((aligned (4))) = {
  115. 2, 2, 3, 5, 7, 9, 13, 17, 22, 27,
  116. 34, 42, 51, 61, 73, 86, 101, 118, 137, 158,
  117. 181, 207, 235, 267, 301, 339, 381, 427, 476, 530,
  118. 589, 652, 721, 795, 875, 961, 1053, 1151, 1257, 1369,
  119. 1489, 1617, 1752, 1896, 2049, 2210, 2380, 2560, 2749, 2948,
  120. 3156, 3375, 3605, 3845, 4096, 4357, 4630, 4914, 5209, 5516,
  121. 5833, 6162, 6503, 6855, 7218, 7592, 7978, 8374, 8781, 9199,
  122. 9628, 10066, 10514, 10972, 11439, 11915, 12400, 12892, 13392, 13899,
  123. 14413, 14932, 15457, 15987, 16521, 17058, 17599, 18141, 18685, 19229,
  124. 19774, 20318, 20860, 21400, 21936, 22468, 22996, 23518, 24033, 24541,
  125. 25041, 25532, 26012, 26482, 26941, 27387, 27821, 28240, 28645, 29034,
  126. 29408, 29765, 30104, 30426, 30728, 31012, 31276, 31520, 31743, 31945,
  127. 32126, 32284, 32421, 32535, 32627, 32696, 32742, 32765, 32765, 32742,
  128. 32696, 32627, 32535, 32421, 32284, 32126, 31945, 31743, 31520, 31276,
  129. 31012, 30728, 30426, 30104, 29765, 29408, 29034, 28645, 28240, 27821,
  130. 27387, 26941, 26482, 26012, 25532, 25041, 24541, 24033, 23518, 22996,
  131. 22468, 21936, 21400, 20860, 20318, 19774, 19229, 18685, 18141, 17599,
  132. 17058, 16521, 15987, 15457, 14932, 14413, 13899, 13392, 12892, 12400,
  133. 11915, 11439, 10972, 10514, 10066, 9628, 9199, 8781, 8374, 7978,
  134. 7592, 7218, 6855, 6503, 6162, 5833, 5516, 5209, 4914, 4630,
  135. 4357, 4096, 3845, 3605, 3375, 3156, 2948, 2749, 2560, 2380,
  136. 2210, 2049, 1896, 1752, 1617, 1489, 1369, 1257, 1151, 1053,
  137. 961, 875, 795, 721, 652, 589, 530, 476, 427, 381,
  138. 339, 301, 267, 235, 207, 181, 158, 137, 118, 101,
  139. 86, 73, 61, 51, 42, 34, 27, 22, 17, 13,
  140. 9, 7, 5, 3, 2, 2,
  141. };
  142. const int16_t AudioWindowNuttall256[] __attribute__ ((aligned (4))) = {
  143. 0, 0, 1, 2, 4, 6, 9, 13, 17, 22,
  144. 28, 35, 43, 52, 62, 74, 87, 102, 119, 138,
  145. 160, 183, 210, 239, 271, 306, 345, 388, 434, 485,
  146. 540, 600, 665, 735, 811, 893, 981, 1075, 1176, 1284,
  147. 1400, 1523, 1654, 1793, 1940, 2097, 2262, 2437, 2621, 2815,
  148. 3019, 3233, 3458, 3693, 3939, 4196, 4465, 4744, 5035, 5338,
  149. 5651, 5977, 6314, 6663, 7023, 7394, 7777, 8171, 8577, 8993,
  150. 9420, 9857, 10305, 10762, 11229, 11705, 12190, 12683, 13184, 13693,
  151. 14208, 14730, 15257, 15789, 16326, 16867, 17411, 17958, 18506, 19055,
  152. 19604, 20153, 20700, 21245, 21787, 22325, 22858, 23386, 23908, 24422,
  153. 24927, 25424, 25911, 26388, 26853, 27305, 27744, 28170, 28581, 28976,
  154. 29355, 29717, 30062, 30388, 30696, 30984, 31252, 31499, 31726, 31932,
  155. 32115, 32276, 32415, 32532, 32625, 32695, 32742, 32765, 32765, 32742,
  156. 32695, 32625, 32532, 32415, 32276, 32115, 31932, 31726, 31499, 31252,
  157. 30984, 30696, 30388, 30062, 29717, 29355, 28976, 28581, 28170, 27744,
  158. 27305, 26853, 26388, 25911, 25424, 24927, 24422, 23908, 23386, 22858,
  159. 22325, 21787, 21245, 20700, 20153, 19604, 19055, 18506, 17958, 17411,
  160. 16867, 16326, 15789, 15257, 14730, 14208, 13693, 13184, 12683, 12190,
  161. 11705, 11229, 10762, 10305, 9857, 9420, 8993, 8577, 8171, 7777,
  162. 7394, 7023, 6663, 6314, 5977, 5651, 5338, 5035, 4744, 4465,
  163. 4196, 3939, 3693, 3458, 3233, 3019, 2815, 2621, 2437, 2262,
  164. 2097, 1940, 1793, 1654, 1523, 1400, 1284, 1176, 1075, 981,
  165. 893, 811, 735, 665, 600, 540, 485, 434, 388, 345,
  166. 306, 271, 239, 210, 183, 160, 138, 119, 102, 87,
  167. 74, 62, 52, 43, 35, 28, 22, 17, 13, 9,
  168. 6, 4, 2, 1, 0, 0,
  169. };
  170. const int16_t AudioWindowBlackmanNuttall256[] __attribute__ ((aligned (4))) = {
  171. 12, 12, 13, 15, 18, 22, 26, 32, 38, 46,
  172. 54, 64, 76, 89, 103, 119, 137, 158, 180, 205,
  173. 232, 262, 295, 331, 371, 414, 461, 512, 567, 627,
  174. 691, 761, 836, 916, 1002, 1095, 1193, 1299, 1411, 1531,
  175. 1658, 1793, 1935, 2086, 2246, 2414, 2592, 2778, 2974, 3180,
  176. 3396, 3621, 3857, 4104, 4361, 4628, 4907, 5196, 5497, 5808,
  177. 6130, 6464, 6808, 7164, 7530, 7908, 8296, 8694, 9103, 9523,
  178. 9952, 10391, 10839, 11296, 11763, 12237, 12720, 13210, 13707, 14211,
  179. 14721, 15236, 15757, 16281, 16810, 17342, 17876, 18412, 18949, 19487,
  180. 20024, 20560, 21094, 21625, 22153, 22677, 23196, 23709, 24215, 24714,
  181. 25204, 25686, 26157, 26618, 27068, 27505, 27930, 28341, 28737, 29118,
  182. 29484, 29833, 30165, 30479, 30775, 31052, 31310, 31549, 31767, 31964,
  183. 32141, 32296, 32429, 32541, 32630, 32698, 32743, 32765, 32765, 32743,
  184. 32698, 32630, 32541, 32429, 32296, 32141, 31964, 31767, 31549, 31310,
  185. 31052, 30775, 30479, 30165, 29833, 29484, 29118, 28737, 28341, 27930,
  186. 27505, 27068, 26618, 26157, 25686, 25204, 24714, 24215, 23709, 23196,
  187. 22677, 22153, 21625, 21094, 20560, 20024, 19487, 18949, 18412, 17876,
  188. 17342, 16810, 16281, 15757, 15236, 14721, 14211, 13707, 13210, 12720,
  189. 12237, 11763, 11296, 10839, 10391, 9952, 9523, 9103, 8694, 8296,
  190. 7908, 7530, 7164, 6808, 6464, 6130, 5808, 5497, 5196, 4907,
  191. 4628, 4361, 4104, 3857, 3621, 3396, 3180, 2974, 2778, 2592,
  192. 2414, 2246, 2086, 1935, 1793, 1658, 1531, 1411, 1299, 1193,
  193. 1095, 1002, 916, 836, 761, 691, 627, 567, 512, 461,
  194. 414, 371, 331, 295, 262, 232, 205, 180, 158, 137,
  195. 119, 103, 89, 76, 64, 54, 46, 38, 32, 26,
  196. 22, 18, 15, 13, 12, 12,
  197. };
  198. const int16_t AudioWindowWelch256[] __attribute__ ((aligned (4))) = {
  199. 256, 764, 1268, 1768, 2264, 2756, 3244, 3728, 4208, 4684,
  200. 5156, 5624, 6088, 6548, 7004, 7456, 7904, 8348, 8788, 9224,
  201. 9656, 10084, 10508, 10928, 11344, 11756, 12164, 12568, 12968, 13364,
  202. 13756, 14144, 14528, 14908, 15284, 15656, 16024, 16388, 16748, 17104,
  203. 17456, 17804, 18148, 18488, 18824, 19156, 19484, 19808, 20128, 20444,
  204. 20756, 21064, 21368, 21668, 21964, 22256, 22544, 22828, 23108, 23384,
  205. 23656, 23924, 24188, 24448, 24704, 24956, 25204, 25448, 25688, 25924,
  206. 26156, 26384, 26608, 26828, 27044, 27256, 27464, 27668, 27868, 28064,
  207. 28256, 28444, 28628, 28808, 28984, 29156, 29324, 29488, 29648, 29804,
  208. 29956, 30104, 30248, 30388, 30524, 30656, 30784, 30908, 31028, 31144,
  209. 31256, 31364, 31468, 31568, 31664, 31756, 31844, 31928, 32008, 32084,
  210. 32156, 32224, 32288, 32348, 32404, 32456, 32504, 32548, 32588, 32624,
  211. 32656, 32684, 32708, 32728, 32744, 32756, 32764, 32767, 32767, 32764,
  212. 32756, 32744, 32728, 32708, 32684, 32656, 32624, 32588, 32548, 32504,
  213. 32456, 32404, 32348, 32288, 32224, 32156, 32084, 32008, 31928, 31844,
  214. 31756, 31664, 31568, 31468, 31364, 31256, 31144, 31028, 30908, 30784,
  215. 30656, 30524, 30388, 30248, 30104, 29956, 29804, 29648, 29488, 29324,
  216. 29156, 28984, 28808, 28628, 28444, 28256, 28064, 27868, 27668, 27464,
  217. 27256, 27044, 26828, 26608, 26384, 26156, 25924, 25688, 25448, 25204,
  218. 24956, 24704, 24448, 24188, 23924, 23656, 23384, 23108, 22828, 22544,
  219. 22256, 21964, 21668, 21368, 21064, 20756, 20444, 20128, 19808, 19484,
  220. 19156, 18824, 18488, 18148, 17804, 17456, 17104, 16748, 16388, 16024,
  221. 15656, 15284, 14908, 14528, 14144, 13756, 13364, 12968, 12568, 12164,
  222. 11756, 11344, 10928, 10508, 10084, 9656, 9224, 8788, 8348, 7904,
  223. 7456, 7004, 6548, 6088, 5624, 5156, 4684, 4208, 3728, 3244,
  224. 2756, 2264, 1768, 1268, 764, 256,
  225. };
  226. const int16_t AudioWindowHamming256[] __attribute__ ((aligned (4))) = {
  227. 2621, 2626, 2640, 2663, 2695, 2736, 2786, 2845, 2913, 2991,
  228. 3077, 3172, 3276, 3388, 3509, 3639, 3778, 3925, 4080, 4243,
  229. 4415, 4595, 4782, 4978, 5181, 5392, 5610, 5836, 6069, 6309,
  230. 6555, 6809, 7069, 7336, 7609, 7888, 8173, 8464, 8760, 9062,
  231. 9369, 9681, 9998, 10319, 10646, 10976, 11310, 11649, 11991, 12336,
  232. 12685, 13037, 13391, 13749, 14108, 14470, 14834, 15199, 15566, 15935,
  233. 16304, 16674, 17045, 17416, 17788, 18159, 18530, 18900, 19270, 19639,
  234. 20007, 20373, 20738, 21101, 21461, 21820, 22176, 22529, 22879, 23226,
  235. 23570, 23910, 24247, 24579, 24907, 25231, 25551, 25865, 26175, 26479,
  236. 26778, 27072, 27360, 27642, 27918, 28188, 28451, 28708, 28958, 29202,
  237. 29438, 29667, 29889, 30104, 30311, 30510, 30702, 30886, 31061, 31229,
  238. 31388, 31539, 31682, 31816, 31942, 32059, 32167, 32266, 32357, 32439,
  239. 32511, 32575, 32630, 32675, 32712, 32739, 32758, 32767, 32767, 32758,
  240. 32739, 32712, 32675, 32630, 32575, 32511, 32439, 32357, 32266, 32167,
  241. 32059, 31942, 31816, 31682, 31539, 31388, 31229, 31061, 30886, 30702,
  242. 30510, 30311, 30104, 29889, 29667, 29438, 29202, 28958, 28708, 28451,
  243. 28188, 27918, 27642, 27360, 27072, 26778, 26479, 26175, 25865, 25551,
  244. 25231, 24907, 24579, 24247, 23910, 23570, 23226, 22879, 22529, 22176,
  245. 21820, 21461, 21101, 20738, 20373, 20007, 19639, 19270, 18900, 18530,
  246. 18159, 17788, 17416, 17045, 16674, 16304, 15935, 15566, 15199, 14834,
  247. 14470, 14108, 13749, 13391, 13037, 12685, 12336, 11991, 11649, 11310,
  248. 10976, 10646, 10319, 9998, 9681, 9369, 9062, 8760, 8464, 8173,
  249. 7888, 7609, 7336, 7069, 6809, 6555, 6309, 6069, 5836, 5610,
  250. 5392, 5181, 4978, 4782, 4595, 4415, 4243, 4080, 3925, 3778,
  251. 3639, 3509, 3388, 3276, 3172, 3077, 2991, 2913, 2845, 2786,
  252. 2736, 2695, 2663, 2640, 2626, 2621,
  253. };
  254. const int16_t AudioWindowCosine256[] __attribute__ ((aligned (4))) = {
  255. 0, 404, 807, 1211, 1614, 2017, 2420, 2822, 3224, 3626,
  256. 4027, 4427, 4827, 5226, 5624, 6021, 6417, 6813, 7207, 7600,
  257. 7993, 8383, 8773, 9161, 9548, 9934, 10318, 10700, 11081, 11460,
  258. 11837, 12213, 12586, 12958, 13328, 13696, 14061, 14425, 14786, 15145,
  259. 15502, 15857, 16209, 16558, 16906, 17250, 17592, 17931, 18268, 18602,
  260. 18932, 19261, 19586, 19908, 20227, 20543, 20856, 21166, 21472, 21776,
  261. 22076, 22372, 22666, 22955, 23242, 23525, 23804, 24079, 24351, 24620,
  262. 24884, 25145, 25402, 25655, 25904, 26149, 26391, 26628, 26861, 27090,
  263. 27315, 27536, 27753, 27966, 28174, 28378, 28578, 28773, 28964, 29151,
  264. 29333, 29510, 29684, 29852, 30017, 30176, 30331, 30482, 30628, 30769,
  265. 30905, 31037, 31164, 31287, 31404, 31517, 31625, 31728, 31827, 31921,
  266. 32009, 32093, 32172, 32247, 32316, 32380, 32440, 32494, 32544, 32588,
  267. 32628, 32663, 32693, 32718, 32738, 32752, 32762, 32767, 32767, 32762,
  268. 32752, 32738, 32718, 32693, 32663, 32628, 32588, 32544, 32494, 32440,
  269. 32380, 32316, 32247, 32172, 32093, 32009, 31921, 31827, 31728, 31625,
  270. 31517, 31404, 31287, 31164, 31037, 30905, 30769, 30628, 30482, 30331,
  271. 30176, 30017, 29852, 29684, 29510, 29333, 29151, 28964, 28773, 28578,
  272. 28378, 28174, 27966, 27753, 27536, 27315, 27090, 26861, 26628, 26391,
  273. 26149, 25904, 25655, 25402, 25145, 24884, 24620, 24351, 24079, 23804,
  274. 23525, 23242, 22955, 22666, 22372, 22076, 21776, 21472, 21166, 20856,
  275. 20543, 20227, 19908, 19586, 19261, 18932, 18602, 18268, 17931, 17592,
  276. 17250, 16906, 16558, 16209, 15857, 15502, 15145, 14786, 14425, 14061,
  277. 13696, 13328, 12958, 12586, 12213, 11837, 11460, 11081, 10700, 10318,
  278. 9934, 9548, 9161, 8773, 8383, 7993, 7600, 7207, 6813, 6417,
  279. 6021, 5624, 5226, 4827, 4427, 4027, 3626, 3224, 2822, 2420,
  280. 2017, 1614, 1211, 807, 404, 0,
  281. };
  282. const int16_t AudioWindowTukey256[] __attribute__ ((aligned (4))) = {
  283. 0, 20, 80, 179, 317, 495, 711, 965, 1257, 1585,
  284. 1949, 2349, 2782, 3249, 3747, 4276, 4834, 5421, 6034, 6672,
  285. 7334, 8018, 8722, 9445, 10184, 10939, 11707, 12486, 13274, 14070,
  286. 14872, 15678, 16485, 17292, 18097, 18897, 19692, 20478, 21255, 22019,
  287. 22770, 23506, 24224, 24923, 25602, 26258, 26890, 27496, 28076, 28627,
  288. 29148, 29639, 30097, 30522, 30913, 31268, 31588, 31870, 32115, 32321,
  289. 32489, 32618, 32707, 32757, 32767, 32767, 32767, 32767, 32767, 32767,
  290. 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767,
  291. 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767,
  292. 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767,
  293. 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767,
  294. 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767,
  295. 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767,
  296. 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767,
  297. 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767,
  298. 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767,
  299. 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767,
  300. 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767,
  301. 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767,
  302. 32767, 32767, 32757, 32707, 32618, 32489, 32321, 32115, 31870, 31588,
  303. 31268, 30913, 30522, 30097, 29639, 29148, 28627, 28076, 27496, 26890,
  304. 26258, 25602, 24923, 24224, 23506, 22770, 22019, 21255, 20478, 19692,
  305. 18897, 18097, 17292, 16485, 15678, 14872, 14070, 13274, 12486, 11707,
  306. 10939, 10184, 9445, 8722, 8018, 7334, 6672, 6034, 5421, 4834,
  307. 4276, 3747, 3249, 2782, 2349, 1949, 1585, 1257, 965, 711,
  308. 495, 317, 179, 80, 20, 0,
  309. };
  310. /*
  311. #! /usr/bin/perl
  312. # http://en.wikipedia.org/wiki/Window_function
  313. use Math::Trig ':pi';
  314. $len = 256;
  315. for ($i=0; $i < $len; $i++) {
  316. $name = "Hanning";
  317. $val = 0.5 * (1 - cos(2 * pi * $i / ($len -1)));
  318. #$name = "Bartlett";
  319. #$val = 1 - abs(($i - ($len - 1) / 2) / ($len / 2));
  320. #$name = "Blackman";
  321. #$a0 = (1 - 0.16) / 2;
  322. #$a1 = 0.5;
  323. #$a2 = 0.16 / 2;
  324. #$val = $a0 - $a1 * cos(2 * pi * $i / ($len -1)) + $a2 * cos(4 * pi * $i / ($len -1));
  325. #$name = "Flattop";
  326. #$a0 = 1;
  327. #$a1 = 1.93;
  328. #$a2 = 1.29;
  329. #$a3 = 0.388;
  330. #$a4 = 0.028;
  331. #$max = $a0 - $a1 * cos(pi) + $a2 * cos(2 * pi) - $a3 * cos(3 * pi) + $a4 * cos(4 * pi) ;
  332. #$val = $a0 - $a1 * cos(2 * pi * $i / ($len -1)) + $a2 * cos(4 * pi * $i / ($len -1));
  333. #$val += -1 * $a3 * cos(6 * pi * $i / ($len -1)) + $a4 * cos(8 * pi * $i / ($len -1));
  334. #$val /= $max;
  335. #$name = "BlackmanHarris";
  336. #$a0 = 0.35875;
  337. #$a1 = 0.48829;
  338. #$a2 = 0.14128;
  339. #$a3 = 0.01168;
  340. #$a4 = 0;
  341. #$val = $a0 - $a1 * cos(2 * pi * $i / ($len -1)) + $a2 * cos(4 * pi * $i / ($len -1));
  342. #$val += -1 * $a3 * cos(6 * pi * $i / ($len -1)) + $a4 * cos(8 * pi * $i / ($len -1));
  343. #$name = "Nuttall";
  344. #$a0 = 0.355768;
  345. #$a1 = 0.487396;
  346. #$a2 = 0.144232;
  347. #$a3 = 0.012604;
  348. #$a4 = 0;
  349. #$val = $a0 - $a1 * cos(2 * pi * $i / ($len -1)) + $a2 * cos(4 * pi * $i / ($len -1));
  350. #$val += -1 * $a3 * cos(6 * pi * $i / ($len -1)) + $a4 * cos(8 * pi * $i / ($len -1));
  351. #$name = "BlackmanNuttall";
  352. #$a0 = 0.3635819;
  353. #$a1 = 0.4891775;
  354. #$a2 = 0.1365995;
  355. #$a3 = 0.0106411;
  356. #$a4 = 0;
  357. #$val = $a0 - $a1 * cos(2 * pi * $i / ($len -1)) + $a2 * cos(4 * pi * $i / ($len -1));
  358. #$val += -1 * $a3 * cos(6 * pi * $i / ($len -1)) + $a4 * cos(8 * pi * $i / ($len -1));
  359. #$name = "Welch";
  360. #$val = 1 - (($i - ($len - 1) / 2) / ($len / 2)) ** 2;
  361. #$name = "Hamming";
  362. #$val = 0.54 - 0.46 * cos(2 * pi * $i / ($len -1));
  363. #$name = "Cosine";
  364. #$val = cos((pi * $i / ($len -1)) - (pi / 2));
  365. #$name = "Tukey";
  366. #$a = 0.5;
  367. #if ($i <= ($a * ($len - 1) / 2)) {
  368. # $val = 0.5 * (1 + cos(pi * ((2 * $i / ($a * ($len - 1))) - 1)));
  369. #} elsif ($i < (($len - 1) * (1 - $a / 2))) {
  370. # $val = 0.99999;
  371. #} else {
  372. # $val = 0.5 * (1 + cos(pi * ((2 * $i / ($a * ($len - 1))) - (2 / $a) + 1)));
  373. #}
  374. #$name = "KaiserBessel";
  375. # TODO: what is the full equation, with the "zero-th order modified Bessel function"?
  376. $n = int($val * 32768 + 0.5);
  377. $n = 32767 if $n > 32767;
  378. if (0) {
  379. print $i;
  380. print "\t";
  381. printf "%9.6f", $val;
  382. print "\t";
  383. print $n;
  384. print "\n";
  385. } else {
  386. if ($i == 0) {
  387. print "const int16_t AudioWindow${name}${len}[] __attribute__ ((aligned (4))) = {\n";
  388. }
  389. printf "%6d", $n;
  390. print "," if ($i < $len);
  391. print "\n" if ($i % 10) == 9;
  392. }
  393. }
  394. print "\n" unless ($len % 10) == 9;
  395. print "};\n";
  396. */