%% Federico Lombardi
%% 18/07/2019
%% Simulations of DFB1 in dtoluene RT

clear
%% Import data from files
filename = '005_DFB1_RT_Dtol_2mM_basel';
[B,spc,params] = eprload(filename);
spc = real(spc);
spc = spc/max(spc);

%% Scale frequency according to g factor correction and to the solid sample
B = B/2.0022*2.000525;
freq_solid = 9.407688;


%% Define system
Exp.mwFreq = 9.401588;                      
Exp.Range = [332.7 (332.7 + 5.995)];                  
Exp.nPoints = 1200;

DFB1.S = 1;
DFB1.g = 2.0025;
DFB1.lw = 0.57;
[Field, Spec] = pepper(DFB1,Exp);
Spec = Spec/max(Spec);
Field = Field';
Spec = Spec';
B = B*freq_solid/Exp.mwFreq;
Field = Field*freq_solid/Exp.mwFreq;
%% Plot
figure
plot(B,spc,Field*10,(Spec))