In complex sound I need to determine the fundamental frequency but the Fast Fourier Transform catch other frequency which have a small differences value with other frequency. Can anybody help me? Thank you
The most direct and simple method is to take a longer FFT. This may require zero padding if you do not have enough input samples. (If the input signal is stable and you have enough data, it is better to increase the FFT size using more input samples than to zero pad.) This separates the signals into narrower FFT bins and may be enough to separate the two signals.
If that does not work, a slightly more complicated method is to use the Chirp Z Transform (CZT). If you have access to Matlab or Octave, this is given by the command czt(). Set up the CZT so that it follows a contour along the unit circle in the Z plane (in matlab, parameter A = exp(1i*2*pi*LowF/SR), where LowF is a frequency somewhat lower than the frequency being examined. Set increments of frequency (deltaF) between points smaller than the width of the FFT bins (W = exp(-1i*2*pi*deltaF)).
Both of these methods will fail if the signals are too close together and there are not enough input samples. In this case, more sophisticated methods are available, but from the question it is not obvious that more sophisticated methods are necessary, so I'll start with these simple suggestions.
If the frequency you want to detect has a large number of harmonics and the frequency you want to ignore doesn't, you could try calculating the cepstrum (the IFT of the log magnitude of the spectrum).
to my best knowledge, the most complete information on the subject one can find in the book of Zwicker, E., Feldtkeller, R .: Das Ohr als Nachrichtenempfänger (1967). In particular, the minimum perceptible frequency deviation is equal 0.02 of the width of a frequency group. At frequencies above 500 Hz the width of a frequency group is equal to 17% of the mean frequency and the minimum perceptible frequency deviation is equal to 0.35%.
Your question seems a simple one to answer, but could you please give more details? Is the problem to extract the fundamental from the harmonics, i.e. you have one sound source with the harmonic spectrum? Or you have a number of sound sources mixed, each with its own spectrum? Or your question is what error in your estimation of the fundamental frequency is acceptable, because of the JND in pitch perception of humans? It the last case the JND depends on a number of factors, and in general this JND ranges from 0.2% of the value of the fundamental frequency, which is an absolute minimum in most favourable conditions, to roughly 1%.