How to campare signals with different length?

36 visualizaciones (últimos 30 días)
BoWen Han
BoWen Han el 27 de Abr. de 2022
Comentada: Star Strider el 2 de Mayo de 2022
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

Respuesta aceptada

Star Strider
Star Strider el 27 de Abr. de 2022
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 comentarios
BoWen Han
BoWen Han el 2 de Mayo de 2022
Thanks for your help! I will look into it. Thanks for all your suggest xd
Star Strider
Star Strider el 2 de Mayo de 2022
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (1)

Jan
Jan el 27 de Abr. de 2022
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 comentario
BoWen Han
BoWen Han el 2 de Mayo de 2022
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

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by