2

Using a custom sensor that I built, I collected pressure sensor information of a the human gait cycle (how the pressure varies when a person walks) from a person's right foot. One of the things I want to do is break up each signal into individual steps taken by the right foot. I have a couple of sensors on the sole of the foot, but the most important one is the heel sensor since I am using that as the means of understanding the start and end of each step. This is done by looking at all the peaks of the heel sensor (since a step in my case is defined as the stuff that happens between two consecutive heel strikes). However, because it is difficult to walk with each step consistently at the same speed, some steps tend to be slightly longer or shorter than others.

This brings me to the question at hand. I want to warp each step so that they are all exactly the same length (i.e. I want to warp each step to take the same amount of time), but I'm not exactly sure what the best approach is. Can anyone advise me how I can process this single signal, and modify each step so that they are all equal lengths.

GobiasKoffi
  • 4,014
  • 14
  • 59
  • 66

2 Answers2

3

Sounds like resampling would be your best bet. Say you define a reference number of samples, say 1024, and you want vectors of length 1024 for each step (or, alternately, they could be columns in a matrix of height 1024). Then, for each input vector x, you could use the command

resample(x, 1024, length(x))

You'll need to have a high enough original sampling rate for the interpolation to work. You could also play around with the resample parameters; look at the documentation. Hope this helps!

btown
  • 2,273
  • 3
  • 27
  • 38
2

As shown by @btown, interpolation is the easiest way to go.

As alternative solution, and given a reference signal (say a recording of one step at normal speed), you can apply Dynamic Time Warping (DTW) technique to warp all sequences so that their speed match that of the reference signal.

You can find a number of implementations on FEX:

alt text

Community
  • 1
  • 1
Amro
  • 123,847
  • 25
  • 243
  • 454
  • Each step only consists of 10-15 data points. Is it still possible to perform DTW with a small handful of points? – GobiasKoffi Nov 11 '10 at 06:22
  • no reason why you can't, DTW works for any two signals (regardless of their lengths) – Amro Nov 11 '10 at 06:55