Extract audio frequency from instrument to find a musical note

≯℡__Kan透↙ 提交于 2019-11-30 16:31:38

There is a huge difference between the most powerful frequency component in a spectrum and the perceived pitch by a human listener.

This academic paper is probably the definitive review of approaches to solving some of the problems of pitch detection, but does not address the perceptual issues you will need to deal with using real signals. At the very least you'll need to account for string and wind-column instruments that jump octave at the beginning and end of notes, and missing fundamentals. This will be a particular lottery on Android where microphones on devices are not in any way consistent.

Searching for the peak frequency in the spectrum is no better than using autocorrelation and frequently wrong with real signals.

The FFT approach (more properly, using STFT and frequency estimation from the phase differences) can be made to work, but only with a lot of post-processing of the spectrum. Several commercial chromatic tuner apps use an FFT-based approach (I can attest to this having written one).

You might like to have a look how some of the feature extraction plugins for Sonic Visualiser go about solving this problem.

I also recommend reviewing the vast number of previous questions on here asking pretty much the same thing - usually questioners wanting to build Guitar tuners.

For what it's worth - I believe electronic tuners for musical instruments (e.g. guitar tuners, etc.) don't do it this way. Instead of doing a FFT like you're doing, they are simply measuring the period of the waves - (i.e. the time between the zero crossings), then computing the frequency from the period.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!