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
% Matlab code to plot a cavity resonance | |
F = 10; % Finesse | |
f = linspace(-0.5, 1.5, 201); | |
P = 1./(1 + (2/pi) * F^2 * sin(pi*f).^2); | |
plot(f, P); | |
xlabel('free spectral ranges'); | |
ylabel('power buildup'); |
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
This Mathematica notebook shows some properties of 1d Hermite Gauss modes: | |
* They are orthonormal | |
* What happens when the 0-mode and a higher-order mode are incident on a split photodiode? | |
* A displaced 0-mode can be written as a sum of higher order modes | |
Tobin Fricke | |
2013-01-25 |
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
# This script prints out a list of the TITLES of all posts on a Tumblr blog | |
# | |
# TF 2013-01-16 | |
import requests | |
import sys | |
if len(sys.argv) != 2: | |
print "Usage: " + sys.argv[0] + " blog_name.tumblr.com" |
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 P = uniqueperms(varargin) | |
% This function allows two possible calling formats: | |
% perms_nodupes(syms) | |
% perms_nodupes(syms,counts) | |
% | |
% Here perms_nodupes returns all permutations of the vector SYMS. | |
% COUNTS is an optional vector indicating how many times each symbol should | |
% be included. The following are equivalent: | |
% |
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
This diagram gives an overview of the Table-Top Frequency Stabilization Servo (TTFSS). | |
Nice overview wiki: | |
https://awiki.ligo-wa.caltech.edu/aLIGO/TTFSS |
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
%% Numerical quantum mechanics (one-dimensional) | |
% This little program solves the eigenstate problem H|Psi> = E|Psi> | |
% numerically for an arbitrary hamiltonian H. Just plug in your potential | |
% V and seconds later take a peek at the eigenstates and eigenvalues. I'm | |
% sure all of this could be done in smarter ways, but I like that all the | |
% machinery is exposed. The only matlab trickery we use is | |
% matrix multiplication. | |
% | |
% Tobin Fricke <tfricke@ligo.caltech.edu> | |
% 2009-02-12 |
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
%% Frequency response of a boxcar filter | |
% | |
% A look at the frequency response of sample-and-hold. | |
% | |
% Tobin Fricke 2012-10-18 | |
Fs = 2^16; % Higher sample rate | |
R = 32; % upsampling factor | |
N = 1 * Fs; % number of sample data to generate |
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
/* It turns out that the environment pointer is passed to main() | |
as the third argument -- I had no idea! The usual way to get | |
the environment is via an "extern char **environ;" declaration. | |
This program prints out the environment in KEY=VALUE format, | |
one variable per line. | |
*/ | |
#include <stdio.h> |
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
0 101 | |
1.52588e-05 100 | |
3.05176e-05 100 | |
4.57764e-05 99 | |
6.10352e-05 99 | |
7.6294004e-05 98 | |
9.15528e-05 96 | |
0.0001068116 95 | |
0.0001220704 127 | |
0.0001373292 92 |
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
all: xor-c xor-cpp xor-cpp-noflush rand | |
test: xor-c xor-cpp xor-cpp-noflush | |
time ./xor-c < rand.txt | |
time ./xor-cpp < rand.txt | |
time ./xor-cpp-noflush < rand.txt | |
rand: rand.c | |
gcc -Wall rand.c -o rand |