f(x)=exp(x/x0)*(a*cos(2*pi*x*f)+b*sin(2*pi*x*f)) a=.4 b=.3 f=1.5 x0=20 fit [-40:-5] f(x) 'raw_data_files/C2optspect20110120-100001.txt' every ::6 using ($1*1E9-5500):2 '%lf,%lf' via a,b,x0,f set samples 2000 plot [-80:20] [:] 'raw_data_files/C2optspect20110120-100001.txt' every ::6 using ($1*1E9-5500):2 '%lf,%lf' w l, f(x) # result: Final set of parameters Asymptotic Standard Error ======================= ========================== a = 0.138361 +/- 0.003389 (2.45%) b = -0.460588 +/- 0.003238 (0.7031%) x0 = 17.4024 +/- 0.1403 (0.8061%) f = 1.50056 +/- 7.423e-05 (0.004947%) correlation matrix of the fit parameters: a b x0 f a 1.000 b -0.041 1.000 x0 -0.376 0.805 1.000 f -0.847 -0.192 0.163 1.000