# Spectral Peak-Picking in MS Excel

I'm working often with spectral data of various gases, and the bulk of the data analysis is assigning the peaks with maximum signal (y-axis) to frequency (x-axis). Often we have several thousand data points, and it can be quite difficult to manually find peaks. I've tried getting around this in Excel with clever IF/AND statements, but the major obstacle is signal noise: I simply cannot devise a clever Excel statement to help me pick peaks.

For example, using an =IF(AND(greater signal than adjacent points),"max","") statement gives tons of extraneous hits where the noise causes a slight fluctuation in the data. Similarly, creating a column of slopes and doing an =IF(slope goes from + to -),"max","") statement also gives bad data.

The most elegant solution I have is to pick an arbitrary value # that most of my peaks are above and use an =IF(AND(slope goes from + to -,B>#),"max","") statement. That seems to work for stronger peaks (maybe 70% of the peaks on a good day), but I still have to go in and manually look at the weaker peaks (and often when doing these spectra many energetic transitions that need labeling are statistically unlikely-->low signal). I'm wondering if anyone here has a better solution able to detect local maxima not resulting from noise with a better success rate.

• What signal-to-noise ratios are you trying to successfully observe peaks within?
– long
Apr 20, 2015 at 23:32
• The SNR seems pretty high, I can very easily see the peaks and just look through those regions to find local maxima. Are you thinking about using the noise standard deviation to weed out bad hits? Apr 20, 2015 at 23:36
• Yep. Also, if you only have positive peaks and have a good horizontal baseline centered around zero, you could calculate noise from the negative noise component, and double it. This will give you low SNR peaks. Presumably you data set has a large number of points.
– long
Apr 20, 2015 at 23:56
• You're right, it's a large data set. That actually worked pretty well for part of the data, but unfortunately our IR isn't very good, so the higher frequency region sees the baseline deviating downwards to below zero. Apr 21, 2015 at 0:17
• I would smooth your data with a rolling average and the repeat your if(and(...)), adding as one of the constraints that the absolute signal value be greater than some threshold. If that doesn't work, it may be time to move beyond Excel. The python/scipy code scipy.signal.find_peaks_cwt() would probably be a one-liner for you. Apr 21, 2015 at 0:38