I am trying write a program that continuously tracks the location a peak. To do that I need a very good peak detection algorithm. It not only has to tell the location of the peak but also the absence of it.
My current approach for peak detection:
Baseline subtracted (account for different baseline signals)
Divided by standard deviation of the smoothed signal (account for different baseline signals)
I superimposed all the candidate peak data from all the spectra (local minima after gaussian smooth) and did a gaussian mixture in one dimension (y-axis; 2 clusters;100 spectra;3000 data points)
Yellow - "peaks" cluster; blue - "noise" cluster.
Trouble region: between 1 and 3 in the Y (cannot distinguish shallow peaks from spectra of with no peak).
How do I approach this problem to make the peak detection sensitive enough but still can tell if the peak is not there? Is there any better way to normalize the data? What unsupervised learning algorithm would be suitable for this(my data is unlabeled)? Please let me know if you have any suggestion. It will be greatly appreciated.
Peak shapes and sizes, and noise level vary greatly:
How the data is obtained:
A peak can be thought of as a response of a harmonic oscillator in a frequency sweep.
One example of a harmonic oscillator is a swing. (or a ball on a spring; a ball in a well). They are all characterized by the periodic motion related to a natural position. In the swing example, the natural position is at the middle when the girl first got on the swing.
Imagine a person started periodically pushing her on the back as she swings, her swinging motion might increase. However, if the person pushes her at the wrong time, like pushing her back when her back is coming towards him, she will slow down and will not swing higher. This is because the frequency of the push (driving frequency) does not match the periodic movement of the swing (natural frequency). Imagine the person gradually increases the frequency of the push from really infrequent to really frequent (frequency sweep), the frequency of the push will at some point match the natural frequency of the swing (coming into resonance). In other words, every push of the person will be at the right time and will push her higher and higher.
Imagine you shine a very bright spot light at the natural position of the swing (the lowest position). The amount of time the girl spends inside of the spot light will depend on how high she swings. So the higher she swings, the less time she will spend in the light. Back to my plot, the signal (y axis) depends on how far the harmonic oscillator swings and the dip of the plot tells me at what driving frequency it comes into resonance.(driving frequency matches with natural frequency so it swings very far and decreases the signal)
A shifting baseline is due to a drift in the spot light brightness itself
I hope that would clarify things a bit.