lag_wind.c 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. ********************************************************************************
  3. *
  4. * GSM AMR-NB speech codec R98 Version 7.6.0 December 12, 2001
  5. * R99 Version 3.3.0
  6. * REL-4 Version 4.1.0
  7. *
  8. ********************************************************************************
  9. *
  10. * File : lag_wind.c
  11. * Purpose : Lag windowing of autocorrelations.
  12. *
  13. ********************************************************************************
  14. */
  15. /*
  16. ********************************************************************************
  17. * MODULE INCLUDE FILE AND VERSION ID
  18. ********************************************************************************
  19. */
  20. #include "lag_wind.h"
  21. const char lag_wind_id[] = "@(#)$Id $" lag_wind_h;
  22. /*
  23. ********************************************************************************
  24. * INCLUDE FILES
  25. ********************************************************************************
  26. */
  27. #include "typedef.h"
  28. #include "basic_op.h"
  29. #include "oper_32b.h"
  30. #include "count.h"
  31. /*
  32. ********************************************************************************
  33. * LOCAL VARIABLES AND TABLES
  34. ********************************************************************************
  35. */
  36. #include "lag_wind.tab" /* Table for Lag_Window() */
  37. /*
  38. ********************************************************************************
  39. * PUBLIC PROGRAM CODE
  40. ********************************************************************************
  41. */
  42. /*************************************************************************
  43. *
  44. * FUNCTION: Lag_window()
  45. *
  46. * PURPOSE: Lag windowing of autocorrelations.
  47. *
  48. * DESCRIPTION:
  49. * r[i] = r[i]*lag_wind[i], i=1,...,10
  50. *
  51. * r[i] and lag_wind[i] are in special double precision format.
  52. * See "oper_32b.c" for the format.
  53. *
  54. *************************************************************************/
  55. void Lag_window (
  56. Word16 m, /* (i) : LPC order */
  57. Word16 r_h[], /* (i/o) : Autocorrelations (msb) */
  58. Word16 r_l[] /* (i/o) : Autocorrelations (lsb) */
  59. )
  60. {
  61. Word16 i;
  62. Word32 x;
  63. for (i = 1; i <= m; i++)
  64. {
  65. x = Mpy_32 (r_h[i], r_l[i], lag_h[i - 1], lag_l[i - 1]);
  66. L_Extract (x, &r_h[i], &r_l[i]);
  67. }
  68. return;
  69. }