【问题标题】:Yin algorithm(Pitch detection) - Alternative to Difference Function阴算法(音高检测) - 差分函数的替代方案
【发布时间】:2018-11-09 09:23:46
【问题描述】:

我已经实现了Yin Algorithm 来检测音高。

我的问题是差分函数的性能(方程式 6)

差分函数:

static std::vector<double> difference(const std::vector<double> &data)
{
    int index, tau;
    double delta;
    int yin_buffer_size = signed(data.size() / 2);
    std::vector<double> yin_buffer(yin_buffer_size, 0.0);

    for (tau = 1; tau < yin_buffer_size; tau++) {
        for (index = 0; index < yin_buffer_size; index++) {
            delta = data[index] - data[index + tau];
            yin_buffer[tau] += delta * delta;
        }
    }
    return yin_buffer;
}

其中data 包含特定窗口大小的音频数据。

如您所见,随着数据大小(窗口大小)的增加,此函数会变慢。

如果有更快的差分函数的替代方法,请告诉我。我想朝着正确的方向前进。

我是信号处理的新手,非常感谢您的帮助。

【问题讨论】:

  • 可能是信号处理的问题。

标签: c++ algorithm audio signal-processing audio-processing


【解决方案1】:

好的,Yin 论文描述了我们可以使用公式 7 代替公式 6。 公式 7 可以使用更快的 FFT 得出。

一个简单的在线搜索提供了很多实现示例。

可以在here 中找到一个由名为 JorenSix 的用户完成的实现。 JorenSix,如果您正在阅读本文,谢谢。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-11-18
    • 2016-09-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-17
    • 1970-01-01
    相关资源
    最近更新 更多