Johnny Pauling
Johnny Pauling

Reputation: 13437

CUDA - how to pad kernel before convolution?

I know that frequency multiplication = circular convolution in time space for discrete signals (vectors).

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."

and everything works with vectors.. but my goal is circular convolution with matrices as in this paper:

http://developer.download.nvidia.com/compute/cuda/2_2/sdk/website/projects/convolutionFFT2D/doc/convolutionFFT2D.pdf

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?

Upvotes: 2

Views: 1768

Answers (1)

Johnny Pauling
Johnny Pauling

Reputation: 13437

Solved by padding and extending the matrix to get rid of circular artifacts (see nvidia CUDA sdk papers)

Upvotes: 1

Related Questions