问题描述
我已经使用FFT算法来检测声音的频率(吉他音高),当我从计算机播放正弦声音时,它的效果很好,可以完美地估计它,但是当我使用吉他时,它并不是那么完美.如何更好地估计音调频率?
I have used FFT algorithm to detect frequency of the sound(guitar pitch) and it works great when I play sinosoidal sound from the computer it will estimate it perfectly but it is not so perfect when i use guitar. How to better estimate the pitch frequency?
double[] spectrum = FourierTransform.Spectrum(ref sampleBuffer);//spectrum contains data from FFT
double frequency = indexOfMax(spectrum) * 16000 / 500; //sampling rate/FFT size
//indexOfMax just finds the index of the maximum element in the array
我使用了产生正弦波的方法: http://www.audiocheck.net/audiofrequencysignalgenerator_sinetone.php这种堡垒只是在频谱阵列中找到最大值,效果很好,但我正在寻找更好的方法.
To generate sinosoidal waves i used: http://www.audiocheck.net/audiofrequencysignalgenerator_sinetone.php and fort this kind of waves just finding maximum from the spectrum array worked great, but I am looking for better way.
推荐答案
对于吉他声音,音高检测/估计的一些可能性包括将FFT结果用作计算倒频谱以进行倒频谱分析或谐波乘积谱的第一步分析,或通过IFFT(FFT()*共轭(FFT()))进行快速自相关.
For guitar sounds, some possibilities for pitch detection/estimation include using the FFT result as the first step of computing the cepstrum for cepstral analysis, or for harmonic product spectrum analysis, or for doing a fast autocorrelation by IFFT(FFT() * conjugate(FFT())).
这篇关于根据FFT(已经)结果更准确地估计吉他音高频率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!