【发布时间】:2011-07-20 10:38:09
【问题描述】:
我目前是got this bounty running on how to resample audio data with the intention of increasing the pitch。
已经制定了许多解决方案,我不得不承认我对选择和信息感到有些不知所措。
我被定向到this solution 并找到了这段代码:
public static float InterpolateCubic(float x0, float x1, float x2, float x3, float t)
{
float a0, a1, a2, a3;
a0 = x3 - x2 - x0 + x1;
a1 = x0 - x1 - a0;
a2 = x2 - x0;
a3 = x1;
return (a0 * (t * t * t)) + (a1 * (t * t)) + (a2 * t) + (a3);
}
public static float InterpolateHermite4pt3oX(float x0, float x1, float x2, float x3, float t)
{
float c0 = x1;
float c1 = .5F * (x2 - x0);
float c2 = x0 - (2.5F * x1) + (2 * x2) - (.5F * x3);
float c3 = (.5F * (x3 - x0)) + (1.5F * (x1 - x2));
return (((((c3 * t) + c2) * t) + c1) * t) + c0;
}
这看起来很简单,我可以绕圈子,但我想知道如何输入我想要增加音高的数量。这导致我提出以下问题:
第一种方法的 t 参数采用 0 到 1 之间的数字。这是我增加音高的因素吗?这会使 1 的音高增加 %100(基本上是速度的两倍)?
如果上述理论是正确的,我可以输入大于 1 的因子吗?如果没有,我怎么能做到这一点?
如果通过上述说明我已经清楚地表明我完全偏离了轨道,请有人帮助澄清我如何使用这种方法控制音高的增加量?
非常感谢。
【问题讨论】:
标签: audio signal-processing interpolation