Damping a Time Domain Signal to Mimic Signal Decay

General forum for EasySpin: questions, how to's, etc.
Post Reply
arden13
User
Posts: 14
Joined: Thu Jul 24, 2014 3:46 pm

Damping a Time Domain Signal to Mimic Signal Decay

Post by arden13 »

I'm currently simulating some 14N ESEEM data and I was wondering if there is a way to include a damping function in a fitting routine. In my script for simulating by hand, I can apply a damping function like this:

Code: Select all

Damping=1.8 %User-specified variable

%Generate Signal
[simt,simy]=saffron(Sys, Exp, Opt);
simy=abs(simy);

%Subtract Biexponential
[~,~,simfit]=exponfit(simt,simy,2);
simy=simy-simfit;

%Apply Damping function
simy=simy.*exp(-simt(:)/Damping)';
simy=simy/max(simy);
However afterwards when I want to let ESFit simulate fine-tune my handiwork this doesn't happen. It seems to cause problems when it calculates the R^2 value later on in my data when the signal has simply relaxed. I've tried Sys.T1T2 but it seems to have no effect.

Any ideas?
Stefan Stoll
EasySpin Creator
Posts: 1064
Joined: Mon Jul 21, 2014 10:11 pm
Location: University of Washington

Re: Damping a Time Domain Signal to Mimic Signal Decay

Post by Stefan Stoll »

Here's a simple way: Write your own simulation function that wraps saffron:

Code: Select all

function simy = saffrondecay(Sys,Exp,Opt)

% Fill in your code for calculating simy
% 1) saffron simulation
% 2) exponential damping
% use Sys.Damping

Then, call saffron with this custom simulation function saffrondecay and with Sys.Damping as additional fit parameter.
arden13
User
Posts: 14
Joined: Thu Jul 24, 2014 3:46 pm

Re: Damping a Time Domain Signal to Mimic Signal Decay

Post by arden13 »

Thanks, that worked wonderfully!
Post Reply