levinson.h 2.6 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 : levinson.h
  11. * Purpose : Levinson-Durbin algorithm in double precision.
  12. * : To compute the LP filter parameters from the
  13. * : speech autocorrelations.
  14. *
  15. ********************************************************************************
  16. */
  17. #ifndef levinson_h
  18. #define levinson_h "$Id $"
  19. /*
  20. ********************************************************************************
  21. * INCLUDE FILES
  22. ********************************************************************************
  23. */
  24. #include "typedef.h"
  25. #include "cnst.h"
  26. /*
  27. ********************************************************************************
  28. * LOCAL VARIABLES AND TABLES
  29. ********************************************************************************
  30. */
  31. /*
  32. ********************************************************************************
  33. * DEFINITION OF DATA TYPES
  34. ********************************************************************************
  35. */
  36. typedef struct {
  37. Word16 old_A[M + 1]; /* Last A(z) for case of unstable filter */
  38. } LevinsonState;
  39. /*
  40. ********************************************************************************
  41. * DECLARATION OF PROTOTYPES
  42. ********************************************************************************
  43. */
  44. int Levinson_init (LevinsonState **st);
  45. /* initialize one instance of the pre processing state.
  46. Stores pointer to filter status struct in *st. This pointer has to
  47. be passed to Levinson in each call.
  48. returns 0 on success
  49. */
  50. int Levinson_reset (LevinsonState *st);
  51. /* reset of pre processing state (i.e. set state memory to zero)
  52. returns 0 on success
  53. */
  54. void Levinson_exit (LevinsonState **st);
  55. /* de-initialize pre processing state (i.e. free status struct)
  56. stores NULL in *st
  57. */
  58. int Levinson (
  59. LevinsonState *st,
  60. Word16 Rh[], /* i : Rh[m+1] Vector of autocorrelations (msb) */
  61. Word16 Rl[], /* i : Rl[m+1] Vector of autocorrelations (lsb) */
  62. Word16 A[], /* o : A[m] LPC coefficients (m = 10) */
  63. Word16 rc[] /* o : rc[4] First 4 reflection coefficients */
  64. );
  65. #endif