StollLab / EasySpin

MATLAB toolbox for Electron Paramagnetic Resonance (EPR) spectroscopy
http://easyspin.org
MIT License
48 stars 26 forks source link

Exp.mwPhase ignored for pure-Lorentzian broadening and isotropic g #284

Closed stestoll closed 1 year ago

stestoll commented 1 year ago
clear, clc

Sys.lwpp = [0 3];

Exp.Harmonic = 1;
Exp.mwFreq = 9.525;
Exp.Range = [300 380];

Exp.mwPhase = 0;
[B,spc_abs] = pepper(Sys,Exp);
Exp.mwPhase = pi/2;
[B,spc_disp] = pepper(Sys,Exp);

plot(B,spc_abs,B,spc_disp);

See also #202.

stestoll commented 1 year ago

More comprehensive test:

clear, clc

Sys.lwpp = [0 3];

Exp.mwFreq = 9.525;
Exp.Range = [300 380];

simfcn = {@pepper,@garlic};
simfcnname = {'pepper','garlic'};
harmonic = [0 1 2];

idx = 0;
for k = 1:2
  for h = 1:3
    Exp.Harmonic = harmonic(h);
    fun = simfcn{k};

    Exp.mwPhase = 0;
    [B,spc_abs] = fun(Sys,Exp);
    Exp.mwPhase = pi/2;
    [B,spc_disp] = fun(Sys,Exp);

    idx = idx+1;
    subplot(2,3,idx)
    plot(B,spc_abs,B,spc_disp);
    title(sprintf('%s, harmonic %d',simfcnname{k},harmonic(h)));
  end
end