Created
June 28, 2011 22:25
-
-
Save tobin/1052399 to your computer and use it in GitHub Desktop.
Optickle help
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function opt = my_configuration | |
% RF component vector | |
Pin = 100; | |
%vMod = (-1:1)'; | |
fMod = 10e+6; | |
%vFrf = fMod * vMod; | |
% create model - give vector of RF field frequencies | |
opt = Optickle([-fMod,0,fMod]); | |
% add a source - give vector of RF field amplitudes | |
opt = addSource(opt, 'Laser', [0 sqrt(Pin) 0]); | |
% add an AM modulator (for intensity control, and intensity noise) | |
opt = addModulator(opt, 'AM', 1); | |
opt = addLink(opt, 'Laser', 'out', 'AM', 'in', 0); | |
% add output optics | |
opt = addSink(opt, 'output'); | |
opt = addLink(opt, 'AM', 'out', 'output', 'in', 2); | |
% add some probes | |
phi = 0; % phase adjustment | |
opt = addProbeIn(opt, 'output_DC', 'output', 'in', 0, 0); % DC | |
opt = addProbeIn(opt, 'output_I', 'output', 'in', fMod, phi); % I | |
opt = addProbeIn(opt, 'output_Q', 'output', 'in', fMod, phi + 90); % Q | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_demo | |
% create the model | |
opt = my_configuration; | |
% get some drive indexes | |
nAMdrive = getDriveIndex(opt, 'AM'); | |
nOutputDC = getProbeNum(opt,'output_DC'); | |
% compute the DC signals and TFs on resonance | |
f = logspace(-1, 3, 200)'; | |
[fDC, sigDC, sigAC, mMech, noiseAC] = tickle(opt, [], f); | |
% Show the transfer function from AM to watts seen at the probe | |
semilogx(f, db(getTF(sigAC, nOutputDC, nAMdrive))); | |
xlabel('frequency'); | |
ylabel('Watts per AM [dB]'); | |
% Find out how many Watts are coming out at DC: | |
fprintf('Power seen at output_DC: %d Watts\n', sigDC(nOutputDC)); | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment