function costf = f_TS(x0, spectra, psiT, psiS, wavel);


    costf = sum((spectra - psiT.*x0(1) - psiS.*x0(2)-x0(3)).^2);

return