Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Convolution is a correlation with a reversed signal.

Correlation is a generalized dot product: multiplying corresponding pairs of values from two signals, and then adding the factors together. The result is zero if the signals are orthogonal (like the dot product of two vectors in 2D or 3D that are at 90 degrees).

The intuition behind the reversed signal comes from processing in the time domain. There are application in which we convolve a new signal with a segment based on a captured historic signal. That function is reversed so that the newest sample from the new signal correlates with the least recently captured sample in the historic signal.

For instance, we can use an impulse signal (like a clap) to capture the echoes from an acoustic space. That signal can then be convolved with audio data in order to give it a reverberation similar to what would be produced by that acoustic space. The captured impulse response has to be reversed, because echoes come in reverse. In the impulse capture, the longest echo is found on the far right. When we apply the impulse to simulate the echo, it has to be on he far left, because it has to correlate with an old sample of he input.

E.g. if we are at t = 0, and want to hear the 500 ms echo, that echo corresponds to a past sound sample that is now at t = -500. When are capturing the impulse response, then we issue the gunshot or clap at t = 0, and the 500 ms echo comes at t = 500.

The earliest reflections have to apply to more recent signal, but they are based on the least recently captured data.



I don't think you can really call it a generalized dot product, because it doesn't map to a scalar. The inner product is the well accepted definition of a generalized dot product, and convolution does not follow the axioms that an inner product must follow.


> I don't think you can really call it a generalized dot product, because it doesn't map to a scalar.

This. Convolution is a function which results from applying to convolution operator to two functions. A dot product is nothing of the sort.


> A dot product is nothing of the sort.

Its nearly the same thing, isn't it? If you denote by Tx the left-shift operator defined by (Tx f)(y) = f(y+x), then the correlation of f and g evaluated at x is precisely the dot product of f and Tx g. If you evaluate your function at a certain point, you obtain a scalar product.


> (...) then the correlation of f and g evaluated at x

It really isn't the same, and oddly enough you unknowingly show that off, by mentioning that convolution is the function that maps input functions to the output function, but the dot product is at best a single point evaluated with the output function.


Furthermore, it doesn't involve complex conjugation, and (closely related) it doesn't have any property akin to positive-definiteness.


Yes, thank you; you are right. The integral which is involved at the kernel of it is like a dot product, not the entire convolution itself.


> echoes come in reverse

I don't think it's true, cannot even imagine how it's possible, especially for long signals, like the whole song.

Any links to read about.


imagine you are able to see the wave as it hits a wall and reflects. the reverse signal is 180 degrees out of phase with respect to the forward.


You should be more careful and precise in your attempts to describe these things. Inverting the phase of a signal is entirely different than inverting the signal. Time-reversed signals are not the same as phase-reversed signals.


> The result is zero if the signals are orthogonal (like the dot product of two vectors in 2D or 3D that are at 90 degrees).

Here is a bit more rambling in the direction of linear algebra and probability: you can define a vector space on the set of all random variables, wherein each random variable is a vector. Once you do so, you can further impose an inner product space with the traditional covariance function as the inner product. If the two random variables are orthogonal with respect to this inner product and this space, by definition their covariance is equal to 0. It follows by the definition of correlation from covariance that their correlation will also be 0, i.e. orthogonality implies two variables are uncorrelated in this space :)

Strictly speaking the correlation function is not the inner product in this instance, but practically the result is the same.


> Convolution is a correlation with a reversed signal.

Interesting - when I learnt it, convolution came first.

I like the visual 'sliding' explanation best. Perhaps partly because that's what I was shown, but also because, I think, how else would you explain any integral? I mean, you could, but would you?

Even to a blind person (so I couldn't draw a diagram) I'd explain integration as 'picture a graph ... it's that bit ... it's adding this and this and this ... just like when you multiply two sides of a rectangle ...'


In your example, I guess you are reversing the 2nd signal so if the signals are the opposite. "Adding" or convolving them results in a zero?

i.e. if the signal is a (+)slope /, convolving it with a reverse of that signal \ = 0

In this sense you are leaving the difference between 2 signals.


Yes that is (auto- if using the same signal) correlation.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: