What is the intuition behind convolution? [duplicate]

This question already has an answer here:

I have been using convolution for finding outputs of various systems .I know how to use it.But I still don't know what does convolution exactly means? how one can define convolution ?

marked as duplicate by Jason R, lennon310, hotpaw2, Dilip Sarwate, penelopeJan 17 '14 at 9:56

No doubt there are many links and expositions on wikipedia and elsewhere about convolution, its relation to linear systems, and its link to frequency analysis, however I do not think that is what you are after.

Forget convolution for a moment. Just think of nothing but averages:

If I give you a series of say, $10$ numbers, and ask you to take the average, you can do that very easily.

Let us say that I give you another set of $10$ numbers again, and also ask you to take the average. You can again, do that very easily.

I keep giving you a set of $10$ numbers, and you keep giving me averages. What a life!

Now imagine I tell you a secret: Those sets of $10$ numbers I have been giving you, are actually from a taken from a long series of numbers. In fact I have a list of $100$ numbers. The first set of $10$ numbers I gave you were the first $10$ numbers of that list. (First sample to 10th sample). You averaged them.

The second list of $10$ numbers were actually the 2nd sample, to the 11th sample. You averaged them.

The third list of $10$ numbers I gave you were actually the 3rd sample, to the 12th sample. You averaged them.

After all this, I ask you to plot all the averages you gave me, one after the other.

Congratulations! You just showed me a convolution result!

(Disclaimer: There are some border conditions that I have skipped over, but this is basically all a convolution is).

So in summary, think of a convolution as just a sliding average.

Now, remember how I said "average" those $10$ numbers I gave you? Well you can also do a weighted average. (That is, instead of multiplying all the $10$ numbers by $1$ before averaging them, we multiply them by different numbers, before averaging them. This is a weighted average). This will still be a convolution though. We call those numbers "weights", and sometimes they are referred to as the "filter kernel".

Some advanced systems actually change their weights as they run, and they are called adaptive filters.

Eitherway, this should provide you with a solid intuition: Just remember that convolution can be thought of - is - a moving average of your data. Hope that helped!

• Thank you for this nice explanation.one thing i get from ur answer(and ofcourse i want to confirm it) that these weights are generally responsible for different systems to give different outputs when they are given same inputs means if high pass filter have a high pass characteristic then it is only because its weights make it do so.do i get it correct? – Amit_DSP Jan 15 '14 at 18:52
• @Amit_DSP Yes, exactly. A low-pass filter just has different weights, from a high-pass filter, or a band pass filter, etc, etc. Sounds like you got it. – Tarin Ziyaee Jan 15 '14 at 19:26
• Ya finally because of your help i got it .thanks alot – Amit_DSP Jan 15 '14 at 19:34

Convolution expresses in mathematics how to get the output of a Linear Time Invariant (LTI) system in response to an arbitrary input - if you know the impulse response. Take a discrete time system that has an impulse response h[t], so if I feed in an impulse I get h[t] at the output.

Now if I want to know the output given an input of x[n] = [1 2 1], what you do is break this input into 3 impulses i.e. we look at 3 separate input sequences [1 0 0], [0 2 0], and [0 0 1]. Our desired input is the sum of these 3 inputs. Because our system is LTI the output of the sum of the inputs is the sum of the outputs.

Because our inputs are impulses, the outputs will simply be scaled and delayed versions of the impulse response (again because of the definition of an LTI system)

So the output of each input is:
[1 0 0] -> 1*h[t]
[0 2 0] -> 2*h[t-1]
[0 0 1] -> 1*h[t-2]

Therefore the summing the left side and the right side we get
[1 2 1] -> 1*h[t] + 2*h[t-1] + 1*h[t-2]

So convolution simply sums delayed and scaled versions of the impulse response. The scaling and delay factors are simply the amplitude and delay associate with the input signal.

Often the convolution formula looks awkward because the output is written at a specific point in time i.e. what is the value of y? In our example above we would have to take the 3rd point from each of the output signals i.e. 1*h, 2*h, 1*h. To see this let
y${}_0$[t] =1*h[t]
y${}_1$[t] =2*h[t-1]
y${}_3$[t] =1*h[t-2]
and therefore Then we can see that
y${}_0$ = 1*h = 1*h
y${}_1$ = 2*h[2-1] = 2*h
y${}_3$ =1*h[2-2] = 1*h

The total output is the given by summing these i.e.
y = 1*h+ 2*h+1*h

But see this can also be written as:
y= x*h + x*h + x*h

All I have done above is replace the scaling with the corresponding index of the input signal x[].

If we write the formula for the output signal at an arbitrary time, y[n] - the result is the convolution formula. So the convolution formula is the result of having a Linear Time Invariant system and the impulse response of that system.

• +1 For me, this is the more intuitive explanation. It also faciliates the transition to continous convolution that has not been discussed, yet. – Deve Jan 17 '14 at 8:27