# Reduce Signal Size to Compare Them

I have multiple experiments and each of them produce several ($k$ for example) binary signals; some artificial example next:

I have a metric to compare experiment results but I need vectors of equal size to do it.

The problem is that signal length can differ from one experiment to another so I need to reduce the signal dimension somehow.

What I tried/ideas:

1. Calculate area under each signal. Result is vector of dimension $k$. The problem is that this method cannot differentiate signals with the same area.
2. Split signal on $m$ bins and calculate an area in each bin. Result is a vector of dimension $k \times m$.
1. Take Fourier series coefficients. Result is vector of dimension $(a+b)\times k$. The problem is that the spectrum is too large and Fourier cannot work nice (am I correct?)
2. Some wavelet transforms (like Haar for example). But I don't understand how to do it correctly.

I will be grateful for advices or any method that can help me.

• Can you discrete the metric you already have? It can tell a lot about how you assess the similarity of signals. Shift, scale or factor invariance can be very important here Aug 2 '17 at 15:00
• "Can you discrete the metric you already have?", - it is specific biophysics metric and a bit complex :) In our previous model signals had equal sized and there were no problem but now signals can have different lengths. Aug 4 '17 at 13:14
• Sorry for the "discrete" in place of a "describe. I believe that even if complex, its description would be useful to slide from equal to unequal length Aug 8 '17 at 13:27

It seems your needs matches the Dynamic Time Warping algorithm.
You should try it as a metric to compare them.

The idea of changing the size is trickier as you may loose / change data which is important for your comparison.

Maybe what you should do is alter the "Distance" metric in the Dynamic Time Warping algorithm to something which suits your needs.

• As I understand DTW allow to compute similarity between signals but cant shrink the size of signal. Am i correct? Aug 4 '17 at 13:15
• You wanted a Metric to compare signals. So instead of shrinking one, you can use DTW to compare them even if they have different lengths.
– Royi
Aug 4 '17 at 13:57