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
| #!/usr/bin/env python | |
| from pylab import * | |
| # source: http://www.wolframalpha.com/input/?i=graph+Hatsune+miku+curve | |
| # ignore "RuntimeWarning: invalid value encountered in sqrt" | |
| seterr(all='ignore') | |
| # heaviside function | |
| def theta(x): |
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
| #!/usr/bin/env python | |
| from pylab import * | |
| import skrf as rf | |
| file = sys.argv[1] or 'measured.s1p' | |
| s = rf.Network(file) | |
| s.plot_it_all(show_legend=False) | |
| #subplot(122) | |
| #ax = gca() | |
| #s.plot_s_db(ax=ax, show_legend=False) |
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
| #!/usr/bin/env python | |
| from pylab import * | |
| import skrf as rf | |
| import sys | |
| from optparse import OptionParser | |
| parser = OptionParser(usage="%prog: [options]") | |
| parser.add_option("-v", "--verbose", | |
| action="store_true", dest="verbose", default=False, | |
| help="make lots of messages [default]") |
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
| from pylab import * | |
| import skrf as rf | |
| f = rf.Frequency(0, 2e9, 201, 'hz') | |
| z0 = [50.] | |
| s = rf.Network(frequency=f, s=[-1]*f.npoints, z0=z0, name='short') | |
| o = rf.Network(frequency=f, s=[1]*f.npoints, z0=z0, name='open') | |
| l = rf.Network(frequency=f, s=[0]*f.npoints, z0=z0, name='load') | |
| ns = rf.NetworkSet([s,o,l]) |
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
| #!/usr/bin/env python | |
| ################################################## | |
| # Gnuradio Python Flow Graph | |
| # Title: Vna Probe | |
| # Generated: Sat Jan 12 03:07:08 2013 | |
| ################################################## | |
| from pylibftdi import BitBangDevice | |
| from vna import vna |
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 matplotlib as mpl | |
| from mpl_toolkits.mplot3d import Axes3D | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| f,arg,mag,ref = np.loadtxt('vnaplot.dat', delimiter=' ', unpack=True) | |
| mpl.rcParams['legend.fontsize'] = 10 | |
| fig = plt.figure() |
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
| from pylab import * | |
| f,arg,mag,ref = loadtxt('vnaplot.dat', delimiter=' ', unpack=True) | |
| polar(arg, mag) | |
| polar(arg, ref) | |
| grid(True) | |
| show() |
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
| from pylab import * | |
| f,arg,mag,ref = loadtxt('vnaplot.dat', delimiter=' ', unpack=True) | |
| subplot(2,1,1) | |
| plot(f, mag, label='mag') | |
| plot(f, ref, label='ref') | |
| xlabel('Frequency (Hz)') | |
| ylabel('Amplitude (dB)') | |
| grid(True) |
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
| #!/usr/bin/env python | |
| ################################################## | |
| # Gnuradio Python Flow Graph | |
| # Title: Vna Probe | |
| # Generated: Sat Jan 12 03:07:08 2013 | |
| ################################################## | |
| from pylibftdi import BitBangDevice | |
| from vna import vna |
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
| from pylibftdi import BitBangDevice | |
| from dds import AD9859, BitBangInterface | |
| crystal = 25e6 | |
| mul = 16 | |
| fclk = mul * crystal | |
| pins = { "sdio":4, "sclk":0, "ioupdate":2, "iosync":6, "reset":7 } | |
| conf = { "pins":pins, "fclk":400e6, "refclk_multiplier":16, "vco_range":1 } | |
| freq = 10e6 |