/tags/rel-0-6-1/FreeSpeech/audio_blocks/include/audio.h

# · C Header · 24 lines · 16 code · 6 blank · 2 comment · 0 complexity · 1963e4abc1adf9e19300c17357d6ab13 MD5 · raw file

  1. // Copyright (C) 2001 InfoSpace Speech Solutions
  2. // author: Jean-Marc Valin
  3. #ifndef AUDIO_H
  4. #define AUDIO_H
  5. #include <math.h>
  6. inline float bark(float f)
  7. {
  8. return 13*atan(0.00076*f) + 3.5*atan((0.0001333*f) * (0.0001333*f));
  9. }
  10. inline float dB(float P)
  11. {
  12. return 4.3429*log(P);
  13. }
  14. inline float undB(float d)
  15. {
  16. return exp(0.23026*d);
  17. }
  18. #endif