Add files via upload

This commit is contained in:
Ναρουσέ·μ·γιουμεμί·Χινακάννα 2023-04-07 23:43:20 +08:00 committed by GitHub
parent 3fb7d29802
commit 29f7aa3fbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,28 @@
#include "World/src/world/dio.h"
#include "World/src/world/stonemask.h"
#include "World/src/world/matlabfunctions.h"
class F0PreProcess
{
public:
int fs;
short hop;
const int f0_bin = 256;
const double f0_max = 1100.0;
const double f0_min = 50.0;
const double f0_mel_min = 1127.0 * log(1.0 + f0_min / 700.0);
const double f0_mel_max = 1127.0 * log(1.0 + f0_max / 700.0);
F0PreProcess(int sr = 16000, short h = 160) :fs(sr), hop(h) {}
~F0PreProcess()
{
delete[] rf0;
rf0 = nullptr;
}
void compute_f0(const double* audio, int64_t len);
void InterPf0(int64_t len);
long long* f0Log();
int64_t getLen()const { return f0Len; }
private:
double* rf0 = nullptr;
int64_t f0Len = 0;
};