home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Sound / SoX / Source / cvsdfilt.h < prev    next >
Text File  |  1999-07-18  |  5KB  |  122 lines

  1. /*
  2.  *      CVSD (Continuously Variable Slope Delta modulation)
  3.  *      conversion routines
  4.  *
  5.  *      The CVSD format is described in the MIL Std 188 113, which is
  6.  *      available from http://bbs.itsi.disa.mil:5580/T3564
  7.  *
  8.  *    Copyright (C) 1996  
  9.  *      Thomas Sailer (sailer@ife.ee.ethz.ch) (HB9JNX/AE4WA)
  10.  *      Swiss Federal Institute of Technology, Electronics Lab
  11.  *
  12.  *    This program is free software; you can redistribute it and/or modify
  13.  *    it under the terms of the GNU General Public License as published by
  14.  *    the Free Software Foundation; either version 2 of the License, or
  15.  *    (at your option) any later version.
  16.  *
  17.  *    This program is distributed in the hope that it will be useful,
  18.  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
  19.  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20.  *    GNU General Public License for more details.
  21.  *
  22.  *    You should have received a copy of the GNU General Public License
  23.  *    along with this program; if not, write to the Free Software
  24.  *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  25.  *
  26.  */
  27.  
  28. /* ---------------------------------------------------------------------- */
  29.  
  30. #define ENC_FILTERLEN 16  /* PCM sampling rate */
  31. #define DEC_FILTERLEN 48  /* CVSD sampling rate */
  32.  
  33. /* ---------------------------------------------------------------------- */
  34.  
  35. static float dec_filter_16[48] = {
  36.            0.001102,       0.001159,       0.000187,      -0.000175,
  37.            0.002097,       0.006543,       0.009384,       0.008004,
  38.            0.006562,       0.013569,       0.030745,       0.047053,
  39.            0.050491,       0.047388,       0.062171,       0.109115,
  40.            0.167120,       0.197144,       0.195471,       0.222098,
  41.            0.354745,       0.599184,       0.849632,       0.956536,
  42.            0.849632,       0.599184,       0.354745,       0.222098,
  43.            0.195471,       0.197144,       0.167120,       0.109115,
  44.            0.062171,       0.047388,       0.050491,       0.047053,
  45.            0.030745,       0.013569,       0.006562,       0.008004,
  46.            0.009384,       0.006543,       0.002097,      -0.000175,
  47.            0.000187,       0.001159,       0.001102,       0.000000
  48. };
  49.  
  50. /* ---------------------------------------------------------------------- */
  51.  
  52. static float dec_filter_32[48] = {
  53.            0.001950,       0.004180,       0.006331,       0.007907,
  54.            0.008510,       0.008342,       0.008678,       0.011827,
  55.            0.020282,       0.035231,       0.055200,       0.075849,
  56.            0.091585,       0.098745,       0.099031,       0.101287,
  57.            0.120058,       0.170672,       0.262333,       0.392047,
  58.            0.542347,       0.684488,       0.786557,       0.823702,
  59.            0.786557,       0.684488,       0.542347,       0.392047,
  60.            0.262333,       0.170672,       0.120058,       0.101287,
  61.            0.099031,       0.098745,       0.091585,       0.075849,
  62.            0.055200,       0.035231,       0.020282,       0.011827,
  63.            0.008678,       0.008342,       0.008510,       0.007907,
  64.            0.006331,       0.004180,       0.001950,      -0.000000
  65. };
  66.  
  67. /* ---------------------------------------------------------------------- */
  68.  
  69. static float enc_filter_16_0[16] = {
  70.           -0.000362,       0.004648,       0.001381,       0.008312,
  71.            0.041490,      -0.001410,       0.124061,       0.247446,
  72.           -0.106761,      -0.236326,      -0.023798,      -0.023506,
  73.           -0.030097,       0.001493,      -0.005363,      -0.001672
  74. };
  75.  
  76. static float enc_filter_16_1[16] = {
  77.            0.001672,       0.005363,      -0.001493,       0.030097,
  78.            0.023506,       0.023798,       0.236326,       0.106761,
  79.           -0.247446,      -0.124061,       0.001410,      -0.041490,
  80.           -0.008312,      -0.001381,      -0.004648,       0.000362
  81. };
  82.  
  83. static float *enc_filter_16[2] = {
  84.     enc_filter_16_0, enc_filter_16_1
  85. };
  86.  
  87. /* ---------------------------------------------------------------------- */
  88.  
  89. static float enc_filter_32_0[16] = {
  90.           -0.000289,       0.002112,       0.001421,       0.002235,
  91.            0.021003,       0.001237,       0.047132,       0.129636,
  92.           -0.027328,      -0.126462,      -0.021456,      -0.008069,
  93.           -0.017959,       0.000301,      -0.002538,      -0.001278
  94. };
  95.  
  96. static float enc_filter_32_1[16] = {
  97.           -0.000010,       0.002787,       0.000055,       0.006813,
  98.            0.020249,      -0.000995,       0.077912,       0.112870,
  99.           -0.076980,      -0.106971,      -0.005096,      -0.015449,
  100.           -0.012591,       0.000813,      -0.003003,      -0.000527
  101. };
  102.  
  103. static float enc_filter_32_2[16] = {
  104.            0.000527,       0.003003,      -0.000813,       0.012591,
  105.            0.015449,       0.005096,       0.106971,       0.076980,
  106.           -0.112870,      -0.077912,       0.000995,      -0.020249,
  107.           -0.006813,      -0.000055,      -0.002787,       0.000010
  108. };
  109.  
  110. static float enc_filter_32_3[16] = {
  111.            0.001278,       0.002538,      -0.000301,       0.017959,
  112.            0.008069,       0.021456,       0.126462,       0.027328,
  113.           -0.129636,      -0.047132,      -0.001237,      -0.021003,
  114.           -0.002235,      -0.001421,      -0.002112,       0.000289
  115. };
  116.  
  117. static float *enc_filter_32[4] = {
  118.     enc_filter_32_0, enc_filter_32_1, enc_filter_32_2, enc_filter_32_3
  119. };
  120.  
  121. /* ---------------------------------------------------------------------- */
  122.