How to avoid overtones in audio signal I'm trying to make a program that catch and audio signal of a bass and show the notes that have been played. My program:


Gets the sound and put it in a double data type array. (48&nbsp;000Hz, 16bits) (1 frame in array per sample)
Splits the array into many arrays, with 4~5 arrays in a second approx.
Applies FFT algorithm to every array and left the same number of array's that have been created in the last step with frequency domain instead of time domain.
Obtains the highest number of each array. That's the note that I have played with the bass.


This works and get the frequency when I don't split the array, for most of the times, but when I split it doesn't work even for the half of the results, maybe I have to use another way for get several notes instead of splitting. But the results are good too, so I think the problem is that I have to apply some filters.

The first one has to be a filter for the range of the bass (41 - 784), assuming that I'm not playing anything that time if it's out of that range.

Many times, if I play 41Hz (E1), the program interpret that I'm playing 82Hz (E2), or even a higher harmonic, and I don't know what to do with that. I could turn into 0Hz every note that has been played after the same note or one of its harmonics, but then how could I play the same note several times.


Some advice for deal with this problems?
Should I split the original array into more/less array's for get more accuracy?
Which filters should I apply on my frequency or time domain array for get all the notes that have been played, with the right frequency and avoiding their harmonics?
A good stringed instrument music pitch detection/estimation algorithm will do the opposite, e.g. it will not ignore overtones.  Instead it will pay attention to the harmonics, specifically the harmonic train and its spacing, as this is a stronger indication of human perceived pitch than spectral content at the fundamental frequency (which could be nearly or completely missing, depending on the microphone and channel characteristics).

If you want to work in the frequency domain, than look into cepstrum/cepstral analysis and/or the Harmonic Product Spectrum algorithm, which can estimate pitch from spectral periodicity.  Or you can instead work in the time domain using weighted/interpolated autocorrelation, ASDF, AMDF, etc. type algorithms for pitch estimation.

If you slice your time windows too small, then there will be very few full cycles at he fundamental pitch frequency, which causes FFT frequency estimation to have very poor resolution.  A parametric estimator within and across windows may work better than a bare FFT.