Cross - correlation between two complex signals

235 Views Asked by At

I want to calculate the degree of similarity of two complex signals with different lengths in the time domain using python, so I’ll get a scalar value representing the degree of similarity.

I thought about zero padding the shorter signal and then calculating the Pearson Correlation between them but I’m not sure that this it the correct way.

What is the correct way of doing so ?

1

There are 1 best solutions below

0
On BEST ANSWER

For $\mathbf{x} \in \mathbb{C}^N$ and $\mathbf{y} \in \mathbb{C}^M$, where $M < N$, I would suggest the following metric:

$$ \min_{d} { { \left( \mathbf{x} - \alpha \bar{\mathbf{y}} \right) \left( \mathbf{x} - \alpha \bar{\mathbf{y}} \right)^\mathrm{H} } \over {\mathbf{x}\mathbf{x}^\mathrm{H}} }, \;\;\;\; \alpha = { {\bar{\mathbf{y}}^\mathrm{H} \mathbf{x}} \over { \bar{\mathbf{y}}^\mathrm{H} \bar{\mathbf{y}} } }, \;\;\;\; \bar{\mathbf{y}}[n] = \mathbf{y}[n] \ast \delta [ n - d] $$

So I would slide the shorter of the two over the longer one, zeropadding as necessary, compute the above formula, and use the minimum of that formula as the measure of the two at their most similar. The more similar they are, the smaller the value of the formula will be. The use of $\alpha$ let's you ignore scalar differences between the two, which if you don't wish to ignore, can be included by just setting $\alpha = 1$.