I have a set of signals of varying lengths. I have provided an example of the same below - enter image description here

Their lengths vary between 186 to 202, with a mean length of 197. I am looking to rescale them to the mean length. I am looking for ideas to do the same. Perhaps a good start will be reinterpolation, but I am open to other approaches too.

  • $\begingroup$ Are you sure the signals are actually stretched/clinched in time domain? Maybe they are just shifted and it would suffice to align (and then possible truncate) them. Have you tried aligning the maxima manually and then plotting them one over the other? $\endgroup$ – Florian Jul 19 '19 at 15:12
  • $\begingroup$ @Florian I know that these signals have different lengths. Manual peak alignment is an answer but I was looking for an automated way to do the same. $\endgroup$ – DGT Jul 19 '19 at 15:15
  • $\begingroup$ you could try dynamic time warping $\endgroup$ – user28715 Jul 19 '19 at 16:08
  • $\begingroup$ Do you need to scale them in amplitude as well? $\endgroup$ – Laurent Duval Jul 19 '19 at 16:11
  • $\begingroup$ @StanleyPawlukiewicz I already tried that. The problem with DTW is that it has a time complexity that doesn't allow me to use large datasets with my current computational resources. $\endgroup$ – DGT Jul 19 '19 at 16:11

If you really want to scale data, you can look at the scale transform, detailed in The scale representation, L. Cohen, 1993. There also exists a time-scaling method given in A. Papoulis, "Signal Analysis", McGraw-Hill, p. 290, 1977; one Matlab/Scilab/Octave implementation is provided in the DiscreteTFDs toolbox by Jeffrey C. O'Neill.For the latter, you just have to provide a scaling factor proportional to the inverse of the signal's length.

However, in the same line as @Florian, and looking at the signals, I would be more prone to 1) find the maxima at fractional steps through interpolation (eg Quadratic Interpolation of Spectral Peaks) 2) realign with fractional filters (Splitting the unit delay: tools for fractional filter design) 3) truncate signals.

| improve this answer | |

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.