# How to find the convolution kernel in frequency domain?

I have a two vectors of spatial data (each about 2000 elements in length). One is a convolved version of the other. I am trying to determine the kernel that would produce such a convolution. I know that I can do this by finding the inverse Fourier transform of the ratio of the Fourier transforms of the output and input vectors. Indeed, when I do this I get more or less the shape I was expecting. However, my kernel vector has the same dimensionality as the two input vectors when in reality the convolution was only using about one fifth (~300-400) of the points. The fact that I am getting the right shape but the wrong number of points makes me think that I am not using the ifft and fft functions quite correctly. It seems like if I were really doing the right thing this should happen naturally. At the moment I am simply doing;

FTInput = fft(in);
FtOutput = fft(out);
kernel = ifft(FtOutput./FTInput).


Is this correct and it's up to me to interpret the output vector correctly or have I oversimplified the task? I'm sure it's the latter, I'm just not sure where.

• Is your input data zero-padded on both sides to the length of the convolution kernel? It should be, otherwise you loose information there, which might be the reason for these artifacts. – leftaroundabout Dec 13 '11 at 11:50

If you have noise present in your signal, the straightforward Fourier domain division will cause plenty of errors in your result. Some ways to avoid it are by using the so-called dual channel FFT (Part 1 and Part 2). I can also suggest deconvolution via adaptive filters, LMS or NLMS ([Normalized] Least Mean Squares) filters in particular are easy to understand are not hugely expensive in terms of CPU cycles in case your signals are long. LMS adaptive filters are very robust to noise.

• That worked a treat thanks and I discovered a whole new type of thing I didn't know existed. – Bowler Dec 13 '11 at 19:50
• @Phonon are those links working? What is this a sign up for exactly? – Spacey Mar 17 '12 at 5:54
• @Mohammad: It's for accessing Brüel & Kjær technical review articles and books. Sign-up is free and gives access to many good articles. – Thor Jul 20 '12 at 20:20