Advertisement
vohamthuat

lib

May 25th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #ifndef SAMPLEFILTER_H_
  2. #define SAMPLEFILTER_H_
  3.  
  4. /*
  5.  
  6. FIR filter designed with
  7. http://t-filter.appspot.com
  8.  
  9. sampling frequency: 8000 Hz
  10.  
  11. fixed point precision: 16 bits
  12.  
  13. * 0 Hz - 2900 Hz
  14. gain = 0
  15. desired attenuation = -40 dB
  16. actual attenuation = n/a
  17.  
  18. * 3000 Hz - 4000 Hz
  19. gain = 3
  20. desired ripple = 5 dB
  21. actual ripple = n/a
  22.  
  23. */
  24.  
  25. #define SAMPLEFILTER_TAP_NUM 101
  26.  
  27. typedef struct {
  28. int history[SAMPLEFILTER_TAP_NUM];
  29. unsigned int last_index;
  30. } SampleFilter;
  31.  
  32. void SampleFilter_init(SampleFilter* f);
  33. void SampleFilter_put(SampleFilter* f, int input);
  34. int SampleFilter_get(SampleFilter* f);
  35.  
  36. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement