1

there are many applications which analyses sound files or microphone inputs. For example a tuner-app for android. Now I am asking myself how they achieve it? I don't know how I should start. Maybe someone of you could give me input or a link to a tutorial. I already googled, but I am overwhelmed with flood of information. I'm only doing this as my hobby, and in the first step I would like to develop a small tuner-app. I hope someone of you can help me.

PS: I already developed several android-apps but most of my time I develop ASP .Net Web Applications. So I am not a newbie in software engineering, but I never analyzed microphone inputs or the like.

user3490546
  • 292
  • 6
  • 16
  • Just get the frequency of with a fast Fourier transform and then convert the hz to a note (charts available online) http://introcs.cs.princeton.edu/java/97data/FFT.java.html – JohanShogun Aug 16 '15 at 08:42
  • @JohanShogun: As is discussed here fairly regularly, this is not a particularly great way of building a tuner. – marko Aug 16 '15 at 09:44
  • @user3490546: You might care to look around for similar questions. There have been hundreds of them. – marko Aug 16 '15 at 09:44
  • http://stackoverflow.com/search?q=pitch+detection – marko Aug 16 '15 at 09:45
  • 2
    possible duplicate of [FFT for Pitch Detection](http://stackoverflow.com/questions/6487954/fft-for-pitch-detection) – marko Aug 16 '15 at 09:46
  • @marko I'd think it was good enough if all you want to do is get a fairly accurate tone, for a synthesizer I'd do it differently – JohanShogun Aug 16 '15 at 09:47
  • @JohanShogun: Have you actually tried building such an application? You'll be limited in accuracy by the FFT bin-width (although this can be solved by using a number of STFTs and a bit of maths). There are then a whole bunch of corner cases to deal with. – marko Aug 16 '15 at 09:49
  • @marko not yet but after this discussion I might do some experimenting. Basically what I'm getting at is, do you really need that level of accuracy for a tuner which I assume will use the phone mic and thus error prone to begin with. – JohanShogun Aug 16 '15 at 09:54
  • If you're building a musical instrument tuner, yes, it needs to be very accurate - probably to the cent. Whilst you're right that you can't rely on the quality of the phone's microphone on an Android device, the problem really lie in bandwidth - if you get a signal at a particular frequency, it will be good enough. You'll want to turn off the HPF on the mic. An pure FFT approach will be highly insensitive at lower frequencies. Don't try tuning an electric bass with it! – marko Aug 16 '15 at 10:10
  • In conclusion, it's not easy? I tested different apps, and some of them were very accurate. I compared my results with a high performance tuner and I was surprised that some apps worked that good. Now I am confused...is FFT the solution or is it to inaccurate? Is there another technologie/algorithm to get the pitch? Or are built in microphones just too weak to receive all informations needed? – user3490546 Aug 16 '15 at 12:10
  • You can do this with an FFT (or to be precise, a sequence of STFT) and a lot of post-processing, and, no, it's not easy. Plenty of other approaches exist and are used, with varying degrees of success https://www.google.co.uk/search?client=safari&rls=en&q=comparison+of+pitch+detection+algorithms&ie=UTF-8&oe=UTF-8&gfe_rd=cr&ei=oZPQVf-1BcvH8gft_o64Ag I wasn't able to find the particularly helpful paper with on the subject, but these should give you a taste of what's out there. – marko Aug 16 '15 at 13:46

0 Answers0