For my Thesis I am analysing aircraft noise, in here a fan tone is visible when creating a spectrogram, however after removing background noise by removing a large moving average form the original. When searching for peaks in a small time bin, 100ms, the remaining found peaks are still quite noisy.
A different approach was for every 100ms, get the corresponding samplepoints, use a bandpass filter so only the intersing part is left, where the fan tone is expected and fititng that to a sin and using the non lineair optimization toolbox in matlab to find the optimum. However, if I want to do this automatically, so using code, the fit is not as good as my starting points dont change. When doing it manually these points get chosen by matlab, and those are optimized starting points. Is there any way to change the mode in my code to make matlab determine optimal values? Instead of the hard coded number array I am using at the moment?