音符半倍頻規(guī)整
提取基頻時(shí),半倍頻普遍出現(xiàn),對此必須做好半倍頻規(guī)整
inline float normalize_pitch(float pitch, float temp)
{
float half = fabs(pitch - 12 - temp);
float twice = fabs(pitch + 12 - temp);
float self = fabs(pitch - temp);
if (half < twice && half < self)
{
return pitch - 12;
}
else if (twice < half && twice < self)
{
return pitch + 12;
}
}
{
float half = fabs(pitch - 12 - temp);
float twice = fabs(pitch + 12 - temp);
float self = fabs(pitch - temp);
if (half < twice && half < self)
{
return pitch - 12;
}
else if (twice < half && twice < self)
{
return pitch + 12;
}
}
posted on 2012-05-24 08:56 夜貓子 閱讀(463) 評論(0) 編輯 收藏 引用 所屬分類: 語音處理

