# convolution vs correlation?

Apparently this question looks better for DSP SE but I am posting it here to get answer in simple words for those EE graduates who didn't studied signal processing in undergrad.

Apparently as far as math expression is concerned, both are somehow similar but what is difference between correlation and convolution?

I have tried to google but I also come across a term "kernel".

What is meant by "kernel" in this regard? Is it same thing as a filter or any other entity?

Cross-correlation and convolution both have an integral of a product of 2 signals. But they have totally different base ideas. Convolution makes a new signal, a function of time. Cross-correlation compares two signals over their whole lengths. The result is not a function of time, but a function of the delay parameter.

Cross-correlation is a measure for "do 2 signals have the same or approximately same polarity variation rhythm". Both signals must have no DC ie. they must both have average=0 if this is wanted to be something meaningful. The parameter of the correlation is how much one of the signals is delayed.

If you calculate the cross-correlation of 2 signals which are made by applying different filterings to a common source signal the resulted function has a strong peak with delay = the difference of delays caused by the filterings.

In electronics terminology the cross-correlation of 2 signals can be considered to be the DC component of the ideal mix (=multiply) of 2 signals when one of the signals is delayed. The used delay is the parameter.

Convolution is time domain calculation of the response of a filter. Its idea is to present the input signal as a sum of short pulses which do not overlap. Everyone of the pulses initiate the impulse response of the filter but the amplitude is proportional to the pulse amplitude. The total response is the sum of the pulse responses and that sum is the convolution integral.

The kernel is a term in math. In integral transforms the input function is multiplied with the kernel function. Laplace transform has kernel=exp(-st). Integral transforms are general form of linear transformations when functions are considered as vectors in function space.

If one calculates the time domain response of a filter for a signal X with convolution he formally applies an integral transform to X. The kernel is the impulse response of the filter. It's in accordance with function space linear algebra terminology because filterings are linear transformations.

Convolution requires folding one of the time functions about the vertical axis; correlation does not. That is, $$\\small f(\tau)\$$ becomes $$\\small f(t-\tau)\$$. A small, but significant, difference.

Convolution and Correlation are very similar, except that in convolution, one of the functions is flipped about the t=0 axis (or x=0 axis in the spatial domain).

The 'kernel' is just one of those function, and is typically the one you flip. In the case of applying a single filter in the time domain, the kernel is the filter function.

You might wonder why would anyone bother to define a separate concept as 'convolution' that is so similar to 'correlation.' The short answer is that this need to flip the function about its axis before calculating the correlation comes up so often and is so central to engineering and physics (more specifically Linear Response Theory), that is it has its own name. A lot of great properties are known about it and how it relates to important operations in the Fourier and Laplace domains.