# Why is sweeping in convolution so confusing

From this formula, I thought that time constant (m or tau) is the variable sweeping from -infinity to infinity.

But in this visualisation https://lpsa.swarthmore.edu/Convolution/CI.html, it is t the variable that sweeps. Although convolution makes sense this way but how come the notation is so confusing?

Convolution is the single most convoluting thing I had to deal with in college. Now having mastered it, this text is what helped me the most.

To answer your specific question, for me the best way to think of it is - convolution is a transform. A transform is something we apply for various parameter choices - in this case, a time shift. I strongly dislike the notation

$$y(t) = \int_{-\infty}^{\infty} x(\tau) h(t - \tau) d \tau$$

It's an equivalent, but much more obfuscated, version of what's consistent with conv's actual motivation:

$$y(\tau) = \int_{-\infty}^{\infty} x(t) h(\tau - t) dt$$

This reads, "convolution at shift $$\tau$$, is inner product of $$x$$ with, time-reversed $$h$$ centered at $$\tau$$". So, for each $$\tau_0$$, e.g. $$5$$, we compute the integral

$$y(5) = \int_{-\infty}^{\infty} x(t) h(5 - t) dt$$

Then, $$y(\tau)$$ is simply what stores every such possible $$\tau_0$$. And we call it "convolution".

Lastly, it's "equivalent" because it's simply a change of variables: we swap $$t$$ and $$\tau$$. The motivation is that we want our output to be in terms of a familiar variable, $$t$$.

Edit: briefly, I confused "motivation" for sake of computational understanding vs physical motivation. The "bad notation" correctly reflects the physical motivation, but that's its own topic.

• Your first example - the one you dislike - is most natural if h(t) and y(t) are input and output signals and x(τ) is the impulse response of the filter. Good engineering practice is to use t for time and τ for delay. Some applications require a t-t=τ convolution, others require t+τ=t. Commented Apr 6, 2022 at 14:32
• @RainerP. h(τ) isn't impulse response, h(t) is. That the output can be expressed in $t$ is a happy coincidence. What's convenient for engineering or notation isn't what's most meaningful (both physically and for interpretation). Commented Apr 6, 2022 at 14:43
• I know that x is usually the input and h is the impulse response, but then it should be x(t-τ)h(τ) in the integral. Not that it makes a difference, but the definition of an LTI system is usually given as "the output depends on the current and past inputs" which is best (most intuitively) modelled by x(t-τ). Also, the running variable of an impulse response is delay, so h(τ) it is. Commented Apr 6, 2022 at 14:49
• That the output can be expressed in t is not coincidence. If you convolve a time-signal with a delay-signal, you get a time-signal again. If you convolve two time-signals, you get a delay-signal. The same is true for subtraction, for example. If you subtract two dates, you get a duration. If you subtract a duration from a date, you get a date again. Commented Apr 6, 2022 at 15:21
• @RainerP. Strided convolution breaks one-to-one mapping between $t$ and $\tau$ and the discrete output can no longer be indexed with both. "Coincidence" is stretching a bit, but point is, $\tau$ is a transform parameter, and $t$ is input's domain upon which transform operates, and swapping them defies the original (and intuitive) motivation of convolution. Yes, it can still be interpreted intuitively with context, but I'd not present it to early learners without disclaimers (or an explicit distinction). Commented Apr 6, 2022 at 15:53

$$t$$ is the time for the result. For each $$t$$ we need to sweep over $$\tau$$ to get the result for that one instant in time. Read the intuitive explanation below for one popular application of convolution: predicting the output of a linear system based on the input and the impulse response of the system. I will then come back to this opening point.

The following graphic offers an intuitive explanation to the "time reversal and sweep" done in the convolution process, and why:

Here we see convolution at work in predicting the output of a linear system based on the convolution of the impulse response with the input waveform.

Since the system is linear, the trailing response of one sample from a specific waveform in time will add to the subsequent response of a later sample in time from that waveform. We can represent arbitrary waveforms as an series of weighted impulses, each providing their own response at the output. The time reversal that we do represents having the first "impulse" in the input waveform at $$t=0$$ appear at the output first. The sweeping is to then capture all the subsequent impulses and in turn add their results to the output as we predict each subsequent output at any given time $$t$$. This is very easy to visualize directly for discrete-time signals. In the continuous time case, we do this in the limit which results in integration instead of summation, but the same fundamental process occurs.

So to tie this back to the opening point made, we see that at each time computed for the output, we need to go through the tailing response from every prior input. Each input produces the output of the same impulse response at a subsequent delay, hence we can conveniently sweep $$\tau$$ to determine those individual responses for that one instant $$t$$ in time at the output.

You can define the names of variables however you like and they can be chosen differently in different books. The integral does sweep over tau and m in the pictured example. The linked material chooses to calls the variable the convolution integral sweeps over lambda.

The actual difference between the examples is that they are not the same situation. The linked source presents a convolution of function f with any arbitrary function h while the pictured equations present a convolution of function x with the Dirac delta function specifically and thus the integral returns the value of x at the zero point of the Dirac delta function, which in this case is tau = t (so the integral over tau returns x(t)).

Shouldn't the discreet formula be using Kronecker delta instead of Dirac delta function, since it is a discreet situation with no integral involved?