Take a complex number as an example
How convolution is performed (i am convolving s with itself)
you take the time reversal of the your signal and shift it,move it on the other signal from left to right while summing them
conv(s,s)
ans =
0.0000 + 2.0000i 8.0000 + 0.0000i 0.0000 - 8.0000i
In correlation you take the conjugate of your signal and shift it,,move it on the other signal from left to right while summing them
xcorr(s,s)
ans =
0.0000 + 4.0000i 10.0000 + 0.0000i 0.0000 - 4.0000i
what convolution did is it expresses how the shape of one signal is modified by the other
what correlation did is it maximizes the output value
How to Perform Correlation through Convolution
In convolution we flip the signal,shift it and move
In correlation we conj the signal shift it and move
so the difference is one flips it and the other conjugates it
In order to perform Correlation through convolution
- flip the signal by yourself
- take conjugate of signal by yourself
conv(s,fliplr(conj(s)))
ans =
0.0000 + 4.0000i 10.0000 + 0.0000i 0.0000 - 4.0000i
same result as correlation
when you flip the signal and feed it to convolution block, it flips it again (as it is a part of convolution) .
Hope this was helpfull for you