Fix a bug in convolution. Also add a resample function to resample the grind data on different resolution lattice.