From 46e594d5e72109beb839aefe8e41129c8df7d427 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Thu, 10 Jan 2019 04:04:20 -0800 Subject: [PATCH] update 50 --- lib/mag.py | 7 +++---- lib/sweeps.py | 4 +--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/mag.py b/lib/mag.py index 091183f..8a9850a 100644 --- a/lib/mag.py +++ b/lib/mag.py @@ -55,7 +55,6 @@ def c_render2(xs, cascade, phase=False): def c_render3(xs, cascade, mode='magnitude'): """c_render optimized and specifically for first/second-order filters""" import numexpr as ne - j = np.complex(0, 1) # obviously this could be extended to higher orders eq2 = '(b0 + b1*s + b2*s**2)/(a0 + a1*s + a2*s**2)' @@ -91,15 +90,15 @@ def c_render3(xs, cascade, mode='magnitude'): fa = freq - step fb = freq + step - s = xs/fa*j + s = xs/fa*1j ya = ne.evaluate(eq) - s = xs/fb*j + s = xs/fb*1j yb = ne.evaluate(eq) slope = (yb - ya)/(2*step) ys += -slope/(xs/freq*tau) else: - s = xs/freq*j + s = xs/freq*1j ys += ne.evaluate(eq) if mode == 'phase': ys = degrees_clamped(ys) diff --git a/lib/sweeps.py b/lib/sweeps.py index 0fdbbff..7a58dc4 100644 --- a/lib/sweeps.py +++ b/lib/sweeps.py @@ -44,9 +44,7 @@ def tsp(N, m=0.5): # this has been tweaked to prevent overflow: s = np.square(np.arange(NN2 + 1) / NN) - j = np.complex(0, 1) - - H = np.exp(j * 4 * M * np.pi * s) + H = np.exp(4j * M * np.pi * s) H2 = np.r_[H, np.conj(H[1:NN2][::-1])] x = np.fft.ifft(H2)