Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -49,6 +49,7 @@ def fourier_transform_drawing(input_image, frames, coefficients, img_size):
|
|
49 |
|
50 |
t_list = np.linspace(0, tau, len(xs))
|
51 |
|
|
|
52 |
def f(t, t_list, xs, ys):
|
53 |
return np.interp(t, t_list, xs + 1j * ys)
|
54 |
|
@@ -77,7 +78,7 @@ def fourier_transform_drawing(input_image, frames, coefficients, img_size):
|
|
77 |
# return coef
|
78 |
|
79 |
N = coefficients
|
80 |
-
coefs = [(compute_cn(f, 0), 0)] + [(compute_cn(f, j), j) for i in range(1, N+1) for j in (i, -i)]
|
81 |
|
82 |
# animate the drawings
|
83 |
fig, ax = plt.subplots()
|
|
|
49 |
|
50 |
t_list = np.linspace(0, tau, len(xs))
|
51 |
|
52 |
+
# compute the Fourier coefficients
|
53 |
def f(t, t_list, xs, ys):
|
54 |
return np.interp(t, t_list, xs + 1j * ys)
|
55 |
|
|
|
78 |
# return coef
|
79 |
|
80 |
N = coefficients
|
81 |
+
coefs = [(compute_cn(f, 0, t_list, xs, ys), 0)] + [(compute_cn(f, j, t_list, xs, ys), j) for i in range(1, N+1) for j in (i, -i)]
|
82 |
|
83 |
# animate the drawings
|
84 |
fig, ax = plt.subplots()
|