Convolutions and cross correlations for ndarrays