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


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

return