From f43a71745fb077105839c3d31c3e97f26dfaf520 Mon Sep 17 00:00:00 2001 From: Eric Teunis de Boone Date: Thu, 20 Feb 2020 14:02:28 +0100 Subject: [PATCH] Incorporated comments on Week2 --- week2/ex1.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/week2/ex1.py b/week2/ex1.py index dd046a4..c1efdbb 100755 --- a/week2/ex1.py +++ b/week2/ex1.py @@ -16,8 +16,7 @@ def DFT(yk): N = np.size(yk) xk = 2*np.pi/N*np.arange(N) -# beta = np.zeros(N, dtype=np.complex128) - beta = np.zeros(N, dtype=np.float64) + beta = np.zeros(N, dtype=np.complex128) for j in range(N): beta[j] = np.dot(yk, np.exp(- 1j * j * xk )) @@ -46,7 +45,7 @@ def FFT(yk): # Plotting functions -def plot_DFTs(N = 128, fft1 = DFT, fft2 = np.fft.fft, funcs=[func1,func2]): +def plot_DFTs(N = 128, fft1 = DFT, fft2 = np.fft.fft, datafuncs=[func1,func2]): from matplotlib import pyplot j = np.arange(N) @@ -101,6 +100,7 @@ def plot_FT_func_timing(func = DFT, M_max = 4, repeat = 10, number = 5, show = T if __name__ == "__main__": + plot_DFTs() plot_DFTs(fft1=DFT,fft2=FFT) plot_FT_func_timing(M_max = 9, func=FFT, show = False) # 12 takes 10 seconds, 13 takes 50 seconds