自相关返回与麦克风输入随机的结果(使用高通滤波器) [英] Autocorrelation returns random results with mic input (using a high pass filter)

查看:546
本文介绍了自相关返回与麦克风输入随机的结果(使用高通滤波器)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不好意思问类似的问题的人之前,我问( FFT问题(返回随机结果)),但我已经抬头间距检测和自相关,并发现使用了自相关基音检测一些code。

Sorry to ask a similar question to the one i asked before (FFT Problem (Returns random results)), but i've looked up pitch detection and autocorrelation and have found some code for pitch detection using autocorrelation.

我试着做一个用户唱歌音调检测。问题是,它使返回随机的结果。我有一些code从 HTTP://$c$c.google。 COM / p / yaalp / 我已经转换为C ++和修改(如下图)。我的采样率是2048,和数据大小是1024,我既检测正弦波和麦克风输入的音高。正弦波的频率为726.0,其检测它是722.950820(其即时确定与),但其检测所述话筒从大约100的随机数的间距围绕1050

Im trying to do pitch detection of a users singing. Problem is, it keeps returning random results. I've got some code from http://code.google.com/p/yaalp/ which i've converted to C++ and modified (below). My sample rate is 2048, and data size is 1024. I'm detecting pitch of both a sine wave and mic input. The frequency of the sine wave is 726.0, and its detecting it to be 722.950820 (which im ok with), but its detecting the pitch of the mic as a random number from around 100 to around 1050.

我现在用的是高通滤波器,以消除直流失调,但它不工作。我做是正确的,如果是的话,我还能做什么来解决它?任何帮助将大大AP preciated!

I'm now using a High pass filter to remove the DC offset, but it's not working. Am i doing it right, and if so, what else can i do to fix it? Any help would be greatly appreciated!

(固定)

谢谢,

尼尔。

编辑:改变了code来实现与为30Hz的截止高通滤波器(从的什么是高通和低通滤波器?,谁能告诉我如何使用卷积高通吗?)到低通滤波器转换,但它仍然返回随机的结果。将其插入一个VST宿主,并使用VST插件比较频谱是不是一种选择,我很遗憾。

Changed the code to implement a high pass filter with a cutoff of 30hz (from What Are High-Pass and Low-Pass Filters?, can anyone tell me how to convert the low-pass filter using convolution to a high-pass one?) but it's still returning random results. Plugging it into a VST host and using VST plugins to compare spectrums isn't an option to me unfortunately.

编辑:固定的,每个人的帮助的感谢,但我从来没有得到它的工作,现在用新的code

Fixed, thanks for everyones help, but I never got it to work, now using new code.

推荐答案

我没有健全的专家,但如果你与44100采样(我猜每秒采样),并使用1024个数据点。您正在使用的1/40第二个有价值的数据的工作。当前音高变化了很多,我不会让我感到吃惊取决于你选择哪一块。如果你想找到声音的平均或主球场上,我预计大约需要数据1秒值得的。

I am no sound expert, but if you are sampling with 44100 (I guess samples per second) and use 1024 datapoints. You are working with about 1/40th of a second worth of data. I doesn't surprise me that the current pitch varies a lot, depending on which piece you pick. If you want to find the average or main pitch of a voice, I'd expect to need about 1second worth of data.

这篇关于自相关返回与麦克风输入随机的结果(使用高通滤波器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆