1
$\begingroup$

I need compare two signals. Signals have simliar shapes but completely different values (as on picture):

enter image description here

So I think cross corelation in frequency domain should gave me a number that shows me how the signals are similar. But I have no idea how to do that in matlab.

Where I can find code to do it?

$\endgroup$
1
$\begingroup$

Yes, cross-correlation will provide some information on the similarity of the two waveforms. See the function reference for xcorr. Look into proper normalization so that the result is between something like 0 and 1 or -1 and 1. As a matter of fact, this is pretty well discussed in another stackexchange question.

As for frequency domain cross-correlation, I don't think that's what you want to do. Doing time-domain cross-correlation results in multiplication in the frequency domain, so you're looking to maximize the total energy in F(x)*F(y), where F(x) is the FFT of x.

$\endgroup$
  • $\begingroup$ Thanks for reply. xcorr returns me array but I need one number to describe similarity (I think it could be in one number). I was using also corrcoef which returns me one number to decribe similarity but still not sure I can use that. Can you describe step by step how to multiplicate time-domain cross-correlation results with frequency domain ? It's something like this: xcorr(x,y) * F(x)*F(y) ? $\endgroup$ – Mr Jedi Dec 9 '13 at 12:04

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.