How to deconvolute Gaussian peaks with known locations and heights

조회 수: 4 (최근 30일)
Irem Altan
Irem Altan 2021년 8월 24일
댓글: Irem Altan 2021년 8월 24일
I have a signal with 9 or 10 peaks. I can get the peak locations by fitting a smoothing spline to the data and then using the findpeaks function. The result looks like this:
Now, I would like to deconvolute this signal by fitting a Gaussian to each peak. I am aware that the tallest peak probably has another peak to its right, and I'm smoothing too much to capture it, but I will fine tune the details later.
Since the cftool's Gaussian fitting is limited to 8 Gaussians, I create a custom fit with the function:
fittingFunc = 'a1*exp(-((x-477.73)/c1)^2)+a2*exp(-((x-489.143)/c2)^2)+a3*exp(-((x-506.111)/c3)^2)+a4*exp(-((x-542.774)/c4)^2)+a5*exp(-((x-556.308)/c5)^2)+a6*exp(-((x-572.872)/c6)^2)+a7*exp(-((x-594.385)/c7)^2)+a8*exp(-((x-603.98)/c8)^2)+a9*exp(-((x-618.726)/c9)^2)'
where I have hard-coded the peak locations. I use the following options:
opts.Lower = zeros(1,numel(pks));
opts.MaxFunEvals = 5000;
opts.MaxIter = 5000;
However, the resulting fit ends up being pretty bad:
Any ideas as to how I can do this robustly? I would like to be able to automate this for many other such signals. I eventually want to integrate over individual peaks.
  댓글 수: 2
David Goodmanson
David Goodmanson 2021년 8월 24일
Hello Irem,
On the first plot, is there something going on per plan so that the x axis and the hard coded peak locations differ by a factor of 10?
Irem Altan
Irem Altan 2021년 8월 24일
Oh it's just because I didn't feed in the x data into findpeaks so it's just plotting the indices for each data point.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Spectral Estimation에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by