In order to detect peaks, you can rely on a bayesian approach.
Each peak P_i
can be modeled with a gaussian function characterized by its mean m_i
and its deviation sigma_i
.
F(x) ~ Sum_i { 1 / sigma_i / sqrt(2Pi) * exp(-(x - m_i)^2 / sigma_i^2) }
What you have is F(x_j)
for some x_j
. What you want are the (x_i, m_i)
for each i
, that minimize the least square distance :
(x_i, m_i) = argMin(Sum_j {(F(x_j) - Sum_i { 1 / sigma_i / sqrt(2Pi) * exp(-(x - m_i)^2 / sigma_i^2) })^2 })
This kind of equation can be solved with a non linear least squares solver.
Cheers