The Fourier transform of the kernel wasn't implemented correctly and resulted in 0 division when the bins are odd-numbered, moreover the whole histogram was shifted by one bin to the right.