9

This is now a second time I am attempting to ask this very important but simple question here. What I want to know is can you do deconvolution by convolving a signal. It is often stated that, for example by cutting and boosting the same frequency on an equalizer the result is the original signal. Is that the case? Can convolution be removed by convolving? That would certainly brake the identity that the convolved signal must be n+m-1 in length. I tried this with an equalizer and the results seem to be close to perfect, just some quantization distortion.

If the above can be done, I can not arrive at this conclusion. For example If I convolve (1) with (1, 1) the result is (1, 1). I can not find any impulse response that if convolved with (1, 1) would result in (1).

So what is the truth here?

Royi
  • 19,608
  • 4
  • 197
  • 238
Tony
  • 121
  • 1
  • 3
  • Hi, Anything missing in the answers? If not, could you please mark one of them? Thank You. – Royi Mar 16 '22 at 16:20

5 Answers5

12

Since convolution describes the operation of a linear time-invariant (LTI) system, the question is if the effect of an LTI system can be compensated by another LTI system. In the discrete-time domain you can use the $\mathcal{Z}$-transform to analyze LTI systems. If a signal $x(n)$ (with $\mathcal{Z}$-transform $X(z)$) is filtered by a system with impulse response $h(n)$ (with $\mathcal{Z}$-transform $H(z)$), then the $\mathcal{Z}$-transform of the resulting output signal $y(n)$ is given by

$$Y(z)=X(z)H(z)$$

Recovering $X(z)$ from $Y(z)$ can theoretically be done by

$$X(z)=\frac{Y(z)}{H(z)}$$

except at points $z$ where $H(z)=0$. The above equation corresponds to convolution with an impulse response $g(n)$ with $\mathcal{Z}$-transform

$$G(z)=\frac{1}{H(z)}\tag{1}$$

The question is if this system can be realized by a causal and stable filter. This is indeed the case if $H(z)$ is a minimum-phase system. Assuming rational transfer functions (which we always get when discrete-time systems consist of adders, multipliers, and delay elements), this means that $H(z)$ is a causal and stable system with all its zeros inside the unit circle of the complex plane (its poles are of course also inside the unit circle because of stability). Due the inversion in (1), the zeros of $H(z)$ are the poles of $G(z)$ and vice versa, i.e. if the zeros of $H(z)$ are inside the unit circle, then $G(z)$ is stable. One more thing that can be seen from (1) is that if $H(z)$ is an FIR system, then $G(z)$ is IIR. Nevertheless, in practice equalization if often done by FIR filters, which approximate the inverse filter in some optimal sense.

Let's look at a simple example. Assume an FIR system

$$h(n)=\delta(n)-a\delta(n-1),\quad |a|<1$$

Then we have

$$H(z)=1-az^{-1}$$

$H(z)$ is a minimum-phase system because it has one pole at $z=0$ and a zero at $z=a$, which is inside the unit circle if $|a|<1$. The inverse system is given by

$$G(z)=\frac{1}{1-az^{-1}}=\sum_{n=0}^{\infty}a^nz^{-n}$$

the impulse response of which is

$$g(n)=a^n,\quad n\ge 0$$

which is of course IIR.

So in this case the convolution

$$y(n)=(x*h)(n)=x(n)-ax(n-1)$$

can be perfectly compensated for by the convolution

$$x(n)=(y*g)(n)=\sum_{k=0}^{\infty}g(k)y(n-k)=\sum_{k=0}^{\infty}a^ky(n-k)$$

Note that exact deconvolution of a minimum-phase FIR system can only be achieved by an IIR system. The only systems that can be inverted (exactly) by FIR systems are all-pole IIR systems, i.e. systems with all their zeros at the origin of the complex plane (like $g(n)$ in the example above). Note however that in practice exact compensation is usually not the goal. E.g., in digital communications, almost all (linear) equalizers are implemented by transversal (FIR) filters, because they can be adapted more easily and because they are always stable.

Matt L.
  • 89,963
  • 9
  • 79
  • 179
  • Thanks. So the answer to my question is that the result of convolution is in fact not always the length of the convolved signals -1. However, it seems like to deconvolve a FIR response you need to do convolution with IIR. Equalizers can't possibly change the impulse length based on if they are cutting or boosting, correct? – Tony Jun 05 '14 at 06:24
  • Could you say something about the properties of the inverse. For example, if $ H $ is FIR, must $ G $ be an IIR, mus it be infinite, etc... Great Answer! – Royi Jun 05 '14 at 06:26
  • Further, the result seem to be quite difficult to calculate. What do you think would be the answer (in time domain) to what does (1, 1) need to be convolved with for the end result to be (1, +infinite number of 0s I guess). I think the answer is 1, -1, 1, -1 in an infinite sequence, but just want to be sure. There is no easy way to solve this in time domain, is there?

    Indeed, it's true that the filter's impulse response length is different for cuts than boosts. I guess short FIR filters are unable to deconvolve then.

    – Tony Jun 05 '14 at 06:56
  • @Tony: You are right about the deconvolution of (1,1). The problem is that the inverse filter is not stable. Note that infinite impulse responses can be implemented efficiently using recursive structures, so the example I gave can be easily implemented in the time-domain. If deconvolution is (approximately) possible using short FIR filters solely depends on the characteristics of the original filter to be compensated for. E.g., you can turn my example around, i.e. use $g(n)$ as the first filter. Then it can be deconvolved (exactly) by $h(n)$, a simple 2-tap FIR filter. – Matt L. Jun 05 '14 at 08:01
  • @Drazick: I added some comments at the end of my answer. – Matt L. Jun 05 '14 at 08:13
  • @MattL. Thank You. I was just trying to extract more data for a better question. By the way, I'd link or show proof for the claim: "Note that exact deconvolution of a minimum-phase FIR system can only be achieved by an IIR system. ". – Royi Jun 05 '14 at 08:24
  • 1
    @Matt L. With "FIR filters are unable deconvolve" I meant that FIR is unable deconvolve it's own FIR impulses. It seems like IIR filters are able to produce responses that settle to 0(audio) quickly and deconvolve their own impulses.

    By the way, in circular convolution it seems FIR can be deconvolved by FIR, as long as multiplication/division by 0 does not take place in the non0 frequency domain. That would also indicate that by aliasing the time domain FIR can be deconvolved by FIR. True?

    DC offset only proof: (1,1)(1,1)=(2, 2); (2, 2)(0.25, 0.25)=(1,1), where * = Circular Conv.

    – Tony Jun 05 '14 at 16:47
  • 1
    @MattL. Here is a better proof with a DC offset and a sin component in both functions. The first term is linear convolution to show that the circular convolution can deconvolve linear FIR convolution with a finite impulse: (1, 0) * (2, 1) = (2, 1); (2,1) *circular (0.66,-0.33) = (1, 0). 0.66 and -.0.33 are rounded.

    However, this does not work in the (1,1) * (1.0) "dirac*DC" case, which makes sense since we are multiplying a filled frequency bin by 0. I don't yet fully grasp why this kind of function can be deconvolved in any form.

    – Tony Jun 05 '14 at 18:00
  • 1
    @Tony: Circular deconvolution is a different matter. With circular (de)convolution it does not make sense to make the distinction FIR vs. IIR because by definition all involved sequences are of length $N$. So if (circular) deconvolution is possible, it is naturally always possible by a finite length sequence. And it is possible if the DFT of the impulse response does not introduce any zeros in the DFT of the original sequence. – Matt L. Jun 07 '14 at 11:48
  • @MattL. Thanks for your responses, makes sense. Although theoretically DTFT could be IIR I think. I have "only" one more question. It is often stated that by running a signal through AD/DA multiple times the steep "ideal" low pass filter doesn't add or remove anything. No convolution, nor deconvolution. This would certainly be the case in circular convolution (0*0=0), but I am not so sure on the linear case. Linearly convolving a sinc function with a sinc function seems like it should add an echo. – Tony Jun 07 '14 at 19:42
  • 1
    @Tony: If the two sinc functions have the same zero crossings, convolution changes nothing. This is of course much easier to see in the frequency domain than in the time domain. – Matt L. Jun 08 '14 at 07:37
  • @MattL. But linear convolution is not straight up multiplication in the frequency domain, you need to zero pad the time domain signals first. So basically what you are saying is linearly convolving a sinc with a sinc would not alias (no zero padding needed) and thus the result would be the same if convolved linearly or circuralry. That is hard to believe considering that neither of the sinc functions have any zeros on the edges in time domain. What I am thinking is that sinc function linearly convolved with sinc is a longer and steeper(freq domain) sinc function. That would solve the problem. – Tony Jun 08 '14 at 17:12
  • 1
    @Tony: Linear convolution IS multiplication in the frequency domain. Of course not of the DFTs but the the DTFTs. A sinc function extends infinitely, so I'm not sure what you mean by 'zero padding' in this context. And two sincs convolved with each other cannot get any steeper because each of them is already in ideal lowpass filter. – Matt L. Jun 08 '14 at 20:50
  • @MattL. I guess this depends on how you want to handle infinities. One could say DTFT is already padded with infinite zeroes meaning equivalence of circular and linear conv. I would say though that you need to zero pad the infinite sincs with infinite-1 zeros to perform the convolution and that you can always have greater steepness. But let's say we have a less than infinite signal like is the case in real world and thus no such theory-crafting is needed. Then a sinc linearly convolved by sinc would result in a longer (in time domain) sinc, is that correct? – Tony Jun 09 '14 at 00:56
  • 1
    @Tony: Any signal of finite length convolved with another signal of finite length results in a longer signal (of finite length). But a sinc remains a sinc, and it is just a function of the form $\sin(x)/x$. I think by now it would start making sense to formulate a new question on whatever doubts you may have on convolution and related topics. – Matt L. Jun 09 '14 at 10:49
4

What you want is $$x(t) = (x(t)\otimes h(t))\otimes h'(t)$$ where $\otimes$ denotes convolution. Taking $Z$ transform, $$X(z) = X(z) \times H(z) \times H'(z)$$ or $$H'(z) = \frac{1}{H(z)} \tag{1}$$

So you can deconvolve a convolution sum if you you have inverse transfer function as expressed in (1).

For causal and stable system, the ROC of $H'(z)$ must extend to infinity and ROC should contain the unit circle.

nidhin
  • 457
  • 3
  • 12
2

Another approach (Though the same).

Let's assume we're in a Finite Dimension Space and the convolution operator is the Circular Convolution (Namely, the same we would do using the DFT).

Then $ y = h \ast x $ can be written as:

$$ y = H x $$

Where $ H $ is a circulant matrix.
Now, the Deconvolution Operator is basically the Inverse of $ H $.
Yet, since $ H $ is a circulant matrix it can be diagonalized by the DFT Matrix:

$$ H = {D}^{T} \mathcal{{H}_{f}} D \Rightarrow {H}^{-1} = {D}^{T} \mathcal{{H}_{f}}^{-1} D $$

Where $ \mathcal{{H}_{f}} $ is a diagonal matrix (Basically the DFT of the $ h $ filter).
The above implies $ {H}^{-1} $ is also a circulant matrix and since:

$$ x = {H}^{-1} y $$

The operation can be carried out as a convolution.

Pay attention, we assumed the there are no vanishing elements in the diagonal matrix (Otherwise it can be inverted).
This is a valid assumption to any deconvolution problem.
In any case information it lost (Vanished) there is no way to return it using direct convolution (Some priors might do, but this is not what the question is all about).

lennon310
  • 3,590
  • 19
  • 24
  • 27
Royi
  • 19,608
  • 4
  • 197
  • 238
1

If you deconvolve the output signal with the system response, then you will obtain the (almost) input signal.

(sig_noisy = sig_clean * h + noise)

Alternatively, if you don't know the h function, but know the input and output, this time why not deconvolve the input signal with the output which will give the h^-1 function. Then you can use it as a filter to filter the noisy signal.

(sig_clean = sig_noisy * h^-1)

So, it is possible. I believe I have answered it in more detail in other related question.

Ozcan
  • 264
  • 2
  • 8
1

I know this is an old thread, but it's an interesting topic. The answer is yes, you can perform deconvolution by convolution.

1) In FFT deconvolution, one normally divides the spectrum of the signal we want to deconvolve by the spectrum of the point spread function, and then take the inverse FFT.

So in this context, division in the frequency domain is deconvolution.

However this is equivalent to taking the same signal and multiplying by the reciprocal of the point spread function.

Multiplication in the frequency domain is convolution.

I have been using this trick for years. If I want to deconvolve a lot of data that has the same point spread function (PSF), I take the FFT of the PSF, and then take the complex reciprocal of it. I call this the inverse point spread function - IPSF.

Now one only need do a complex multiply of the FFT of signal we wish to deconvolve by the IPSF, which is a must faster operation than complex division.

In theory, one could take this IPSF, convert it to the time domain, and do time domain convolution with it, and get a similar result. I have not tried it myself, so your mileage might vary. However, I'm not sure if performing it in the time domain will have the power to shrink the length of the output down to it's original length (see my comment below in (2)) - you would need to experiment.

What one must bear in mind with simple FFT deconvoltion like this, is that if the original convolution was really aggressive, deconvolving it will just produce a lot of noisy mess, unless you have a way to temper the amount of deconvolution you need.

But in simple cases, it works like a charm.

2) To answer your second question, about the length of the resulting signal, it is true that when performing convolution, one needs to allow the output length to grow from n to n*2-1 samples in the output.

Deconvolution, if it is perfect, can shrink the result back form n*2-1 to n again. And this is the case whether you do it by FFT division, or by multiplying by the IPSF - deconvolution by convolution. However, with rounding noise and other distortions, this can't be relied upon.

Mark R