How can I identify peaks in spectra?

  • Thread starter Thread starter khdani
  • Start date Start date
  • Tags Tags
    Spectra
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 4K views
khdani
Messages
53
Reaction score
0
hello,
i've Spectra(set of data points) and i need to identify the peaks of the spectra.
are there any algorithms for that ?
 
Physics news on Phys.org
Sure, just go through your array collecting points where a[i-1] < a > a[i+1]. Of course, that might give you "peaks" that are just random fluctuations in your data. You could try to prevent that by replacing each a with a weighted average of nearby elements beforehand, smoothing the function.
 
it's a very simple algorithm which will give incorrect results...
i've tried more complex algorithms, like looking for slopes from left sides of peak and right sides,
but with no success...
 
That's true; now you just need to determine the location of the relevant peaks (whether it be the spectral width of the peak, or using a simple thresholding algorithm--if it's above value X then it's a peak--or running the data through a low-pass filter to smooth out the noise prior to finding the peaks).

Or, if you know a priori where the peaks ought to be, you can use these peak locations to create an appropriate comb filter which filters out only the values at those wavelengths (and of a certain spectral width, once again). But again, you'd need to know exactly what you're looking for, and either compensate for spectral shifting or make the comb sufficiently wide that you don't end up cutting off the peak.
 
Last edited: