Linear deconvolution using FFT

330 Views Asked by At

I want to deconvolve a filtered signal with a known input to recover the filter used using FFTs.

Let $x$ be a vector of length $N$ and $h$ a filter of length $K$ where $N > K$.

Let $x \ast h = y$, where $\ast$ is a convolution in 'valid' mode (when the vectors fully overlap).

$$\begin{bmatrix}x_1 & \dots & x_{K} \\ x_2 & \dots & x_{K + 1}\\ & \vdots & \\ x_{N - K + 1} & \dots & x_{N}\end{bmatrix} \begin{bmatrix}h_{K} \\ \vdots \\ h_1\end{bmatrix} = \begin{bmatrix}y_{K - 1} \\ y_K \\ \vdots \\ y_{N}\end{bmatrix} $$

Vector $y$ can be computed efficiently using FFTs. By zeropadding vector $x$ and $h$ both to length $N + K - 1$, we get

$$x_p = [x_1\, \dots \, x_N \, 0 \, \dots \, 0] \\ h_p = [x_1\, \dots \, x_N \, 0 \, \dots \, 0]$$

Then the 'full' convolution can be computed as

$$y_f = \mathcal{F}^{-1}\left(\mathcal{F}(x_p)\mathcal{F}(h_p)\right) = [y_{0} \, \dots \, y_{K-1} \, \dots \, y_{N} \, \dots \, y_{N + K - 1} \,] $$

It is then trivial to obtain the 'valid' convolution by trimming off $K - 1$ elements from the ends of the vector.

$$y = [y_{K-1} \dots y_N]$$

How can we deconvolve $y$ and $x$ using FFTs to recover $h$? It is straightforward for $y_f$, but I have been struggling with $y$.