This is an issue with the binning of the datapoints when you are under-sampling to this extent.
Resfields calculates the resonant field position, that in-turn gets interpolated to fit your desired field range and number of points.
Try setting your linewidth to zero and the harmonic to zero. What ends up happening is that based on your field range and the number of points in the range, you end up capturing only the edge of the real resonance, and when things are convoluted you end up with a shifted crossing point.
Try:
Code: Select all
clear
Sys.S=0.5;
Sys.g=2.0023;
Sys.lwpp=0;
Exp.Harmonic = 0;
Exp.mwFreq=9.4;
Exp.Range=[330 340];
Exp.nPoints=500;
[Field500,Spec500]=pepper(Sys,Exp);
Exp.nPoints=100;
[Field100,Spec100]=pepper(Sys,Exp);
Exp.nPoints=50;
[Field50,Spec50]=pepper(Sys,Exp);
plot(Field500,Spec500,Field100,Spec100,Field50,Spec50)
legend('500 points','100 points','50 points')
xlim([334,337])
xlabel('Magnetic field / mT')
ylabel('Intensity / arb.u.')
You would find that if you look at 5000 points or even more, the resonance shifts even from 500pt simulation
If you are trying to simulate something with such sparse point density and you want to avoid this, I would suggest that perhaps you run the initial simulation with a large number of points, then down interpolate to match your experimental range/points.