# Correlation Performed by Convolution

Background: The question here is related to images in particular and not signal/waveforms.

I have been reading a lot of answers about the difference between convolution and correlation but I am stuck on my doubt as to how are they related to each other while performing operations. Most of the answers are individual answers for each of these terms.

For example:

A statement I am trying to understand says

Here correlation operations are performed by replacing the exhausted convolutions with element-wise multiplications using Discrete Fourier Transform (DFT).

I am not able to relate the individual definitions here. Can anyone please explain this?

What that statement is saying that

a. Correlation is performed the same way as one would perform convolution (you must implicitly know that one of the sequences is conjugated and time reversed to express a correlation as a convolution, as it was not stated there),

and

b. Mathematically the convolution is performed using this relationship

$$x[n]*h[n] = \mathscr{F}^{-1}\left\{\mathscr{F}\left\{x[n]\right\}\cdot\mathscr{F}\left\{h[n]\right\}\right\}$$

Where $*$ denotes convolution, $\mathscr{F}\left\{f[n]\right\}$ denotes the Discrete Fourier Transform of $f[n]$, and $\mathscr{F}^{-1}\left\{F[k]\right\}$ denotes the Inverse Discrete Fourier Transform of $F[k]$.

Note that these operations with Discrete Fourier Transforms actually yield the "circular" convolution of $x[n]$ and $h[n]$, which is equal to the linear convolution of $x[n]$ and $h[n]$ only under a certain condition: there must be enough zero padding to avoid aliasing.

• Thank you so much. It really helped me clear a part of my doubt. However, I still have a question. I was studying about matching with correlation (example: using the sum of squared differences). I understand that correlation is done the same way as convolution but why even do convolution if the same thing can be done using correlation. Has it to do with the easiness of computation in Fourier Domain? Jul 11, 2018 at 21:29
• Why convolution? Discrete convolution is the operation required to implement FIR filtering of a stream of samples of a sampled signal. FIR filters have broad applications. Correlation of a target pattern against a stream of samples is just a special case of an FIR filter known as a matched filter. The matched filter taps are just the time-reversed, conjgated samples of the signal you wish to match. Jul 11, 2018 at 22:18
{"ft_lang_label":"__label__en","ft_lang_prob":0.95063585,"math_prob":0.9790824,"size":650,"snap":"2022-40-2023-06","text_gpt3_token_len":120,"char_repetition_ratio":0.108359136,"word_repetition_ratio":0.0,"special_character_ratio":0.17384616,"punctuation_ratio":0.071428575,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9993348,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-10-02T15:10:42Z\",\"WARC-Record-ID\":\"<urn:uuid:5905da14-ecc1-4200-898e-bfc778d3ad47>\",\"Content-Length\":\"229198\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:8d145bcc-9d22-4b82-9ab2-6a9be7d7fb05>\",\"WARC-Concurrent-To\":\"<urn:uuid:c83bad95-8924-4550-abf2-6ba025bc8269>\",\"WARC-IP-Address\":\"151.101.1.69\",\"WARC-Target-URI\":\"https://dsp.stackexchange.com/questions/50463/correlation-performed-by-convolution\",\"WARC-Payload-Digest\":\"sha1:SHKIJALX6GY4RUXLDGXDLG7WFBDCDEEW\",\"WARC-Block-Digest\":\"sha1:DVIBXFFQROCGLR2FPIX3IXOCAGRBJGJA\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-40/CC-MAIN-2022-40_segments_1664030337338.11_warc_CC-MAIN-20221002150039-20221002180039-00547.warc.gz\"}"}