epr.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* Copyright 2013 Tobias Platen */
  2. /* This file is part of Sekai.
  3. Sekai is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 3 of the License, or
  6. (at your option) any later version.
  7. Sekai is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with Sekai. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #ifndef WORLD_EPR_H_
  15. #define WORLD_EPR_H_
  16. typedef struct {
  17. double gaindb;
  18. double slope;
  19. double slopedepthdb;
  20. } EprSourceParams;
  21. void EprSourceEstimate(double *spectrogram, int fft_size, int fs, double f0,
  22. EprSourceParams *params);
  23. typedef struct {
  24. // set by the user
  25. double f;
  26. double bw;
  27. double gain_db;
  28. int enabled;
  29. // needs to be updated by calling EprResonanceUpdate if any user value is
  30. // changed
  31. double a;
  32. double b;
  33. double c;
  34. double norm;
  35. } EprResonance;
  36. int EprVocalTractEstimate(double *spectrogram, int fft_size, int fs, double f0,
  37. EprSourceParams *params, double *residual,
  38. EprResonance *res, int nres);
  39. double EprResonanceAtFrequency(EprResonance *me, double f, int fs);
  40. void EprResonanceUpdate(EprResonance *me, int fs);
  41. double EprAtFrequency(EprSourceParams *params, double f, int fs,
  42. EprResonance *res, int n_res);
  43. #endif