This file contains hidden or 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
import numpy as np | |
from numpy.random import random | |
from scipy import interpolate | |
import matplotlib.pyplot as plt | |
import cProfile | |
def f(x): | |
# does not need to be normalized | |
return np.exp(-x**2) * np.cos(3*x)**2 * (x-1)**4/np.cosh(1*x) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
# Monitor and plot | |
from __future__ import division, print_function | |
import numpy as np | |
from numpy import sin, cos, random | |
from scipy.constants import c,e,h,hbar,u,pi | |
import matplotlib.pyplot as plt | |
import matplotlib.animation as animation | |
import time |
This file contains hidden or 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
# Least squares fitting | |
# IEEE algorithm version for known frequency | |
from __future__ import division | |
import numpy as np | |
from numpy import pi | |
from numpy import fft | |
from numpy import linalg as lg | |
import pylab as plt | |
import matplotlib.gridspec as gridspec |
This file contains hidden or 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
// Arduino Due simple synthesizer | |
// arbitrary waveforms on DAC0 | |
// using Timer library to run off internal clock | |
#include <DueTimer.h> | |
int led = 13; | |
int sensorPin = A0; | |
int triggerPin = 4; | |
int outputValue = 0; |
This file contains hidden or 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
# Transmission line characteristic impedance | |
# Amar, 12 July 2012 | |
# version 3 | |
# All lengths in cm, E-fields in V/cm, time in ns | |
import pylab as plt | |
import numpy as np | |
from numpy import pi | |
from scipy.weave import blitz | |
import cPickle, time |
This file contains hidden or 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
# Display webcam image from beamline monitor | |
# version 3, 2014-04-25 | |
# Amar | |
import numpy as np | |
import cv2 | |
import matplotlib.animation as animation | |
import matplotlib.pyplot as plt | |
import matplotlib.cm as cm |
This file contains hidden or 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
# Animation of harmonic oscillator, with Verlet integration | |
from __future__ import division | |
import numpy as np | |
from numpy import sin, cos | |
from scipy.constants import c,e,h,hbar,u,pi | |
import matplotlib.animation as animation | |
delta = 1e-2 # spatial discretization | |
x = np.arange(-2,2,delta) |
This file contains hidden or 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
# Fourier reconstruction of random ellipse | |
# Amar Vutha | |
# 2014-04-03 | |
import pylab as plt | |
import numpy as np | |
from numpy import pi | |
import matplotlib.pyplot as plt | |
import matplotlib.animation as animation |
This file contains hidden or 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
# Get waveforms from Rigol scope and do spectrum analysis, fast version | |
# Amar Vutha | |
# version 1, 2013-12-30 | |
from __future__ import division | |
import pylab as plt | |
import numpy as np | |
from scipy import signal | |
from scipy.constants import e | |
import os |
NewerOlder