MATLAB Answers

Deconvolution of Guassian curve

52 views (last 30 days)
Pouyan Msgn
Pouyan Msgn on 5 May 2020
Commented: Alex Sha about 1 hour ago
I have a curve here which I have to deconvolve it into many other curves with different peaks. The resault is this in another program:
That is I have to deconvolve one curve in 4 curves in Matlab! I want to do the same thing in Matlab but I failed!
clear all
D398=flipud(D398); %its a spectrum from higher values to smaller!
X1=D398(:,1); Y1=D398(:,2);
hold on
set(gca, 'XDir','reverse')
grid on
But it is not correct! Is that possible to do this in Matlab ?


Sign in to comment.

Answers (1)

Alex Sha
Alex Sha on 5 May 2020
Hi, you may try 4 Gauss Function:
The results will be:
Root of Mean Square Error (RMSE): 451.21462729511
Sum of Squared Residual: 49066308.2123007
Correlation Coef. (R): 0.999771552934335
R-Square: 0.999543158056732
Adjusted R-Square: 0.999539319048805
Determination Coef. (DC): 0.999543158056733
Parameter Best Estimate
---------- -------------
y0 6181.08011049796
a1 -3146.47497260807
w1 1.88004200222529
xc1 528.043585459549
a2 67855.6616645231
w2 1.23677625792812
xc2 533.256290476665
a3 89669.8140293669
w3 1.73388329145185
xc3 531.944238118754
a4 -58214.4714395774
w4 -1.73177439354019
xc4 534.823600475954


Show 1 older comment
Alex Sha
Alex Sha on 6 May 2020
Combination of 4 Gauss function looks like:
y = y0+(a1/(w1*sqrt(pi/2)))*exp(-2*((x-xc1)/w1)^2)+(a2/(w2*sqrt(pi/2)))*exp(-2*((x-xc2)/w2)^2)+(a3/(w3*sqrt(pi/2)))*exp(-2*((x-xc3)/w3)^2)+(a4/(w4*sqrt(pi/2)))*exp(-2*((x-xc4)/w4)^2)
In Matlab, you can use lsqcurvefit, the problem is it is not easy to guess/provide proper initial start value for each parameter.
Khanh Dang
Khanh Dang about 7 hours ago
Hi Alex Sha,
I also catch the same problem but I can not fit Gaussian well. Your answer is great but you can share more clear MATLAB code here for me applying to my problem. I actually confuse, please you help me.
Alex Sha
Alex Sha 14 minutes ago
Hi, Dang, the result given above is obtained by a software package other than Matlab, with the great ability of global optimization. The curve fitting functions in Matlan use normally local optimization algorithms, so you should usually gauss and provide proper initial start values for each parameters, unfortunately, it is a really hard and difficulty job for most of peoples.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!