1
$\begingroup$

I am studying the applications of finding coherence in the frequency spectrum between two signals for pattern recognition. I have a recording that is way longer than the sampled signal that I want to compare. However, MATLAB only allows cpsd and mscohere between vectors with the same length. I figured that there must be a good reason for that, but I could not find it.

Also, I was digging through the math of the procedure and I figure that I could do a crosscorrelation between the two (although it would be raw, i.e., not unbiased), and then apply the Fourier transform to obtain the correlated frequencies. Do you think it is sound or make sense to do such a thing?

$\endgroup$
0
$\begingroup$

The calculations are done in the frequency domain using pairs of FFT's which is why the vectors need to be the same length. You could truncate the longer vector to the length of the shorter. If the longer is much longer, you could select multiple (different) truncated segments.

You can do things in the time domain like cross correlation, but mscohere and cpsd average (the default of 8 segments). A single crosscorrelation isn't equivalent.

When reading "does it make sense" (you're not the only one who asks), Internally, I think this is a lack of confidence and I don't want to discourage this person from trying, but this is whacko . Try it. MATLAB is easy. It's designed to explore the whacko.

$\endgroup$

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.