d4c.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //-----------------------------------------------------------------------------
  2. // Copyright 2012 Masanori Morise
  3. // Author: mmorise [at] yamanashi.ac.jp (Masanori Morise)
  4. // Last update: 2017/02/01
  5. //-----------------------------------------------------------------------------
  6. #ifndef WORLD_D4C_H_
  7. #define WORLD_D4C_H_
  8. #include "world/macrodefinitions.h"
  9. WORLD_BEGIN_C_DECLS
  10. //-----------------------------------------------------------------------------
  11. // Struct for D4C
  12. //-----------------------------------------------------------------------------
  13. typedef struct {
  14. double threshold;
  15. } D4COption;
  16. //-----------------------------------------------------------------------------
  17. // D4C() calculates the aperiodicity estimated by D4C.
  18. //
  19. // Input:
  20. // x : Input signal
  21. // x_length : Length of x
  22. // fs : Sampling frequency
  23. // temporal_positions : Time axis
  24. // f0 : F0 contour
  25. // f0_length : Length of F0 contour
  26. // fft_size : Number of samples of the aperiodicity in one frame.
  27. // : It is given by the equation fft_size / 2 + 1.
  28. // Output:
  29. // aperiodicity : Aperiodicity estimated by D4C.
  30. //-----------------------------------------------------------------------------
  31. void D4C(const double *x, int x_length, int fs,
  32. const double *temporal_positions, const double *f0, int f0_length,
  33. int fft_size, const D4COption *option, double **aperiodicity);
  34. //-----------------------------------------------------------------------------
  35. // InitializeD4COption allocates the memory to the struct and sets the
  36. // default parameters.
  37. //
  38. // Output:
  39. // option : Struct for the optional parameter.
  40. //-----------------------------------------------------------------------------
  41. void InitializeD4COption(D4COption *option);
  42. WORLD_END_C_DECLS
  43. #endif // WORLD_D4C_H_