File talk:Comparison convolution correlation.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

The cross correlation figure is wrong. For negative \tau of r_{xy}, the y curve should be shifted to the right by positive tau. The corrected version of this file will yields identical convolution and correlation, which may wrongly inspire that convolution is identical to correlation. Hence I suggest replacing x and y so that x is the triangle and y is the constant. This way, convolution and correlation will be different.

Thanks for the effort anyway.

Thanks for your feedback. Please see the rationale on http://en.wikipedia.org/wiki/File_talk:Comparison_convolution_correlation.svg . Cheers, 94.197.120.192 17:05, 7 July 2015 (UTC)[reply]


For real-valued functions, cross-correlation is defined as:

[1][2][3][4]

It follows that when the function is symmetrical (as in this figure), convolution and cross-correlation are identical. The problem is fixed at https://commons.wikimedia.org/wiki/File:Comparison_convolution_james.png, and Ahmedrashed00's concern about causing confusion is addressed by showing all 5 cases.

  1. Bracewell, R. "Pentagram Notation for Cross Correlation." The Fourier Transform and Its Applications. New York: McGraw-Hill, pp. 46 and 243, 1965.
  2. Papoulis, A. The Fourier Integral and Its Applications. New York: McGraw-Hill, pp. 244-245 and 252-253, 1962.
  3. Weisstein, Eric W. "Cross-Correlation." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/Cross-Correlation.html
  4. https://en.wikipedia.org/wiki/Cross-correlation

--Bob K (talk) 23:01, 19 November 2016 (UTC)[reply]

Hi @Bob K, You've convinced me with the sources and File:Comparison_convolution_james.png. I've updated the graphic and hope it's all right now. Cheers, cmɢʟeeτaʟκ 19:08, 20 November 2016 (UTC)[reply]

Nice job. Sorry about the superfluous reverts. An apparent time-delay tricked me into thinking you had uploaded an old file instead of the new one.
--Bob K (talk) 19:49, 20 November 2016 (UTC)[reply]

I am still seeing an old version shown as "current". And it's not the browser cache. Just a super long Wikimedia delay, I think.
--Bob K (talk) 22:28, 20 November 2016 (UTC)[reply]

No problem, appending "?action=purge" to the URL sometimes refreshes Wikimedia's cache. Cheers, cmɢʟeeτaʟκ 05:37, 21 November 2016 (UTC)[reply]

Thanks for the suggestion. A popup asked me if I was sure I wanted to do it. I said yes, but I'm still seeing an old version. Are you having the same problem?
--Bob K (talk) 12:32, 21 November 2016 (UTC)[reply]

Update: When I click on the figure, so that it fills the screen, and then append "?action=purge", I can see the new picture. But when I return to the main page, that trick doesn't work.
--Bob K (talk) 13:21, 21 November 2016 (UTC)[reply]
Update: I decided to try viewing the page with a different browser, because I've had to do that a couple of times in the past to work-around unrelated problems. And that did the trick! Everything looks great with Mozilla. Still looks wrong with Chrome. Weird!
--Bob K (talk) 21:34, 21 November 2016 (UTC)[reply]
It's likely Chrome's cache not being refreshed. Try pressing Ctrl+Shift+R (Linux or Windows) or Cmd+Shift+R (Mac) on the "main page", which I suppose you mean the file description page https://commons.wikimedia.org/wiki/File:Comparison_convolution_correlation.svg . cmɢʟeeτaʟκ 23:13, 21 November 2016 (UTC)[reply]

By the way, I just noticed an apparent mistake at http://mathworld.wolfram.com/Cross-Correlation.html. It's the statement:

"If f or g is even, then "

But they are only equivalent when f is even, as we have illustrated here.
--Bob K (talk) 12:52, 21 November 2016 (UTC)[reply]

Update: I reported the error to mathworld. So it will presumably get fixed eventually.
--Bob K (talk) 13:21, 21 November 2016 (UTC)[reply]
Thanks, that's very proactive of you!
Incidentally, I added the little protrusion on the graph of f so that the viewer can tell when it is flipped. Frankly, it looks clunky and I'd prefer a better solution. One is to use a true asymmetrical f function which is different enough from g and still allows all the convolution/correlation graphs to be sketched by hand. Would you have any suggestions?
Cheers,
cmɢʟeeτaʟκ 23:13, 21 November 2016 (UTC)[reply]

cross correlation order

[edit]

Why is the first one g∗f in the cross correlation? The formula says that in f∗g f is fixed and g is shifted. — Preceding unsigned comment was added by 91.18.28.51 (talk) 11:35, 22 September 2019 (UTC)[reply]

What the formula actually says is that the 2nd function (whether it's named f or g) shifts to the left or (equivalently) the 1st function shifts to the right:
Therefore:
which is correctly depicted in the figure.
You might also ask why did the artist place f♦g next to g∗f, instead of next to f∗g? I believe it is to facilitate comparing the 5 snapshots below the graphs. They are identical sets, except for the orientation of function f, as denoted by the little bump on its left-hand corner. But since f is symmetric, the orientation does not matter, which explains why g∗f and f♦g look the same.
--Bob K (talk) 05:09, 23 September 2019 (UTC)[reply]

Fix the f-curve

[edit]

The f-curve has gotten a "spike" at the left edge, easily fixable by replacing

 <path id="graph_f"  d="M -55,0 H -10 V -22 V -20 H 10 V 0 H 55"/>

with

 <path id="graph_f"  d="M -55,0 H -10 V -20 V -20 H 10 V 0 H 55"/>

in the SVG-file.

Thanks for your suggestion, @Jan Erlandsen: The "spike" is intentional, to show when it is laterally mirrored. Unlike the triangular pulse, the square pulse is symmetrical, so I needed a way to show when it is mirrored and when it is not, and the spike was the best way I found without having to change the resultant profiles. If you can think of a better way to indicate the pulse orientation, please let me know. Cheers, cmɢʟee ⋅τaʟκ 12:57, 22 October 2020 (UTC)[reply]