In[]:=
ClearAll["`*"];

experimental data :

expo decay data:-

In[]:=
(*--------Importexperimentaldata--------------*)
In[]:=
rawExpData1=Import["D:\\RAJESH CHELL\\Data for TF Rajesh\\Gain100\\detectorNLPQT\\R23 CO line 5 Torr Gain 100 NLPQT\\CO_R23_5Torr_detektorNLPQT_gain100_tfit0us_ringdowns_01.csv","Data"][[17]];
ringdowny1=rawExpData1[[3;;]];(*1sttw0areheading,*)​​​​dt=0.04;​​t=Table[n*dt,{n,0,Length[ringdowny1]-1}];​​tlast=t[[-1]];​​fs=1/dt;
In[]:=
nSamples=Length[t]
Out[]=
5120
In[]:=
Length[t]
Out[]=
5120
In[]:=
rawExpData=Transpose[{t,ringdowny1}]
Out[]=
{{0.,0.160894},{0.04,0.165265},{0.08,0.162779},{0.12,0.16165},{0.16,0.163782},{0.2,0.162271},{0.24,0.164035},{0.28,0.162416},{0.32,0.163116},{0.36,0.163268},{0.4,0.162136},{0.44,0.161675},{0.48,0.160349},
⋯5095⋯
,{204.32,0.006998},{204.36,0.007113},{204.4,0.007074},{204.44,0.006921},{204.48,0.007044},{204.52,0.007332},{204.56,0.006992},{204.6,0.006947},{204.64,0.006796},{204.68,0.007086},{204.72,0.006977},{204.76,0.006864}}
Full expression not available
(
original memory size:
82.1 kB)
y1=ListPlot[Transpose[{t,ringdowny1}],PlotRange->All,Joined->True,Mesh->Full]
Out[]=

transfer function:-

In[]:=
tdata=Import["D:\\RAJESH CHELL\\Data for TF Rajesh\\Gain100\\detectorNLPQT\\Pomiar nieliniowosci pasma detektora NLPQT_gain100_01.csv","Data"];​​freq=tdata[[2;;]][[All,2]];​​​​normTF=tdata[[2;;]][[All,8]];
In[]:=
magData=Delete[Delete[Transpose[{freq,normTF}],20],26];
In[]:=
t1=ListLogLogPlot[magData,PlotRange->All,Joined->True,Mesh->All,PlotStyle->Black]
Out[]=

exponential fitting :

fitting of whole Data:-

In[]:=
fit1=NonlinearModelFit[rawExpData,a1*Exp[-time/tau1]+con1,{{a1,0.15},{tau1,32},{con1,0.003}},time,WorkingPrecision->16]
NonlinearModelFit
:The precision of the data and model function (​MachinePrecision​) is less than the specified WorkingPrecision (​16​).
Out[]=
FittedModel
0.006901500080689965+44
-44time


In[]:=
fit1["ParameterTable"]
FittedModel
:The precision of the argument function (​MachinePrecision​) is less than WorkingPrecision (​16​).
Out[]=
Estimate
Standard Error
t-Statistic
P-Value
a1
0.1713690460156431
0.00012002125207318
1427.8225152255
2.04387845007×
-6658
10
tau1
5.117045800481729
0.005227429980277
978.8836617207
1.19041498994×
-5822
10
con1
0.006901500080689965
0.000010076818835140
684.8887723001
4.3891856010×
-5035
10
In[]:=
residual1=Transpose[{rawExpData[[All,1]],fit1["FitResiduals"]}];​​ListPlot[residual1,PlotRange->All,PlotStyle->Red,Frame->True,GridLines->Automatic,Joined->True]
FittedModel
:The precision of the argument function (​MachinePrecision​) is less than WorkingPrecision (​16​).
Out[]=

fitting of selected Data:-

In[]:=
tStrt=4;​​tEnd=200;
In[]:=
selectedData=Select[rawExpData,tStrt<=#[[1]]<=tEnd&];
In[]:=
ListPlot[selectedData,PlotRange->All,Joined->True,Frame->True,GridLines->Automatic]
Out[]=
In[]:=
fit2=NonlinearModelFit[selectedData,a1*Exp[-time/tau1]+con1,{{a1,0.1},{tau1,32},{con1,0.02}},time,WorkingPrecision->15,Method->"LevenbergMarquardt"]
NonlinearModelFit
:The precision of the data and model function (​MachinePrecision​) is less than the specified WorkingPrecision (​15​).
Out[]=
FittedModel
0.00697433716427901+44
-44time


In[]:=
fit2["ParameterTable"]
FittedModel
:The precision of the argument function (​MachinePrecision​) is less than WorkingPrecision (​15​).
Out[]=
Estimate
Standard Error
t-Statistic
P-Value
a1
0.191405924041317
0.0001471041131530
1301.159566097
7.077356594×
-6223
10
tau1
4.69815288929730
0.002555100213660
1838.735273153
5.733616069×
-6957
10
con1
0.00697433716427901
2.502830446931×
-6
10
2786.579959034
1.9147496155×
-7840
10
In[]:=
fittedParamValue2=Values[fit2["BestFitParameters"]];​​fittedParams2=Keys[fit2["BestFitParameters"]];​​std2=fit2["ParameterErrors"];
FittedModel
:The precision of the argument function (​MachinePrecision​) is less than WorkingPrecision (​15​).
FittedModel
:The precision of the argument function (​MachinePrecision​) is less than WorkingPrecision (​15​).
FittedModel
:The precision of the argument function (​MachinePrecision​) is less than WorkingPrecision (​15​).
In[]:=
fittedData2=Table[{selectedData[[k,1]],fit2[selectedData[[k,1]]]},{k,1,Length[selectedData]}];
In[]:=
ListPlot[{selectedData(*wholeData*),fittedData2},Frame->True,GridLines->Automatic,Joined->{False,False},PlotRange->All,PlotStyle->{Red,Green},PlotLegends->{"selectedData","fittedData"}]
Out[]=
selectedData
fittedData

fitting using convolution:

define convolution :-

parameter list:-

check with initial value:-

Fit:-

parameter Table

Residual plot

transfer function after convolution:-