preemph.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 : preemph.h
  11. * Purpose : Preemphasis filtering
  12. * Description : Filtering through 1 - g z^-1
  13. *
  14. ********************************************************************************
  15. */
  16. #ifndef preemph_h
  17. #define preemph_h "$Id $"
  18. /*
  19. ********************************************************************************
  20. * INCLUDE FILES
  21. ********************************************************************************
  22. */
  23. #include "typedef.h"
  24. /*
  25. ********************************************************************************
  26. * DEFINITION OF DATA TYPES
  27. ********************************************************************************
  28. */
  29. typedef struct {
  30. Word16 mem_pre; /* filter state */
  31. } preemphasisState;
  32. /*
  33. ********************************************************************************
  34. * DECLARATION OF PROTOTYPES
  35. ********************************************************************************
  36. */
  37. int preemphasis_init (preemphasisState **st);
  38. /* initialize one instance of the preemphasis filter
  39. Stores pointer to filter status struct in *st. This pointer has to
  40. be passed to preemphasis in each call.
  41. returns 0 on success
  42. */
  43. int preemphasis_reset (preemphasisState *st);
  44. /* reset of preemphasis filter (i.e. set state memory to zero)
  45. returns 0 on success
  46. */
  47. void preemphasis_exit (preemphasisState **st);
  48. /* de-initialize preemphasis filter (i.e. free status struct)
  49. stores NULL in *st
  50. */
  51. int preemphasis (
  52. preemphasisState *st, /* (i/o): preemphasis filter state */
  53. Word16 *signal, /* (i/o): input signal overwritten by the output */
  54. Word16 g, /* (i) : preemphasis coefficient */
  55. Word16 L /* (i) : size of filtering */
  56. );
  57. #endif