-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnormalise_spectrum_all.m
41 lines (33 loc) · 1.29 KB
/
normalise_spectrum_all.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
function [dset] = normalise_spectrum_all(dset)
%NORMALISE_SPECTRUM_ALL normalises an EPR spectrum for all acquisition conditions
%
% ESR data is normalised for receiver gain, number of scans (Ns = 1),
% time constant (Tc = 1 ms). Additionally, we also normalise for Q-factor,
% (Q = 10,000), modulation amplitude (ModAmp = 1 Gauss) and microwave
% power (Pmw = 2 mW) so that we can compare spectra recorded under
% different conditions.
%
% Note: All of the additional parameters can influence both the signal
% amplitude and shape. Use the results with caution.
%
% INPUT:
% dset - dataset from BrukerRead
%
% OUTPUT:
% dset - normalised dset
% $Author: Sam Schott, University of Cambridge <[email protected]>$
import esr_analyses.*
import esr_analyses.utils.*
%% Normalise for default parameters first
[dset] = normalise_spectrum(dset);
%% Normalise for other parameters next
pars = dset.Properties.UserData;
QValue_norm = 10000;
B0MA_norm = 1e-4; % 1 Gauss
MWPW_norm = 2e-3; % 2 mW
if is_powersat_exp(pars) % don't normalise for MWPW in power saturation measurement
dset{:, 2:end} = dset{:, 2:end} * QValue_norm/pars.QValue * B0MA_norm/pars.B0MA;
else
dset{:, 2:end} = dset{:, 2:end} * QValue_norm/pars.QValue * B0MA_norm/pars.B0MA * sqrt(MWPW_norm)/sqrt(pars.MWPW);
end
end