tas-gain-table.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. /*
  2. This is the program used to generate below table.
  3. #include <stdio.h>
  4. #include <math.h>
  5. int main() {
  6. int dB2;
  7. printf("/" "* This file is only included exactly once!\n");
  8. printf(" *\n");
  9. printf(" * If they'd only tell us that generating this table was\n");
  10. printf(" * as easy as calculating\n");
  11. printf(" * hwvalue = 1048576.0*exp(0.057564628*dB*2)\n");
  12. printf(" * :) *" "/\n");
  13. printf("static int tas_gaintable[] = {\n");
  14. printf(" 0x000000, /" "* -infinity dB *" "/\n");
  15. for (dB2=-140;dB2<=36;dB2++)
  16. printf(" 0x%.6x, /" "* %-02.1f dB *" "/\n", (int)(1048576.0*exp(0.057564628*dB2)), dB2/2.0);
  17. printf("};\n\n");
  18. }
  19. */
  20. /* This file is only included exactly once!
  21. *
  22. * If they'd only tell us that generating this table was
  23. * as easy as calculating
  24. * hwvalue = 1048576.0*exp(0.057564628*dB*2)
  25. * :) */
  26. static int tas_gaintable[] = {
  27. 0x000000, /* -infinity dB */
  28. 0x00014b, /* -70.0 dB */
  29. 0x00015f, /* -69.5 dB */
  30. 0x000174, /* -69.0 dB */
  31. 0x00018a, /* -68.5 dB */
  32. 0x0001a1, /* -68.0 dB */
  33. 0x0001ba, /* -67.5 dB */
  34. 0x0001d4, /* -67.0 dB */
  35. 0x0001f0, /* -66.5 dB */
  36. 0x00020d, /* -66.0 dB */
  37. 0x00022c, /* -65.5 dB */
  38. 0x00024d, /* -65.0 dB */
  39. 0x000270, /* -64.5 dB */
  40. 0x000295, /* -64.0 dB */
  41. 0x0002bc, /* -63.5 dB */
  42. 0x0002e6, /* -63.0 dB */
  43. 0x000312, /* -62.5 dB */
  44. 0x000340, /* -62.0 dB */
  45. 0x000372, /* -61.5 dB */
  46. 0x0003a6, /* -61.0 dB */
  47. 0x0003dd, /* -60.5 dB */
  48. 0x000418, /* -60.0 dB */
  49. 0x000456, /* -59.5 dB */
  50. 0x000498, /* -59.0 dB */
  51. 0x0004de, /* -58.5 dB */
  52. 0x000528, /* -58.0 dB */
  53. 0x000576, /* -57.5 dB */
  54. 0x0005c9, /* -57.0 dB */
  55. 0x000620, /* -56.5 dB */
  56. 0x00067d, /* -56.0 dB */
  57. 0x0006e0, /* -55.5 dB */
  58. 0x000748, /* -55.0 dB */
  59. 0x0007b7, /* -54.5 dB */
  60. 0x00082c, /* -54.0 dB */
  61. 0x0008a8, /* -53.5 dB */
  62. 0x00092b, /* -53.0 dB */
  63. 0x0009b6, /* -52.5 dB */
  64. 0x000a49, /* -52.0 dB */
  65. 0x000ae5, /* -51.5 dB */
  66. 0x000b8b, /* -51.0 dB */
  67. 0x000c3a, /* -50.5 dB */
  68. 0x000cf3, /* -50.0 dB */
  69. 0x000db8, /* -49.5 dB */
  70. 0x000e88, /* -49.0 dB */
  71. 0x000f64, /* -48.5 dB */
  72. 0x00104e, /* -48.0 dB */
  73. 0x001145, /* -47.5 dB */
  74. 0x00124b, /* -47.0 dB */
  75. 0x001361, /* -46.5 dB */
  76. 0x001487, /* -46.0 dB */
  77. 0x0015be, /* -45.5 dB */
  78. 0x001708, /* -45.0 dB */
  79. 0x001865, /* -44.5 dB */
  80. 0x0019d8, /* -44.0 dB */
  81. 0x001b60, /* -43.5 dB */
  82. 0x001cff, /* -43.0 dB */
  83. 0x001eb7, /* -42.5 dB */
  84. 0x002089, /* -42.0 dB */
  85. 0x002276, /* -41.5 dB */
  86. 0x002481, /* -41.0 dB */
  87. 0x0026ab, /* -40.5 dB */
  88. 0x0028f5, /* -40.0 dB */
  89. 0x002b63, /* -39.5 dB */
  90. 0x002df5, /* -39.0 dB */
  91. 0x0030ae, /* -38.5 dB */
  92. 0x003390, /* -38.0 dB */
  93. 0x00369e, /* -37.5 dB */
  94. 0x0039db, /* -37.0 dB */
  95. 0x003d49, /* -36.5 dB */
  96. 0x0040ea, /* -36.0 dB */
  97. 0x0044c3, /* -35.5 dB */
  98. 0x0048d6, /* -35.0 dB */
  99. 0x004d27, /* -34.5 dB */
  100. 0x0051b9, /* -34.0 dB */
  101. 0x005691, /* -33.5 dB */
  102. 0x005bb2, /* -33.0 dB */
  103. 0x006121, /* -32.5 dB */
  104. 0x0066e3, /* -32.0 dB */
  105. 0x006cfb, /* -31.5 dB */
  106. 0x007370, /* -31.0 dB */
  107. 0x007a48, /* -30.5 dB */
  108. 0x008186, /* -30.0 dB */
  109. 0x008933, /* -29.5 dB */
  110. 0x009154, /* -29.0 dB */
  111. 0x0099f1, /* -28.5 dB */
  112. 0x00a310, /* -28.0 dB */
  113. 0x00acba, /* -27.5 dB */
  114. 0x00b6f6, /* -27.0 dB */
  115. 0x00c1cd, /* -26.5 dB */
  116. 0x00cd49, /* -26.0 dB */
  117. 0x00d973, /* -25.5 dB */
  118. 0x00e655, /* -25.0 dB */
  119. 0x00f3fb, /* -24.5 dB */
  120. 0x010270, /* -24.0 dB */
  121. 0x0111c0, /* -23.5 dB */
  122. 0x0121f9, /* -23.0 dB */
  123. 0x013328, /* -22.5 dB */
  124. 0x01455b, /* -22.0 dB */
  125. 0x0158a2, /* -21.5 dB */
  126. 0x016d0e, /* -21.0 dB */
  127. 0x0182af, /* -20.5 dB */
  128. 0x019999, /* -20.0 dB */
  129. 0x01b1de, /* -19.5 dB */
  130. 0x01cb94, /* -19.0 dB */
  131. 0x01e6cf, /* -18.5 dB */
  132. 0x0203a7, /* -18.0 dB */
  133. 0x022235, /* -17.5 dB */
  134. 0x024293, /* -17.0 dB */
  135. 0x0264db, /* -16.5 dB */
  136. 0x02892c, /* -16.0 dB */
  137. 0x02afa3, /* -15.5 dB */
  138. 0x02d862, /* -15.0 dB */
  139. 0x03038a, /* -14.5 dB */
  140. 0x033142, /* -14.0 dB */
  141. 0x0361af, /* -13.5 dB */
  142. 0x0394fa, /* -13.0 dB */
  143. 0x03cb50, /* -12.5 dB */
  144. 0x0404de, /* -12.0 dB */
  145. 0x0441d5, /* -11.5 dB */
  146. 0x048268, /* -11.0 dB */
  147. 0x04c6d0, /* -10.5 dB */
  148. 0x050f44, /* -10.0 dB */
  149. 0x055c04, /* -9.5 dB */
  150. 0x05ad50, /* -9.0 dB */
  151. 0x06036e, /* -8.5 dB */
  152. 0x065ea5, /* -8.0 dB */
  153. 0x06bf44, /* -7.5 dB */
  154. 0x07259d, /* -7.0 dB */
  155. 0x079207, /* -6.5 dB */
  156. 0x0804dc, /* -6.0 dB */
  157. 0x087e80, /* -5.5 dB */
  158. 0x08ff59, /* -5.0 dB */
  159. 0x0987d5, /* -4.5 dB */
  160. 0x0a1866, /* -4.0 dB */
  161. 0x0ab189, /* -3.5 dB */
  162. 0x0b53be, /* -3.0 dB */
  163. 0x0bff91, /* -2.5 dB */
  164. 0x0cb591, /* -2.0 dB */
  165. 0x0d765a, /* -1.5 dB */
  166. 0x0e4290, /* -1.0 dB */
  167. 0x0f1adf, /* -0.5 dB */
  168. 0x100000, /* 0.0 dB */
  169. 0x10f2b4, /* 0.5 dB */
  170. 0x11f3c9, /* 1.0 dB */
  171. 0x13041a, /* 1.5 dB */
  172. 0x14248e, /* 2.0 dB */
  173. 0x15561a, /* 2.5 dB */
  174. 0x1699c0, /* 3.0 dB */
  175. 0x17f094, /* 3.5 dB */
  176. 0x195bb8, /* 4.0 dB */
  177. 0x1adc61, /* 4.5 dB */
  178. 0x1c73d5, /* 5.0 dB */
  179. 0x1e236d, /* 5.5 dB */
  180. 0x1fec98, /* 6.0 dB */
  181. 0x21d0d9, /* 6.5 dB */
  182. 0x23d1cd, /* 7.0 dB */
  183. 0x25f125, /* 7.5 dB */
  184. 0x2830af, /* 8.0 dB */
  185. 0x2a9254, /* 8.5 dB */
  186. 0x2d1818, /* 9.0 dB */
  187. 0x2fc420, /* 9.5 dB */
  188. 0x3298b0, /* 10.0 dB */
  189. 0x35982f, /* 10.5 dB */
  190. 0x38c528, /* 11.0 dB */
  191. 0x3c224c, /* 11.5 dB */
  192. 0x3fb278, /* 12.0 dB */
  193. 0x4378b0, /* 12.5 dB */
  194. 0x477829, /* 13.0 dB */
  195. 0x4bb446, /* 13.5 dB */
  196. 0x5030a1, /* 14.0 dB */
  197. 0x54f106, /* 14.5 dB */
  198. 0x59f980, /* 15.0 dB */
  199. 0x5f4e52, /* 15.5 dB */
  200. 0x64f403, /* 16.0 dB */
  201. 0x6aef5e, /* 16.5 dB */
  202. 0x714575, /* 17.0 dB */
  203. 0x77fbaa, /* 17.5 dB */
  204. 0x7f17af, /* 18.0 dB */
  205. };