Extract audio frequency from instrument to find a musical note

后端 未结 2 1123
时光说笑
时光说笑 2021-01-03 16:50

I\'m trying to develop an Android app that extracts audio frequency from an instrument. I\'m using Fast Fourier Transform method with Jtransforms. Here is what I have so far

相关标签:
2条回答
  • 2021-01-03 17:10

    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.

    0 讨论(0)
  • 2021-01-03 17:13

    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.

    0 讨论(0)
提交回复
热议问题