Correlation: Concept to FormulaIn digital signal processing, we calculate the correlation between two discrete signals by multiplying corresponding samples of the two signals and then adding the products. Where does this process/formula for correlation come from?

I understand the concept of correlation (similarity) between two signals. But I fail to understand how it translates to the formula that it does.

All the texts I have seen so far start with this formula and explain cross correlation, auto correlation, etc. None of them attempt to explain how the formula was derived in the first place.

I understand the concept of correlation (similarity) between two signals. But I fail to understand how it translates to the formula that it does.

All the texts I have seen so far start with this formula and explain cross correlation, auto correlation, etc. None of them attempt to explain how the formula was derived in the first place.