In [34]:
# Compute gaussian
from scipy import signal
M = 16
g = signal.gaussian(M, M/3., sym=True)
plt.plot(g); plt.show()
G = np.dot(g.reshape(-1,1), g.reshape(1,-1))
G[M/2:,:M/2] = -G[M/2:,:M/2]
G[:M/2,M/2:] = -G[:M/2,M/2:]
plt.imshow(G, interpolation="nearest"); plt.show()
In [ ]: