ee391 computer assignment 3. Custom convolution function