forked from nicolassmith/OpticklePDE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOMITmeas.m
137 lines (116 loc) · 3.27 KB
/
OMITmeas.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
% Optickle Simulation of OMIT style measurement
powers = [2 1 .5 .2];
PMtoXTRANS={};
PMtoREFL={};
%% calculate
for P0=powers
% this creates opt and par (setupPDE)
par = paramPDE([],P0);
par = paramPDE_LSC(par);
opt = optPDE(par);
opt = probesPDE(opt,par);
% choose detuning
f_internal = par.IX.w_internal/(2*pi);
fudgeDetune = -0.075;
%fudgeDetune = .6;
pos = zeros(1,opt.Ndrive);
delta = f_internal/opt.c*(opt.lambda*par.Length.Xarm)*(1+fudgeDetune); %detuning in meters
pos(getDriveNum(opt,'EX')) = delta; %detuning of EX
pos(getDriveNum(opt,'EY')) = delta; %detuning of EY
% calculate TFs
zoomPlotWidth = 2;
f = sort([logspace(4,5,100) linspace(f_internal-zoomPlotWidth/2,f_internal+zoomPlotWidth/2,1000)]);
[fDC, sigDC, sigAC] = tickle(opt, pos, f);
% show results
%showfDC(opt,fDC)
nPM = getDriveNum(opt,'PM');
nTransX = getProbeNum(opt,'X_TRANS_DC');
nREFL = getProbeNum(opt,'REFLDC');
PMtoXTRANS = [PMtoXTRANS {-getTF(sigAC,nTransX,nPM)/P0}];
PMtoREFL = [PMtoREFL {-getTF(sigAC,nREFL,nPM)/P0}];
end
%% make plots
figure(1)
set(gcf,'Color','white')
set(gcf,'Position',[0 0 1400 700])
colors = get(gca,'colororder');
legs = cell(length(powers),1);
clf
for jj = 1:length(powers)
subplot(2,2,1)
loglog(f,abs(PMtoXTRANS{jj}),'Color',colors(jj,:))
hold on
xlim([min(f) max(f)])
subplot(2,2,3)
semilogx(f,180/pi*angle(PMtoXTRANS{jj}),'Color',colors(jj,:))
hold on
xlim([min(f) max(f)])
% plot zoom in
f_subset = f<f_internal+zoomPlotWidth/2&f>f_internal-zoomPlotWidth/2;
fzoom = f(f_subset)-f_internal;
subplot(2,2,2)
semilogy(fzoom,abs(PMtoXTRANS{jj}(f_subset)),'Color',colors(jj,:))
hold on
xlim([min(fzoom) max(fzoom)])
subplot(2,2,4)
plot(fzoom,180/pi*angle(PMtoXTRANS{jj}(f_subset)),'Color',colors(jj,:))
hold on
xlim([min(fzoom) max(fzoom)])
legs{jj} = ['Input Power = ' num2str(powers(jj)) 'W'];
end
subplot(2,2,1)
title('EOM drive to X arm transmission, normalized by input power')
ylabel('Transfer function magnitude (1/radians)')
legend(legs,'Location','best')
subplot(2,2,3)
ylabel('Phase (degrees)')
xlabel('Frequency (Hz)')
subplot(2,2,2)
title('Zoom on OMIT dip')
subplot(2,2,4)
xlabel('Frequency (Hz)')
%export_fig('opticleomit.pdf')
%
% figure(2)
% set(gcf,'Color','white')
% set(gcf,'Position',[0 0 1400 700])
% colors = get(gca,'colororder');
% legs = cell(length(powers),1);
% clf
% for jj = 1:length(powers)
% subplot(2,2,1)
% loglog(f,abs(PMtoREFL{jj}),'Color',colors(jj,:))
% hold on
% xlim([min(f) max(f)])
% subplot(2,2,3)
% semilogx(f,180/pi*angle(PMtoREFL{jj}),'Color',colors(jj,:))
% hold on
% xlim([min(f) max(f)])
%
% % plot zoom in
%
% f_subset = f<f_internal+zoomPlotWidth/2&f>f_internal-zoomPlotWidth/2;
% fzoom = f(f_subset)-f_internal;
% subplot(2,2,2)
% semilogy(fzoom,abs(PMtoREFL{jj}(f_subset)),'Color',colors(jj,:))
% hold on
% xlim([min(fzoom) max(fzoom)])
% subplot(2,2,4)
% plot(fzoom,180/pi*angle(PMtoREFL{jj}(f_subset)),'Color',colors(jj,:))
% hold on
% xlim([min(fzoom) max(fzoom)])
% legs{jj} = ['Input Power = ' num2str(powers(jj)) 'W'];
% end
%
%
% subplot(2,2,1)
% title('EOM drive to reflected power, normalized by input power')
% ylabel('Transfer function magnitude (1/radians)')
% legend(legs,'Location','best')
% subplot(2,2,3)
% ylabel('Phase (degrees)')
% xlabel('Frequency (Hz)')
% subplot(2,2,2)
% title('Zoom on OMIT dip')
% subplot(2,2,4)
% xlabel('Frequency (Hz)')