Experimental resonator compensation

General forum for EasySpin: questions, how to's, etc.
Post Reply
renstewart
Newbie
Posts: 1
Joined: Sun Feb 16, 2025 2:45 am

Experimental resonator compensation

Post by renstewart »

Hi - attempting to use experimental data to compensate for the resonator. To test I entered large values so as to assume no resonator effects, however my pulses/excitation profiles are not identical. Any ideas why?

clear Par

% Pulse Parameters
Par.Type = 'WURST/uniformQ'; % pulse shape
Par.tp = 0.100; % pulse length, µs
Par.Frequency = [80 200]; % pulse frequency sweep range, MHz
Par.nwurst = 6; % truncation parameter, used as (beta/tp)
Par.Flip = pi; % pulse flip angle
Par.TimeStep = 250e-6; % discrete time step, µs
Par.mwFreq = 33.84;
[tideal,IQideal] = pulse(Par);

% Resonator bandwidth compensatio

freq = [33.750 33.800 33.850 33.900 33.95 34.000 34.050 34.100];
%power = [0.012 0.015 0.022 0.027 0.032 0.03 0.014 0.012];
power = [10 10 10 10 10 10 10 10];
xq = 33.75:0.0001:34.1;
H = interp1(freq,power,xq,'spline');

plot(freq,power,'o',xq,H,':.');
Par.mwFreq = 33.84; % GHz
Par.FrequencyResponse = [xq; H];

[t,IQ] = pulse(Par);

% Compare results
plot(tideal,real(IQideal),t,real(IQ))
legend('ideal','res')
plot(tideal,imag(IQideal),t,imag(IQ))
legend('ideal','res')

[offsets,M] = exciteprofile(t,IQ);
[offsetsI, MI] = exciteprofile(tideal, IQideal);
plot(offsets,M(3,:),offsetsI,MI(3,:));
legend('res','ideal')

The code below works so I believe it is something to do with using interpolated data as the transfer function.

Par.Type = 'WURST/uniformQ'; % pulse shape

% Par.Type = 'sech/tanh'; % pulse shape

% Par.beta = 10; % truncation parameter, used as (beta/tp)

Par.tp = 0.100; % pulse length, µs

Par.Frequency = [80 200]; % pulse frequency sweep range, MHz

Par.nwurst = 6; %

Par.Flip = pi; % pulse flip angle

Par.TimeStep = 250e-6; % discrete time step, µs

Par.mwFreq = 33.84;

%Before Frequency Response

[tideal,IQideal] = pulse(Par);

%with Frequency Response

f = 33.5:0.001:34.5;

H = ones(1, 1001);

Par.FrequencyResponse = [f; H];

[t,IQ] = pulse(Par);

%Plots

figure(1)

plot(t,real(IQ),'*',tideal,real(IQideal))

legend('res','ideal')

figure(2)

[offsets,M] = exciteprofile(t,IQ);

[offsetsI, MI] = exciteprofile(tideal, IQideal);

plot(offsets,M(3,:),offsetsI,MI(3,:));

legend('res','ideal')

tec000
Newbie
Posts: 3
Joined: Fri May 03, 2024 9:38 am

Re: Experimental resonator compensation

Post by tec000 »

This is due to a bug in pulse for bandwidth compensation in the case of uniformQ pulses. Thank you for reporting this, it will be fixed in the next release.

(I suspect the second part of your code seems to work because you still have Par.FrequencyResponse in the workspace from the first part of the code, otherwise you would run into the same issue.)

Post Reply