Double integral values in EasySpin vs. Xenon

General forum for EasySpin: questions, how to's, etc.
Post Reply
justindo
Newbie
Posts: 2
Joined: Wed Sep 09, 2020 10:57 am

Double integral values in EasySpin vs. Xenon

Post by justindo »

Hello,

Longtime lurker, first-time poster. I'm having an issue with relative ratios of double integral values between multiple samples as measured by EasySpin versus Xenon or OriginLabs. My assumption is that I am doing something wrong in EasySpin/MatLab, though I cannot discern what that is.

I have recorded CW X-band EPR spectra of validated solutions of TEMPOL, Cu ICP and Mn standards. I have measured the double integral (e.g. integral of the absorption spectrum) using Xenon, EasySpin and OriginLabs. The relative ratio of double integral when measured by EasySpin is different the value from Xenon or OriginLabs by almost a factor of 5! My goal is to spin count using the CuICP as a standard, hence, this difference makes it impossible to use the EasySpin values. I'm wondering if the technique I use to do the double integral in EasySpin/MatLab is the source of these errors. Searching the forum, however, suggests that I am on the right track (see "Area under EPR transition" for 2016 for example - viewtopic.php?f=3&t=307).

My scripts, sample data files and a PDF explaining the issues in more details are attached.

I thank everyone who spends some time looking at this.

Best regards,

Justin
Attachments
forEasySpinForum.zip
(1.28 MiB) Downloaded 202 times
Stefan Stoll
EasySpin Creator
Posts: 1053
Joined: Mon Jul 21, 2014 10:11 pm
Location: University of Washington

Re: Double integral values in EasySpin vs. Xenon

Post by Stefan Stoll »

I haven't looked at your scripts, but here's how to do a double integration. Don't forget to include the field increment.

Code: Select all

clear, clc

Sys.g = 2;
Sys.lw = 1;
Exp.mwFreq = 9.5;
Exp.Range = [337 342];
Exp.nPoints = 1000;
[B,spc] = pepper(Sys,Exp);
plot(B,spc)

dB = mean(diff(B));                   % field increment
spcIntegral = cumsum(spc)*dB;         % integrated spectrum
doubleIntegral = sum(spcIntegral)*dB  % double integral
Make sure to do all the processing, such as baseline correction and smoothing, prior to this.
Matt Krzyaniak
EasySpin Guru
Posts: 153
Joined: Tue Jul 22, 2014 11:01 am
Location: Northwestern University

Re: Double integral values in EasySpin vs. Xenon

Post by Matt Krzyaniak »

I see three potential sources for the differences.

The first, you're using cumsum and sum, you forgot to weight the integral with the field step size (look at Stefan's example). But if you're consistent, field range and number of points always the same, it doesn't really matter.

The second do origin and xenon basline correct line you're doing in matlab?

And lastly cumsum uses the midpoint rule to perform the integral and is generally accurate. But you could improve the accuracy by using cumtrapz and trapz which use the trapezoid rule for the integral. Difference in the integral method between matlab/xenon/origin could explain some divergence.
justindo
Newbie
Posts: 2
Joined: Wed Sep 09, 2020 10:57 am

Re: Double integral values in EasySpin vs. Xenon

Post by justindo »

Hello,

Thanks for the suggestions. The issue was that I did not weight the integral with the field step size, which is important because I did NOT collect the data with consistent field range and number of points. I have included my 'final' script below for posterity.

Best regards,

Justin

Code: Select all


% Template script for determination of Double Integral
% CuICP standard
% JTD 9/9/20
%==============================

clear, clf

%
% update with filename
%

[b,s,param]=eprload('01_14_Cu_optscan_T25K_38dB.DTA');

%plot(b/10,s,'k');

%
% 1st-order baseline correct using basecorr
%

s_bc=basecorr(s,1,1);

%plot(b/10,s_bc,'k');

%
% Integral
%

db=mean(diff(b));
s_bcI=cumsum(s_bc)*db;

%plot(b/10,s_bcI,'k');

%
% Polynomial baseline correction
%   from EasySpin forum Matt Krzyaniak
%

tail = b/10 < 260 | b/10 > 350 & b/10 < 400;
[p,Es,mu]=polyfit(b(tail)/10,s_bcI(tail),4);
baseline=polyval(p,b/10,Es,mu);

s_bcIbc=s_bcI-baseline;

%plot(b/10,s_bcIbc,'k',b/10,s_bcI,'b',b/10,baseline,'r');

%
% Integral of absorptive spectrum (aka double integral)
%

DI=sum(s_bcIbc)*db;

%
% check by taking numerical derivative of baseline corrected
%   absorptive spectrum
%

s_bcIbc_deriv=diff(s_bcIbc)/db;
b_deriv=b(1:length(s_bcIbc_deriv));

plot(b/10,s_bc,'k',b_deriv/10,s_bcIbc_deriv,'r');
Stefan Stoll
EasySpin Creator
Posts: 1053
Joined: Mon Jul 21, 2014 10:11 pm
Location: University of Washington

Re: Double integral values in EasySpin vs. Xenon

Post by Stefan Stoll »

Great!

Post Reply