filter.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /******************************************************************
  2. iLBC Speech Coder ANSI-C Source Code
  3. filter.h
  4. Copyright (C) The Internet Society (2004).
  5. All Rights Reserved.
  6. ******************************************************************/
  7. #ifndef __iLBC_FILTER_H
  8. #define __iLBC_FILTER_H
  9. void AllPoleFilter(
  10. float *InOut, /* (i/o) on entrance InOut[-orderCoef] to
  11. InOut[-1] contain the state of the
  12. filter (delayed samples). InOut[0] to
  13. InOut[lengthInOut-1] contain the filter
  14. input, on en exit InOut[-orderCoef] to
  15. InOut[-1] is unchanged and InOut[0] to
  16. InOut[lengthInOut-1] contain filtered
  17. samples */
  18. float *Coef,/* (i) filter coefficients, Coef[0] is assumed
  19. to be 1.0 */
  20. int lengthInOut,/* (i) number of input/output samples */
  21. int orderCoef /* (i) number of filter coefficients */
  22. );
  23. void AllZeroFilter(
  24. float *In, /* (i) In[0] to In[lengthInOut-1] contain
  25. filter input samples */
  26. float *Coef,/* (i) filter coefficients (Coef[0] is assumed
  27. to be 1.0) */
  28. int lengthInOut,/* (i) number of input/output samples */
  29. int orderCoef, /* (i) number of filter coefficients */
  30. float *Out /* (i/o) on entrance Out[-orderCoef] to Out[-1]
  31. contain the filter state, on exit Out[0]
  32. to Out[lengthInOut-1] contain filtered
  33. samples */
  34. );
  35. void ZeroPoleFilter(
  36. float *In, /* (i) In[0] to In[lengthInOut-1] contain filter
  37. input samples In[-orderCoef] to In[-1]
  38. contain state of all-zero section */
  39. float *ZeroCoef,/* (i) filter coefficients for all-zero
  40. section (ZeroCoef[0] is assumed to
  41. be 1.0) */
  42. float *PoleCoef,/* (i) filter coefficients for all-pole section
  43. (ZeroCoef[0] is assumed to be 1.0) */
  44. int lengthInOut,/* (i) number of input/output samples */
  45. int orderCoef, /* (i) number of filter coefficients */
  46. float *Out /* (i/o) on entrance Out[-orderCoef] to Out[-1]
  47. contain state of all-pole section. On
  48. exit Out[0] to Out[lengthInOut-1]
  49. contain filtered samples */
  50. );
  51. void DownSample (
  52. float *In, /* (i) input samples */
  53. float *Coef, /* (i) filter coefficients */
  54. int lengthIn, /* (i) number of input samples */
  55. float *state, /* (i) filter state */
  56. float *Out /* (o) downsampled output */
  57. );
  58. #endif