Added functions to compute input patterns with spatial correlation