-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaserDiode.m
More file actions
48 lines (45 loc) · 1.43 KB
/
laserDiode.m
File metadata and controls
48 lines (45 loc) · 1.43 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
classdef laserDiode < led
%% normal properties
properties
resonatorLenght
refractiveIndex
gain
m
end
%% dependent properties
properties (Dependent)
modePeaks
modeDist
end
%% for dependent props
methods
% peak wavelenghts for each modes
function mPeaks = get.modePeaks( obj )
mPeaks = 2 * obj.resonatorLenght * obj.refractiveIndex ./ obj.m * 1000;
end
% distance between modes
function mDist = get.modeDist ( obj )
mDist = obj.peak^2 / ( 2 * obj.resonatorLenght * obj.refractiveIndex );
end
end
%% functions
methods (Static)
% constructor
function obj = laserDiode(lightSim, name, mode,...
peakGain, fwhmGain, ampGain,...
resonatorLenght, refractiveIndex)
obj = obj@led(lightSim ,name, mode,peakGain, fwhmGain, ampGain);
obj.resonatorLenght = resonatorLenght;
obj.refractiveIndex = refractiveIndex;
obj.gain = obj.int;
obj.int = 0;
% create different modes
for i = 1:1:size(obj.modePeaks,2)
[~ , b] = gauss_distribution2(1, obj.modePeaks(1,i), 0.5, obj.minWave, obj.maxWave, obj.steps);
b = b .* obj.gain;
obj.int = obj.int + b;
end
end
% create default laserdiode
end
end