% Matlab file
% @author: Guillaume Laurent
% Deconvolution of data.
%
% Needs Matlab file exchange 52321.
% Needs Optimization Toolbox & Statistics and Machine Learning Toolbox.

clear
path('Deconvolution', path);        % import library
load('Data_SL5.mat')

%% data
X = SPC_axis;
Y = reshape(real(SPC_noisy(1,3,9,9,1,:)), [], 1);

% automatic fit
[parameters, lb, ub, conf, graphdata, resnorm, residual, r2] =...
    DC([X Y], 'range', 'all', 'np' , 1 , 'bg1' , 'IG' , 'auto' , 'mode' , 1 );
