update 25

This commit is contained in:
Connor Olding 2016-06-02 04:04:43 -07:00
parent 9ea1a3c35e
commit ac604576fb

View file

@ -75,7 +75,7 @@ def c_render3(xs, cascade, mode='magnitude'):
ys = np.zeros(len(xs)) ys = np.zeros(len(xs))
for f in cascade: for f in cascade:
f, ba, gain = f freq, ba, gain = f
b, a = ba b, a = ba
if len(b) == 3 and len(a) == 3: if len(b) == 3 and len(a) == 3:
eq = fmt.format(eq2) eq = fmt.format(eq2)
@ -91,8 +91,8 @@ def c_render3(xs, cascade, mode='magnitude'):
if mode == 'group delay': if mode == 'group delay':
# approximate derivative of phase by slope of tangent line # approximate derivative of phase by slope of tangent line
step = 2**-8 step = 2**-8
fa = f - step fa = freq - step
fb = f + step fb = freq + step
s = xs/fa*j s = xs/fa*j
ya = ne.evaluate(eq) ya = ne.evaluate(eq)
@ -100,9 +100,9 @@ def c_render3(xs, cascade, mode='magnitude'):
yb = ne.evaluate(eq) yb = ne.evaluate(eq)
slope = (yb - ya)/(2*step) slope = (yb - ya)/(2*step)
ys += -slope/(xs/f*tau) ys += -slope/(xs/freq*tau)
else: else:
s = xs/f*j s = xs/freq*j
ys += ne.evaluate(eq) ys += ne.evaluate(eq)
if mode == 'phase': if mode == 'phase':
ys = degrees_clamped(ys) ys = degrees_clamped(ys)