forked from nicolassmith/optickle-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexampleMICH.m
More file actions
59 lines (41 loc) · 1.48 KB
/
exampleMICH.m
File metadata and controls
59 lines (41 loc) · 1.48 KB
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
%% Michelson example
% This example builds a simple Michelson interferometer and then uses
% sweepLinear to show the Michelson fringes as one of the optics is swept
% through a few wavelengths' displacement.
% create a model
vFrf = 0;
opt = Optickle(vFrf);
% laser power
Pin = 10;
opt = addSource(opt, 'laser', sqrt(Pin));
opt = addBeamSplitter(opt, 'BS', 45, 0, 0.5);
opt = addMirror(opt, 'EX', 0, 0);
opt = addMirror(opt, 'EY', 0, 0);
opt = addSink(opt, 'AS');
opt = addSink(opt, 'REFL');
Lx = 1.0;
Ly = 5.0;
% Add links
opt = addLink(opt, 'laser', 'out', 'BS', 'frA', 1.0);
opt = addLink(opt, 'BS', 'frA', 'EY', 'fr', Ly);
opt = addLink(opt, 'EY', 'fr', 'BS', 'frB', Ly);
opt = addLink(opt, 'BS', 'frB', 'REFL', 'in', 0);
opt = addLink(opt, 'BS', 'bkA', 'EX', 'fr', Lx);
opt = addLink(opt, 'EX', 'fr', 'BS', 'bkB', Lx);
opt = addLink(opt, 'BS', 'bkB', 'AS', 'in', 0);
opt = addProbeIn(opt, 'REFL_DC', 'REFL', 'in', 0, 0);
opt = addProbeIn(opt, 'AS_DC', 'AS', 'in', 0, 0);
%% sweepLinear
pos = zeros(opt.Ndrive, 1);
nEXdrive = getDriveNum(opt, 'EX');
pos(nEXdrive) = opt.lambda/2;
Npos = 101;
[pos, sigDC] = sweepLinear(opt, pos, -pos, Npos);
nREFLprobe = getProbeNum(opt, 'REFL_DC');
nASprobe = getProbeNum(opt, 'AS_DC');
plot(pos(nEXdrive,:)/opt.lambda, sigDC(nASprobe, :), ...
pos(nEXdrive,:)/opt.lambda, sigDC(nREFLprobe, :));
legend('AS DC', 'REFL DC');
xlabel('EX mirror displacement (wavelengths)');
ylabel('Power [Watts]');
title('Michelson fringes');