The similarity of two signals is calculated by cross correlation. But, how to define an indicator which quantitatively measures the degree of similarity between two signals? Thanks.

  • $\begingroup$ normalize your cross correlation, Stephan. $\endgroup$ – robert bristow-johnson Oct 22 '16 at 3:20
  • $\begingroup$ Can you clarify what it is that you need that is not provided by correlation? $\endgroup$ – MBaz Oct 22 '16 at 3:21

assuming finite power signals:

$$ \lVert x \rVert^2 \triangleq \lim_{N \to \infty} \ \frac{1}{2N+1} \sum\limits_{n=-N}^{+N} \big|x[n] \big|^2 \ < +\infty $$

this is a Hilbert Space sorta thingie.

define inner product:

$$ \langle x,y \rangle \triangleq \lim_{N \to \infty} \ \frac{1}{2N+1} \sum\limits_{n=-N}^{+N} x[n] \cdot \overline{y}[n] $$

where $\overline{y}[n] $ is the complex conjugate of $y[n]$. so this is true about the norm:

$$ \lVert x \rVert = \sqrt{\langle x, x \rangle} $$


$$ R_{xy}[k] \triangleq \langle x[n], y[n+k] \rangle $$


$$ R_{xx}[k] \triangleq \langle x[n], x[n+k] \rangle \ \le R_{xx}[0] = \lVert x \rVert^2 $$

Normalized Autocorrelation (sometimes called "autocovariance")

$$ -1 \le \frac{R_{xx}[k]}{R_{xx}[0]} \triangleq \frac{\langle x[n], x[n+k] \rangle}{\langle x[n], x[n] \rangle} \ \le 1 $$

Normalized Crosscorrelation:

$$ -1 \le \frac{R_{xy}[k]}{\lVert x \rVert \lVert y \rVert} \triangleq \frac{\langle x[n], y[n+k] \rangle}{\sqrt{\langle x[n], x[n] \rangle}\sqrt{\langle y[n], y[n] \rangle}} \ \le 1 $$

  • $\begingroup$ Dear @robertbristow-johnson, thanks for your nice solution. $\endgroup$ – Amin Oct 22 '16 at 4:02
  • $\begingroup$ just a mistake. Excuse me. $\endgroup$ – Amin Oct 22 '16 at 4:03

The general topic of finding similarities between signals is wide ranging:

  • are the signals of same sampling, length, offset, shift or scale?
  • where do they take their values (discrete, real, complex)?
  • are they stationary? noisy?
  • what do you consider similar (whole signals, chunks, specific features)?
  • which are the invariances looked for?
  • and most important: what is your goal?

The following works provide an overview of some common similarity metrics, which one can normalize into an index:

  • 1
    $\begingroup$ This is called a useful answer. $\endgroup$ – msm Oct 22 '16 at 6:44
  • $\begingroup$ Dear @Laurent Duval, thanks for your nice answer. $\endgroup$ – Amin Oct 22 '16 at 12:42

if you are searching for similarity between two signals in frequency domain, you can go for coherence. Coherence indicates frequency components common to both signals


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.