How to campare signals with different length?

13 次查看(过去 30 天)
Hi
Can someone help me out please? If I have a set of signals with different length. How can I compare them with the reference one and get the similarity or kind of correlation.
For example I have a reference signal with 75 samples. 10 signals with different length between 65 to 80. I would like to use those 10 signals to compare with the reference one by one and see how similar they are.
I know the correlation if I have the signals with the same length but I am confusing about how to do it with the different length signals. I have a roughly idea is make those 10 signals shifting from left to right of reference signal but I dont know which output should I do to compare the similarity.
Thanks for your help!
Best Regards

采纳的回答

Star Strider
Star Strider 2022-4-27
One option may be the Signal Processing Toolbox findsignal function (introduced in R2016b). The signal lengths are not important.
The function also produces a third output that is the Euclidean distance between the two signals, so that will be a measure of their similarity.
  4 个评论
BoWen Han
BoWen Han 2022-5-2
Thanks for your help! I will look into it. Thanks for all your suggest xd

请先登录,再进行评论。

更多回答(1 个)

Jan
Jan 2022-4-27
It depends.
You can compare two sine waves, if one has 80 and the other one 75 samples. But how do you define "similarity"? You can shift the phase, interpolate to change the frequency, shift the signal up and down and amplify the values until the curves are matching. But are they more similar, if you have to adjust only the phase or only the amplitude?
How similar are two sin waves, if the second one equals the first one plus some noise?
Before you can implement this in Matlab, you have to define mathematically (or even better physically), what you want to compare. Otherwise the results are arbitrary:
What is the difference between a blackbird? - Both legs have the same length, especially the right one.
  1 个评论
BoWen Han
BoWen Han 2022-5-2
Thanks for your help and sorry for late reply. Yeah this is the point I am struggling how to define the 'similarity'. I have some results now but it is hard to say how the result can present similarity.
Thank you

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Measurements and Feature Extraction 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by