Question

I think I get wrong result with a very simple example, so please help me point out what my mistake is:

I want to con-volute [1,1] with [1,1], so the correct result would be [1,2,1].

Now I do it using Fourier transform, [1,1] would become [2,0]. [2,0] point.wise.multiplies.with [2,0] would be [4,0], then inverse fft [4,0] and finally get [2,2]. Why didn't I get correct result?

Was it helpful?

Solution

For a linear fast convolution, you need to zero pad both your input vectors and use a longer FFT (of a length at least the sum of the two input vector lengths - 1), so that the circular convolution results don't wrap around an mix up the result.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top