title: CUDA - how to pad kernel before convolution?
body: <p>I know that frequency multiplication = circular convolution in time space for discrete signals (vectors).</p>
  
  <p>I also know that "the convolution theorem yields the desired linear convolution result only if x(n) and h(n) are padded with zeros prior to the DFT such that their respective lengths are Nx+Nh-1, essentially zeroing out all circular artifacts."</p>
  
  <p>and everything works with vectors.. but my goal is circular convolution with matrices as in this paper:</p>
  
  <p><a href="http://developer.download.nvidia.com/compute/cuda/2_2/sdk/website/projects/convolutionFFT2D/doc/convolutionFFT2D.pdf" rel="nofollow">http://developer.download.nvidia.com/compute/cuda/2_2/sdk/website/projects/convolutionFFT2D/doc/convolutionFFT2D.pdf</a></p>
  
  <p>If you watch the first two figures (figure 1 and 2) you'll see that the kernel is padded in a weird way I've never seen before, what's this?</p>