More accurate estimating guitar pitch frequency ba

2019-06-11 10:21发布

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

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.

2条回答
祖国的老花朵
2楼-- · 2019-06-11 10:31

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())).

查看更多
霸刀☆藐视天下
3楼-- · 2019-06-11 10:31

Automatic pitch determination for musical instruments is non-trivial.

Take a look at this post on the Cepstrum approach to the problem: Musical instrument Cepstrum

查看更多
登录 后发表回答