shape similarity between two signals

How can I compare the shape similarity of two signals? corrcoef does not work, because two signals having exactly the same shape of different length tend to have a small coefficient.

 Accepted Answer

If the signals have different time bases, you'll have to align them first, then use corrcoef. To do that you could use either set operations, like intersect, or interpolation of some kind, in which case use interp1. Something like this:
ti = linspace(tmin,tmax,npts);
y1i = interp1(t1,y1,ti,'cubic');
y2i = interp1(t2,y2,ti,'cubic');
corrcoef(y1i,y2i);

1 Comment

Is there any other method for the comparison, such as in the frequency domain after some transformation?

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!