Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
miceuz
committed
May 7, 2013
1 parent
a381311
commit eab8a08
Showing
30 changed files
with
20,628 additions
and
1,575 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
(module Resistor_Horizontal_RM30mm (layer F.Cu) | ||
(at 0 0) | ||
(descr "Resistor, Axial, RM 30mm,") | ||
(tags "Resistor, Axial, RM 30mm,") | ||
(path /511F812E) | ||
(fp_text reference R5 (at 40.005 3.175) (layer F.SilkS) | ||
(effects (font (size 1.00076 1.00076) (thickness 0.14986))) | ||
) | ||
(fp_text value "8.2k 5W" (at 13.97 8.89) (layer F.SilkS) hide | ||
(effects (font (size 1.50114 1.50114) (thickness 0.20066))) | ||
) | ||
(fp_line (start 3.556 0) (end 1.524 0) (layer F.SilkS) (width 0.381)) | ||
(fp_line (start 36.92398 0) (end 38.44798 0) (layer F.SilkS) (width 0.381)) | ||
(fp_line (start 3.81 -3.5) (end 36.66998 -3.5) (layer F.SilkS) (width 0.381)) | ||
(fp_line (start 36.66998 -3.5) (end 36.66998 3.5) (layer F.SilkS) (width 0.381)) | ||
(fp_line (start 36.66998 3.5) (end 3.81 3.5) (layer F.SilkS) (width 0.381)) | ||
(fp_line (start 3.81 3.5) (end 3.81 -3.5) (layer F.SilkS) (width 0.381)) | ||
(pad 1 thru_hole circle (at 0 0) (size 1.99898 1.99898) (drill 1.00076) | ||
(layers *.Cu *.Mask) | ||
) | ||
(pad 2 thru_hole circle (at 39.99992 0) (size 2.30124 2.30124) (drill 1.19888) | ||
(layers *.Cu *.Mask) | ||
) | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import math | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
import numpy.fft as ff | ||
from pylab import * | ||
import scipy.signal as signal | ||
|
||
def magnitude(x): | ||
ret = [] | ||
for sample in x: | ||
ret.append(math.sqrt(sample.real**2 + sample.imag**2)) | ||
return np.array(ret) | ||
|
||
def differential(x): | ||
ret = [] | ||
for i in range(0, x.shape[0]-1): | ||
if i < x.shape[0]-1: | ||
ret.append(x[i+1] - x[i]) | ||
else: | ||
ret.append(x[i]) | ||
return np.array(ret) | ||
def mfreqz(b,a=1): | ||
w,h = signal.freqz(b,a) | ||
h_dB = 20 * log10 (abs(h)) | ||
subplot(211) | ||
plot(w/max(w),h_dB) | ||
ylim(-150, 5) | ||
ylabel('Magnitude (db)') | ||
xlabel(r'Normalized Frequency (x$\pi$rad/sample)') | ||
title(r'Frequency response') | ||
subplot(212) | ||
h_Phase = unwrap(arctan2(imag(h),real(h))) | ||
plot(w/max(w),h_Phase) | ||
ylabel('Phase (radians)') | ||
xlabel(r'Normalized Frequency (x$\pi$rad/sample)') | ||
title(r'Phase response') | ||
subplots_adjust(hspace=0.5) | ||
|
||
#Plot step and impulse response | ||
def impz(b,a=1): | ||
l = len(b) | ||
impulse = repeat(0.,l); impulse[0] =1. | ||
x = arange(0,l) | ||
response = signal.lfilter(b,a,impulse) | ||
subplot(211) | ||
stem(x, response) | ||
ylabel('Amplitude') | ||
xlabel(r'n (samples)') | ||
title(r'Impulse response') | ||
subplot(212) | ||
step = cumsum(response) | ||
stem(x, step) | ||
ylabel('Amplitude') | ||
xlabel(r'n (samples)') | ||
title(r'Step response') | ||
subplots_adjust(hspace=0.5) | ||
|
||
|
||
y = np.loadtxt("step-response-linear2.csv") | ||
y = hstack((np.ones(100)*23.50, y)) | ||
y = y - min(y) | ||
n = 13 | ||
a = signal.firwin(n, cutoff = 0.037, window = "hamming") | ||
|
||
#plt.plot(range(0, (y.shape[0])), y) | ||
|
||
yfiltered = signal.lfilter(a, 1, y)[n:] | ||
irfiltered = differential(yfiltered) | ||
ir = differential(y)[n:] | ||
|
||
plt.plot(range(0, (ir.shape[0])), ir, c="grey") | ||
plt.plot(range(0, (irfiltered.shape[0])), irfiltered, c="red", linewidth=2) | ||
|
||
irfiltered = np.hstack((np.zeros(1000), irfiltered, np.zeros(1000))) | ||
ir = np.hstack((np.zeros(10000), ir, np.zeros(10000))) | ||
#plt.plot(range(0, (ir.shape[0])/2+1), magnitude(ff.rfft(ir))) | ||
|
||
H = abs(ff.rfft(irfiltered))[0:] | ||
H = H/H.shape[0] | ||
#plt.plot(range(0, H.shape[0]), H) | ||
|
||
|
||
#plt.plot(np.array(range(0, irfiltered.shape[0] / 2 + 1), float) / (irfiltered.shape[0] / 2 + 1) * 0.5, magnitude(ff.rfft(irfiltered))) | ||
|
||
#plt.plot(range(0, (y.shape[0])), y) | ||
#plt.plot(range(0, (y.shape[0]-10)), signal.lfilter(a, 1, y)[10:]) | ||
#plt.plot(range(0, (a.shape[0])/2+1), magnitude(ff.rfft(a))) | ||
#mfreqz(irfiltered) | ||
|
||
plt.show() |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,220 @@ | ||
23.25 | ||
23.25 | ||
23.31 | ||
23.31 | ||
23.31 | ||
23.31 | ||
23.31 | ||
23.31 | ||
23.31 | ||
23.37 | ||
23.37 | ||
23.37 | ||
23.37 | ||
23.37 | ||
23.37 | ||
23.37 | ||
23.37 | ||
23.37 | ||
23.37 | ||
23.37 | ||
23.37 | ||
23.37 | ||
23.44 | ||
23.44 | ||
23.44 | ||
23.44 | ||
23.44 | ||
23.44 | ||
23.44 | ||
23.44 | ||
23.44 | ||
23.44 | ||
23.50 | ||
23.50 | ||
23.62 | ||
23.69 | ||
23.81 | ||
23.87 | ||
24.00 | ||
24.12 | ||
24.25 | ||
24.37 | ||
24.50 | ||
24.62 | ||
24.81 | ||
24.94 | ||
25.12 | ||
25.25 | ||
25.44 | ||
25.56 | ||
25.75 | ||
25.94 | ||
26.12 | ||
26.31 | ||
26.50 | ||
26.62 | ||
26.81 | ||
27.00 | ||
27.19 | ||
27.37 | ||
27.50 | ||
27.69 | ||
27.87 | ||
28.06 | ||
28.19 | ||
28.37 | ||
28.56 | ||
28.75 | ||
28.87 | ||
29.06 | ||
29.19 | ||
29.37 | ||
29.56 | ||
29.69 | ||
29.87 | ||
30.00 | ||
30.19 | ||
30.31 | ||
30.50 | ||
30.69 | ||
30.87 | ||
31.06 | ||
31.25 | ||
31.50 | ||
31.75 | ||
31.94 | ||
32.19 | ||
32.44 | ||
32.69 | ||
32.94 | ||
33.19 | ||
33.44 | ||
33.69 | ||
33.94 | ||
34.19 | ||
34.44 | ||
34.75 | ||
35.00 | ||
35.25 | ||
35.50 | ||
35.75 | ||
36.00 | ||
36.25 | ||
36.50 | ||
36.75 | ||
37.00 | ||
37.19 | ||
37.44 | ||
37.69 | ||
37.94 | ||
38.13 | ||
38.38 | ||
38.63 | ||
38.81 | ||
39.06 | ||
39.25 | ||
39.50 | ||
39.69 | ||
39.88 | ||
40.06 | ||
40.25 | ||
40.44 | ||
40.69 | ||
40.88 | ||
41.00 | ||
41.25 | ||
41.38 | ||
41.56 | ||
41.75 | ||
41.88 | ||
42.06 | ||
42.25 | ||
42.38 | ||
42.56 | ||
42.69 | ||
42.88 | ||
43.00 | ||
43.13 | ||
43.25 | ||
43.38 | ||
43.44 | ||
43.56 | ||
43.69 | ||
43.75 | ||
43.88 | ||
44.00 | ||
44.13 | ||
44.19 | ||
44.31 | ||
44.44 | ||
44.56 | ||
44.63 | ||
44.75 | ||
44.81 | ||
44.94 | ||
45.00 | ||
45.13 | ||
45.25 | ||
45.31 | ||
45.44 | ||
45.50 | ||
45.63 | ||
45.69 | ||
45.75 | ||
45.88 | ||
45.94 | ||
46.06 | ||
46.06 | ||
46.19 | ||
46.25 | ||
46.31 | ||
46.38 | ||
46.50 | ||
46.56 | ||
46.63 | ||
46.69 | ||
46.75 | ||
46.81 | ||
46.88 | ||
46.94 | ||
47.00 | ||
47.06 | ||
47.13 | ||
47.19 | ||
47.25 | ||
47.31 | ||
47.31 | ||
47.38 | ||
47.44 | ||
47.50 | ||
47.56 | ||
47.63 | ||
47.63 | ||
47.69 | ||
47.75 | ||
47.81 | ||
47.81 | ||
47.88 | ||
47.94 | ||
47.94 | ||
48.00 | ||
48.06 | ||
48.06 | ||
48.13 | ||
48.19 | ||
48.19 | ||
48.25 | ||
48.25 | ||
48.31 | ||
48.38 | ||
48.38 | ||
48.44 | ||
48.44 | ||
48.50 | ||
48.50 | ||
48.56 | ||
48.56 | ||
48.63 | ||
48.69 | ||
|
Oops, something went wrong.