import numpy as np from matplotlib.pylab import * t, n1, n2, n3 = np.load('simulation.npy') def gauss(x, mu=0.0, sigma=1.0): return 1.0/(sigma*np.sqrt(2.0*np.pi)) * np.exp(-0.5 * ((x-mu)/sigma)**2) def fold(A, B): N = max(len(A), len(B)) Ahat = np.fft.rfft(A,N) Bhat = np.fft.rfft(B,N) prod = ((-1.0)**arange(len(Ahat))) / N * Ahat * Bhat folded = np.fft.irfft(prod, N) return folded N = len(t) T = t[-1]-t[0] g1 = gauss(t-T/2, sigma=100.0) s1 = fold(n2, g1) * T s1[:10] = np.NaN s1[-10:] = np.NaN g2 = gauss(t-T/2, sigma=1000.0) s2 = fold(n2, g2) * T s2[:100] = np.NaN s2[-100:] = np.NaN g3 = gauss(t-T/2, sigma=10000.0) s3 = fold(n2, g3) * T s3[:1000] = np.NaN s3[-1000:] = np.NaN figure() plot(t, n2, '.') plot(t, s1, linewidth=2) plot(t, s2, linewidth=2) plot(t, s3, linewidth=2) show()