Generalized function that finds the maxima for those spectra who have a central peak