I have been playing around with convolutions in scipy's signal package:
N = 2**16 t = np.linspace(-4, 4, N) h = rect(t, -1, 1) scipy_conv = signal.fftconvolve(h, h, mode = 'same') scipy_conv = scipy_conv/max(scipy_conv) ax1.plot(t, h, label = r'$h(t)$') ax1.plot(t, scipy_conv, label = r'$(h*g)(t)$ (SciPy)', linestyle = '--') ax1.set_xlabel(r'$t$') ax1.grid() ax1.legend()
My question is, how should I go about correctly normalising the convolution so that its amplitude would match that of the analytic result of the convolution of the rectangle with itself?
I'm aware this is somehow artefact of the fact we are using DFTs and not continuous FFTs, and that the answer is likely very simple, I am just rather confused. Any help or pointers to an answer I have missed is much appreciated. Thanks in advance.