/* Audio Library for Teensy 3.X * Copyright (c) 2014, Paul Stoffregen, paul@pjrc.com * * Development of this audio library was funded by PJRC.COM, LLC by sales of * Teensy and Audio Adaptor boards. Please support PJRC's efforts to develop * open source software by purchasing Teensy or other PJRC products. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice, development funding notice, and this permission * notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include const int16_t AudioWindowHanning256[] __attribute__ ((aligned (4))) = { 0, 5, 20, 45, 80, 124, 179, 243, 317, 401, 495, 598, 711, 833, 965, 1106, 1257, 1416, 1585, 1763, 1949, 2145, 2349, 2561, 2782, 3011, 3249, 3494, 3747, 4008, 4276, 4552, 4834, 5124, 5421, 5724, 6034, 6350, 6672, 7000, 7334, 7673, 8018, 8367, 8722, 9081, 9445, 9812, 10184, 10560, 10939, 11321, 11707, 12095, 12486, 12879, 13274, 13672, 14070, 14471, 14872, 15275, 15678, 16081, 16485, 16889, 17292, 17695, 18097, 18498, 18897, 19295, 19692, 20086, 20478, 20868, 21255, 21639, 22019, 22397, 22770, 23140, 23506, 23867, 24224, 24576, 24923, 25265, 25602, 25932, 26258, 26577, 26890, 27196, 27496, 27789, 28076, 28355, 28627, 28892, 29148, 29398, 29639, 29872, 30097, 30314, 30522, 30722, 30913, 31095, 31268, 31432, 31588, 31733, 31870, 31997, 32115, 32223, 32321, 32410, 32489, 32558, 32618, 32667, 32707, 32737, 32757, 32767, 32767, 32757, 32737, 32707, 32667, 32618, 32558, 32489, 32410, 32321, 32223, 32115, 31997, 31870, 31733, 31588, 31432, 31268, 31095, 30913, 30722, 30522, 30314, 30097, 29872, 29639, 29398, 29148, 28892, 28627, 28355, 28076, 27789, 27496, 27196, 26890, 26577, 26258, 25932, 25602, 25265, 24923, 24576, 24224, 23867, 23506, 23140, 22770, 22397, 22019, 21639, 21255, 20868, 20478, 20086, 19692, 19295, 18897, 18498, 18097, 17695, 17292, 16889, 16485, 16081, 15678, 15275, 14872, 14471, 14070, 13672, 13274, 12879, 12486, 12095, 11707, 11321, 10939, 10560, 10184, 9812, 9445, 9081, 8722, 8367, 8018, 7673, 7334, 7000, 6672, 6350, 6034, 5724, 5421, 5124, 4834, 4552, 4276, 4008, 3747, 3494, 3249, 3011, 2782, 2561, 2349, 2145, 1949, 1763, 1585, 1416, 1257, 1106, 965, 833, 711, 598, 495, 401, 317, 243, 179, 124, 80, 45, 20, 5, 0, }; const int16_t AudioWindowBartlett256[] __attribute__ ((aligned (4))) = { 128, 384, 640, 896, 1152, 1408, 1664, 1920, 2176, 2432, 2688, 2944, 3200, 3456, 3712, 3968, 4224, 4480, 4736, 4992, 5248, 5504, 5760, 6016, 6272, 6528, 6784, 7040, 7296, 7552, 7808, 8064, 8320, 8576, 8832, 9088, 9344, 9600, 9856, 10112, 10368, 10624, 10880, 11136, 11392, 11648, 11904, 12160, 12416, 12672, 12928, 13184, 13440, 13696, 13952, 14208, 14464, 14720, 14976, 15232, 15488, 15744, 16000, 16256, 16512, 16768, 17024, 17280, 17536, 17792, 18048, 18304, 18560, 18816, 19072, 19328, 19584, 19840, 20096, 20352, 20608, 20864, 21120, 21376, 21632, 21888, 22144, 22400, 22656, 22912, 23168, 23424, 23680, 23936, 24192, 24448, 24704, 24960, 25216, 25472, 25728, 25984, 26240, 26496, 26752, 27008, 27264, 27520, 27776, 28032, 28288, 28544, 28800, 29056, 29312, 29568, 29824, 30080, 30336, 30592, 30848, 31104, 31360, 31616, 31872, 32128, 32384, 32640, 32640, 32384, 32128, 31872, 31616, 31360, 31104, 30848, 30592, 30336, 30080, 29824, 29568, 29312, 29056, 28800, 28544, 28288, 28032, 27776, 27520, 27264, 27008, 26752, 26496, 26240, 25984, 25728, 25472, 25216, 24960, 24704, 24448, 24192, 23936, 23680, 23424, 23168, 22912, 22656, 22400, 22144, 21888, 21632, 21376, 21120, 20864, 20608, 20352, 20096, 19840, 19584, 19328, 19072, 18816, 18560, 18304, 18048, 17792, 17536, 17280, 17024, 16768, 16512, 16256, 16000, 15744, 15488, 15232, 14976, 14720, 14464, 14208, 13952, 13696, 13440, 13184, 12928, 12672, 12416, 12160, 11904, 11648, 11392, 11136, 10880, 10624, 10368, 10112, 9856, 9600, 9344, 9088, 8832, 8576, 8320, 8064, 7808, 7552, 7296, 7040, 6784, 6528, 6272, 6016, 5760, 5504, 5248, 4992, 4736, 4480, 4224, 3968, 3712, 3456, 3200, 2944, 2688, 2432, 2176, 1920, 1664, 1408, 1152, 896, 640, 384, 128, }; const int16_t AudioWindowBlackman256[] __attribute__ ((aligned (4))) = { 0, 2, 7, 16, 29, 45, 65, 89, 116, 148, 183, 222, 266, 314, 366, 422, 483, 549, 620, 695, 776, 862, 953, 1050, 1153, 1261, 1376, 1496, 1623, 1757, 1897, 2043, 2197, 2358, 2526, 2701, 2883, 3074, 3272, 3477, 3691, 3912, 4142, 4380, 4626, 4880, 5142, 5413, 5692, 5979, 6275, 6579, 6891, 7211, 7540, 7876, 8220, 8572, 8932, 9299, 9674, 10056, 10445, 10840, 11242, 11651, 12065, 12485, 12911, 13342, 13778, 14218, 14662, 15111, 15563, 16017, 16475, 16935, 17397, 17860, 18324, 18789, 19253, 19718, 20182, 20644, 21104, 21563, 22018, 22470, 22919, 23363, 23802, 24237, 24665, 25087, 25503, 25911, 26312, 26704, 27088, 27462, 27828, 28183, 28527, 28861, 29183, 29494, 29793, 30079, 30352, 30613, 30859, 31092, 31311, 31515, 31705, 31880, 32039, 32183, 32312, 32425, 32522, 32603, 32668, 32717, 32750, 32766, 32766, 32750, 32717, 32668, 32603, 32522, 32425, 32312, 32183, 32039, 31880, 31705, 31515, 31311, 31092, 30859, 30613, 30352, 30079, 29793, 29494, 29183, 28861, 28527, 28183, 27828, 27462, 27088, 26704, 26312, 25911, 25503, 25087, 24665, 24237, 23802, 23363, 22919, 22470, 22018, 21563, 21104, 20644, 20182, 19718, 19253, 18789, 18324, 17860, 17397, 16935, 16475, 16017, 15563, 15111, 14662, 14218, 13778, 13342, 12911, 12485, 12065, 11651, 11242, 10840, 10445, 10056, 9674, 9299, 8932, 8572, 8220, 7876, 7540, 7211, 6891, 6579, 6275, 5979, 5692, 5413, 5142, 4880, 4626, 4380, 4142, 3912, 3691, 3477, 3272, 3074, 2883, 2701, 2526, 2358, 2197, 2043, 1897, 1757, 1623, 1496, 1376, 1261, 1153, 1050, 953, 862, 776, 695, 620, 549, 483, 422, 366, 314, 266, 222, 183, 148, 116, 89, 65, 45, 29, 16, 7, 2, 0, }; const int16_t AudioWindowFlattop256[] __attribute__ ((aligned (4))) = { 0, 0, -1, -3, -6, -9, -14, -20, -27, -35, -45, -56, -68, -83, -99, -117, -137, -160, -185, -213, -243, -276, -312, -351, -393, -438, -487, -538, -593, -651, -713, -777, -844, -914, -987, -1062, -1139, -1218, -1298, -1380, -1462, -1544, -1626, -1707, -1787, -1865, -1939, -2010, -2077, -2139, -2194, -2243, -2284, -2316, -2339, -2351, -2352, -2339, -2314, -2273, -2217, -2144, -2054, -1945, -1817, -1668, -1498, -1306, -1090, -851, -588, -300, 13, 352, 718, 1111, 1530, 1976, 2449, 2949, 3475, 4027, 4605, 5209, 5837, 6489, 7163, 7860, 8577, 9313, 10068, 10840, 11626, 12426, 13238, 14059, 14889, 15724, 16563, 17404, 18244, 19082, 19914, 20740, 21555, 22358, 23147, 23920, 24673, 25405, 26113, 26796, 27451, 28076, 28669, 29228, 29752, 30238, 30685, 31092, 31458, 31780, 32058, 32291, 32479, 32620, 32715, 32762, 32762, 32715, 32620, 32479, 32291, 32058, 31780, 31458, 31092, 30685, 30238, 29752, 29228, 28669, 28076, 27451, 26796, 26113, 25405, 24673, 23920, 23147, 22358, 21555, 20740, 19914, 19082, 18244, 17404, 16563, 15724, 14889, 14059, 13238, 12426, 11626, 10840, 10068, 9313, 8577, 7860, 7163, 6489, 5837, 5209, 4605, 4027, 3475, 2949, 2449, 1976, 1530, 1111, 718, 352, 13, -300, -588, -851, -1090, -1306, -1498, -1668, -1817, -1945, -2054, -2144, -2217, -2273, -2314, -2339, -2352, -2351, -2339, -2316, -2284, -2243, -2194, -2139, -2077, -2010, -1939, -1865, -1787, -1707, -1626, -1544, -1462, -1380, -1298, -1218, -1139, -1062, -987, -914, -844, -777, -713, -651, -593, -538, -487, -438, -393, -351, -312, -276, -243, -213, -185, -160, -137, -117, -99, -83, -68, -56, -45, -35, -27, -20, -14, -9, -6, -3, -1, 0, 0, }; const int16_t AudioWindowBlackmanHarris256[] __attribute__ ((aligned (4))) = { 2, 2, 3, 5, 7, 9, 13, 17, 22, 27, 34, 42, 51, 61, 73, 86, 101, 118, 137, 158, 181, 207, 235, 267, 301, 339, 381, 427, 476, 530, 589, 652, 721, 795, 875, 961, 1053, 1151, 1257, 1369, 1489, 1617, 1752, 1896, 2049, 2210, 2380, 2560, 2749, 2948, 3156, 3375, 3605, 3845, 4096, 4357, 4630, 4914, 5209, 5516, 5833, 6162, 6503, 6855, 7218, 7592, 7978, 8374, 8781, 9199, 9628, 10066, 10514, 10972, 11439, 11915, 12400, 12892, 13392, 13899, 14413, 14932, 15457, 15987, 16521, 17058, 17599, 18141, 18685, 19229, 19774, 20318, 20860, 21400, 21936, 22468, 22996, 23518, 24033, 24541, 25041, 25532, 26012, 26482, 26941, 27387, 27821, 28240, 28645, 29034, 29408, 29765, 30104, 30426, 30728, 31012, 31276, 31520, 31743, 31945, 32126, 32284, 32421, 32535, 32627, 32696, 32742, 32765, 32765, 32742, 32696, 32627, 32535, 32421, 32284, 32126, 31945, 31743, 31520, 31276, 31012, 30728, 30426, 30104, 29765, 29408, 29034, 28645, 28240, 27821, 27387, 26941, 26482, 26012, 25532, 25041, 24541, 24033, 23518, 22996, 22468, 21936, 21400, 20860, 20318, 19774, 19229, 18685, 18141, 17599, 17058, 16521, 15987, 15457, 14932, 14413, 13899, 13392, 12892, 12400, 11915, 11439, 10972, 10514, 10066, 9628, 9199, 8781, 8374, 7978, 7592, 7218, 6855, 6503, 6162, 5833, 5516, 5209, 4914, 4630, 4357, 4096, 3845, 3605, 3375, 3156, 2948, 2749, 2560, 2380, 2210, 2049, 1896, 1752, 1617, 1489, 1369, 1257, 1151, 1053, 961, 875, 795, 721, 652, 589, 530, 476, 427, 381, 339, 301, 267, 235, 207, 181, 158, 137, 118, 101, 86, 73, 61, 51, 42, 34, 27, 22, 17, 13, 9, 7, 5, 3, 2, 2, }; const int16_t AudioWindowNuttall256[] __attribute__ ((aligned (4))) = { 0, 0, 1, 2, 4, 6, 9, 13, 17, 22, 28, 35, 43, 52, 62, 74, 87, 102, 119, 138, 160, 183, 210, 239, 271, 306, 345, 388, 434, 485, 540, 600, 665, 735, 811, 893, 981, 1075, 1176, 1284, 1400, 1523, 1654, 1793, 1940, 2097, 2262, 2437, 2621, 2815, 3019, 3233, 3458, 3693, 3939, 4196, 4465, 4744, 5035, 5338, 5651, 5977, 6314, 6663, 7023, 7394, 7777, 8171, 8577, 8993, 9420, 9857, 10305, 10762, 11229, 11705, 12190, 12683, 13184, 13693, 14208, 14730, 15257, 15789, 16326, 16867, 17411, 17958, 18506, 19055, 19604, 20153, 20700, 21245, 21787, 22325, 22858, 23386, 23908, 24422, 24927, 25424, 25911, 26388, 26853, 27305, 27744, 28170, 28581, 28976, 29355, 29717, 30062, 30388, 30696, 30984, 31252, 31499, 31726, 31932, 32115, 32276, 32415, 32532, 32625, 32695, 32742, 32765, 32765, 32742, 32695, 32625, 32532, 32415, 32276, 32115, 31932, 31726, 31499, 31252, 30984, 30696, 30388, 30062, 29717, 29355, 28976, 28581, 28170, 27744, 27305, 26853, 26388, 25911, 25424, 24927, 24422, 23908, 23386, 22858, 22325, 21787, 21245, 20700, 20153, 19604, 19055, 18506, 17958, 17411, 16867, 16326, 15789, 15257, 14730, 14208, 13693, 13184, 12683, 12190, 11705, 11229, 10762, 10305, 9857, 9420, 8993, 8577, 8171, 7777, 7394, 7023, 6663, 6314, 5977, 5651, 5338, 5035, 4744, 4465, 4196, 3939, 3693, 3458, 3233, 3019, 2815, 2621, 2437, 2262, 2097, 1940, 1793, 1654, 1523, 1400, 1284, 1176, 1075, 981, 893, 811, 735, 665, 600, 540, 485, 434, 388, 345, 306, 271, 239, 210, 183, 160, 138, 119, 102, 87, 74, 62, 52, 43, 35, 28, 22, 17, 13, 9, 6, 4, 2, 1, 0, 0, }; const int16_t AudioWindowBlackmanNuttall256[] __attribute__ ((aligned (4))) = { 12, 12, 13, 15, 18, 22, 26, 32, 38, 46, 54, 64, 76, 89, 103, 119, 137, 158, 180, 205, 232, 262, 295, 331, 371, 414, 461, 512, 567, 627, 691, 761, 836, 916, 1002, 1095, 1193, 1299, 1411, 1531, 1658, 1793, 1935, 2086, 2246, 2414, 2592, 2778, 2974, 3180, 3396, 3621, 3857, 4104, 4361, 4628, 4907, 5196, 5497, 5808, 6130, 6464, 6808, 7164, 7530, 7908, 8296, 8694, 9103, 9523, 9952, 10391, 10839, 11296, 11763, 12237, 12720, 13210, 13707, 14211, 14721, 15236, 15757, 16281, 16810, 17342, 17876, 18412, 18949, 19487, 20024, 20560, 21094, 21625, 22153, 22677, 23196, 23709, 24215, 24714, 25204, 25686, 26157, 26618, 27068, 27505, 27930, 28341, 28737, 29118, 29484, 29833, 30165, 30479, 30775, 31052, 31310, 31549, 31767, 31964, 32141, 32296, 32429, 32541, 32630, 32698, 32743, 32765, 32765, 32743, 32698, 32630, 32541, 32429, 32296, 32141, 31964, 31767, 31549, 31310, 31052, 30775, 30479, 30165, 29833, 29484, 29118, 28737, 28341, 27930, 27505, 27068, 26618, 26157, 25686, 25204, 24714, 24215, 23709, 23196, 22677, 22153, 21625, 21094, 20560, 20024, 19487, 18949, 18412, 17876, 17342, 16810, 16281, 15757, 15236, 14721, 14211, 13707, 13210, 12720, 12237, 11763, 11296, 10839, 10391, 9952, 9523, 9103, 8694, 8296, 7908, 7530, 7164, 6808, 6464, 6130, 5808, 5497, 5196, 4907, 4628, 4361, 4104, 3857, 3621, 3396, 3180, 2974, 2778, 2592, 2414, 2246, 2086, 1935, 1793, 1658, 1531, 1411, 1299, 1193, 1095, 1002, 916, 836, 761, 691, 627, 567, 512, 461, 414, 371, 331, 295, 262, 232, 205, 180, 158, 137, 119, 103, 89, 76, 64, 54, 46, 38, 32, 26, 22, 18, 15, 13, 12, 12, }; const int16_t AudioWindowWelch256[] __attribute__ ((aligned (4))) = { 256, 764, 1268, 1768, 2264, 2756, 3244, 3728, 4208, 4684, 5156, 5624, 6088, 6548, 7004, 7456, 7904, 8348, 8788, 9224, 9656, 10084, 10508, 10928, 11344, 11756, 12164, 12568, 12968, 13364, 13756, 14144, 14528, 14908, 15284, 15656, 16024, 16388, 16748, 17104, 17456, 17804, 18148, 18488, 18824, 19156, 19484, 19808, 20128, 20444, 20756, 21064, 21368, 21668, 21964, 22256, 22544, 22828, 23108, 23384, 23656, 23924, 24188, 24448, 24704, 24956, 25204, 25448, 25688, 25924, 26156, 26384, 26608, 26828, 27044, 27256, 27464, 27668, 27868, 28064, 28256, 28444, 28628, 28808, 28984, 29156, 29324, 29488, 29648, 29804, 29956, 30104, 30248, 30388, 30524, 30656, 30784, 30908, 31028, 31144, 31256, 31364, 31468, 31568, 31664, 31756, 31844, 31928, 32008, 32084, 32156, 32224, 32288, 32348, 32404, 32456, 32504, 32548, 32588, 32624, 32656, 32684, 32708, 32728, 32744, 32756, 32764, 32767, 32767, 32764, 32756, 32744, 32728, 32708, 32684, 32656, 32624, 32588, 32548, 32504, 32456, 32404, 32348, 32288, 32224, 32156, 32084, 32008, 31928, 31844, 31756, 31664, 31568, 31468, 31364, 31256, 31144, 31028, 30908, 30784, 30656, 30524, 30388, 30248, 30104, 29956, 29804, 29648, 29488, 29324, 29156, 28984, 28808, 28628, 28444, 28256, 28064, 27868, 27668, 27464, 27256, 27044, 26828, 26608, 26384, 26156, 25924, 25688, 25448, 25204, 24956, 24704, 24448, 24188, 23924, 23656, 23384, 23108, 22828, 22544, 22256, 21964, 21668, 21368, 21064, 20756, 20444, 20128, 19808, 19484, 19156, 18824, 18488, 18148, 17804, 17456, 17104, 16748, 16388, 16024, 15656, 15284, 14908, 14528, 14144, 13756, 13364, 12968, 12568, 12164, 11756, 11344, 10928, 10508, 10084, 9656, 9224, 8788, 8348, 7904, 7456, 7004, 6548, 6088, 5624, 5156, 4684, 4208, 3728, 3244, 2756, 2264, 1768, 1268, 764, 256, }; const int16_t AudioWindowHamming256[] __attribute__ ((aligned (4))) = { 2621, 2626, 2640, 2663, 2695, 2736, 2786, 2845, 2913, 2991, 3077, 3172, 3276, 3388, 3509, 3639, 3778, 3925, 4080, 4243, 4415, 4595, 4782, 4978, 5181, 5392, 5610, 5836, 6069, 6309, 6555, 6809, 7069, 7336, 7609, 7888, 8173, 8464, 8760, 9062, 9369, 9681, 9998, 10319, 10646, 10976, 11310, 11649, 11991, 12336, 12685, 13037, 13391, 13749, 14108, 14470, 14834, 15199, 15566, 15935, 16304, 16674, 17045, 17416, 17788, 18159, 18530, 18900, 19270, 19639, 20007, 20373, 20738, 21101, 21461, 21820, 22176, 22529, 22879, 23226, 23570, 23910, 24247, 24579, 24907, 25231, 25551, 25865, 26175, 26479, 26778, 27072, 27360, 27642, 27918, 28188, 28451, 28708, 28958, 29202, 29438, 29667, 29889, 30104, 30311, 30510, 30702, 30886, 31061, 31229, 31388, 31539, 31682, 31816, 31942, 32059, 32167, 32266, 32357, 32439, 32511, 32575, 32630, 32675, 32712, 32739, 32758, 32767, 32767, 32758, 32739, 32712, 32675, 32630, 32575, 32511, 32439, 32357, 32266, 32167, 32059, 31942, 31816, 31682, 31539, 31388, 31229, 31061, 30886, 30702, 30510, 30311, 30104, 29889, 29667, 29438, 29202, 28958, 28708, 28451, 28188, 27918, 27642, 27360, 27072, 26778, 26479, 26175, 25865, 25551, 25231, 24907, 24579, 24247, 23910, 23570, 23226, 22879, 22529, 22176, 21820, 21461, 21101, 20738, 20373, 20007, 19639, 19270, 18900, 18530, 18159, 17788, 17416, 17045, 16674, 16304, 15935, 15566, 15199, 14834, 14470, 14108, 13749, 13391, 13037, 12685, 12336, 11991, 11649, 11310, 10976, 10646, 10319, 9998, 9681, 9369, 9062, 8760, 8464, 8173, 7888, 7609, 7336, 7069, 6809, 6555, 6309, 6069, 5836, 5610, 5392, 5181, 4978, 4782, 4595, 4415, 4243, 4080, 3925, 3778, 3639, 3509, 3388, 3276, 3172, 3077, 2991, 2913, 2845, 2786, 2736, 2695, 2663, 2640, 2626, 2621, }; const int16_t AudioWindowCosine256[] __attribute__ ((aligned (4))) = { 0, 404, 807, 1211, 1614, 2017, 2420, 2822, 3224, 3626, 4027, 4427, 4827, 5226, 5624, 6021, 6417, 6813, 7207, 7600, 7993, 8383, 8773, 9161, 9548, 9934, 10318, 10700, 11081, 11460, 11837, 12213, 12586, 12958, 13328, 13696, 14061, 14425, 14786, 15145, 15502, 15857, 16209, 16558, 16906, 17250, 17592, 17931, 18268, 18602, 18932, 19261, 19586, 19908, 20227, 20543, 20856, 21166, 21472, 21776, 22076, 22372, 22666, 22955, 23242, 23525, 23804, 24079, 24351, 24620, 24884, 25145, 25402, 25655, 25904, 26149, 26391, 26628, 26861, 27090, 27315, 27536, 27753, 27966, 28174, 28378, 28578, 28773, 28964, 29151, 29333, 29510, 29684, 29852, 30017, 30176, 30331, 30482, 30628, 30769, 30905, 31037, 31164, 31287, 31404, 31517, 31625, 31728, 31827, 31921, 32009, 32093, 32172, 32247, 32316, 32380, 32440, 32494, 32544, 32588, 32628, 32663, 32693, 32718, 32738, 32752, 32762, 32767, 32767, 32762, 32752, 32738, 32718, 32693, 32663, 32628, 32588, 32544, 32494, 32440, 32380, 32316, 32247, 32172, 32093, 32009, 31921, 31827, 31728, 31625, 31517, 31404, 31287, 31164, 31037, 30905, 30769, 30628, 30482, 30331, 30176, 30017, 29852, 29684, 29510, 29333, 29151, 28964, 28773, 28578, 28378, 28174, 27966, 27753, 27536, 27315, 27090, 26861, 26628, 26391, 26149, 25904, 25655, 25402, 25145, 24884, 24620, 24351, 24079, 23804, 23525, 23242, 22955, 22666, 22372, 22076, 21776, 21472, 21166, 20856, 20543, 20227, 19908, 19586, 19261, 18932, 18602, 18268, 17931, 17592, 17250, 16906, 16558, 16209, 15857, 15502, 15145, 14786, 14425, 14061, 13696, 13328, 12958, 12586, 12213, 11837, 11460, 11081, 10700, 10318, 9934, 9548, 9161, 8773, 8383, 7993, 7600, 7207, 6813, 6417, 6021, 5624, 5226, 4827, 4427, 4027, 3626, 3224, 2822, 2420, 2017, 1614, 1211, 807, 404, 0, }; const int16_t AudioWindowTukey256[] __attribute__ ((aligned (4))) = { 0, 20, 80, 179, 317, 495, 711, 965, 1257, 1585, 1949, 2349, 2782, 3249, 3747, 4276, 4834, 5421, 6034, 6672, 7334, 8018, 8722, 9445, 10184, 10939, 11707, 12486, 13274, 14070, 14872, 15678, 16485, 17292, 18097, 18897, 19692, 20478, 21255, 22019, 22770, 23506, 24224, 24923, 25602, 26258, 26890, 27496, 28076, 28627, 29148, 29639, 30097, 30522, 30913, 31268, 31588, 31870, 32115, 32321, 32489, 32618, 32707, 32757, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32757, 32707, 32618, 32489, 32321, 32115, 31870, 31588, 31268, 30913, 30522, 30097, 29639, 29148, 28627, 28076, 27496, 26890, 26258, 25602, 24923, 24224, 23506, 22770, 22019, 21255, 20478, 19692, 18897, 18097, 17292, 16485, 15678, 14872, 14070, 13274, 12486, 11707, 10939, 10184, 9445, 8722, 8018, 7334, 6672, 6034, 5421, 4834, 4276, 3747, 3249, 2782, 2349, 1949, 1585, 1257, 965, 711, 495, 317, 179, 80, 20, 0, }; /* #! /usr/bin/perl # http://en.wikipedia.org/wiki/Window_function use Math::Trig ':pi'; $len = 256; for ($i=0; $i < $len; $i++) { $name = "Hanning"; $val = 0.5 * (1 - cos(2 * pi * $i / ($len -1))); #$name = "Bartlett"; #$val = 1 - abs(($i - ($len - 1) / 2) / ($len / 2)); #$name = "Blackman"; #$a0 = (1 - 0.16) / 2; #$a1 = 0.5; #$a2 = 0.16 / 2; #$val = $a0 - $a1 * cos(2 * pi * $i / ($len -1)) + $a2 * cos(4 * pi * $i / ($len -1)); #$name = "Flattop"; #$a0 = 1; #$a1 = 1.93; #$a2 = 1.29; #$a3 = 0.388; #$a4 = 0.028; #$max = $a0 - $a1 * cos(pi) + $a2 * cos(2 * pi) - $a3 * cos(3 * pi) + $a4 * cos(4 * pi) ; #$val = $a0 - $a1 * cos(2 * pi * $i / ($len -1)) + $a2 * cos(4 * pi * $i / ($len -1)); #$val += -1 * $a3 * cos(6 * pi * $i / ($len -1)) + $a4 * cos(8 * pi * $i / ($len -1)); #$val /= $max; #$name = "BlackmanHarris"; #$a0 = 0.35875; #$a1 = 0.48829; #$a2 = 0.14128; #$a3 = 0.01168; #$a4 = 0; #$val = $a0 - $a1 * cos(2 * pi * $i / ($len -1)) + $a2 * cos(4 * pi * $i / ($len -1)); #$val += -1 * $a3 * cos(6 * pi * $i / ($len -1)) + $a4 * cos(8 * pi * $i / ($len -1)); #$name = "Nuttall"; #$a0 = 0.355768; #$a1 = 0.487396; #$a2 = 0.144232; #$a3 = 0.012604; #$a4 = 0; #$val = $a0 - $a1 * cos(2 * pi * $i / ($len -1)) + $a2 * cos(4 * pi * $i / ($len -1)); #$val += -1 * $a3 * cos(6 * pi * $i / ($len -1)) + $a4 * cos(8 * pi * $i / ($len -1)); #$name = "BlackmanNuttall"; #$a0 = 0.3635819; #$a1 = 0.4891775; #$a2 = 0.1365995; #$a3 = 0.0106411; #$a4 = 0; #$val = $a0 - $a1 * cos(2 * pi * $i / ($len -1)) + $a2 * cos(4 * pi * $i / ($len -1)); #$val += -1 * $a3 * cos(6 * pi * $i / ($len -1)) + $a4 * cos(8 * pi * $i / ($len -1)); #$name = "Welch"; #$val = 1 - (($i - ($len - 1) / 2) / ($len / 2)) ** 2; #$name = "Hamming"; #$val = 0.54 - 0.46 * cos(2 * pi * $i / ($len -1)); #$name = "Cosine"; #$val = cos((pi * $i / ($len -1)) - (pi / 2)); #$name = "Tukey"; #$a = 0.5; #if ($i <= ($a * ($len - 1) / 2)) { # $val = 0.5 * (1 + cos(pi * ((2 * $i / ($a * ($len - 1))) - 1))); #} elsif ($i < (($len - 1) * (1 - $a / 2))) { # $val = 0.99999; #} else { # $val = 0.5 * (1 + cos(pi * ((2 * $i / ($a * ($len - 1))) - (2 / $a) + 1))); #} #$name = "KaiserBessel"; # TODO: what is the full equation, with the "zero-th order modified Bessel function"? $n = int($val * 32768 + 0.5); $n = 32767 if $n > 32767; if (0) { print $i; print "\t"; printf "%9.6f", $val; print "\t"; print $n; print "\n"; } else { if ($i == 0) { print "const int16_t AudioWindow${name}${len}[] __attribute__ ((aligned (4))) = {\n"; } printf "%6d", $n; print "," if ($i < $len); print "\n" if ($i % 10) == 9; } } print "\n" unless ($len % 10) == 9; print "};\n"; */