Experimental resonator compensation
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')