Borrar filtros
Borrar filtros

Normalize different size arrays to all be 100 points long with resample

31 visualizaciones (últimos 30 días)
I am trying to normalize gait data to the gait cycle for a bunch of subjects. Each subject has a different length gait cycle. For example, if one subject has 115 data points over the gait cycle, another has 150. All data is collected at the same frequency. I would like to normalize the data so I have 100 points over the gait cycle for every subject. This is done for 50 subjects, so I would like to be able to normalize without inputting how long the current data set is. I was trying to play around with the resample function but can't figure out how to get the parameters correct. Advice?

Respuesta aceptada

Star Strider
Star Strider el 27 de Sept. de 2019
Using resample (or any other interpolation method, although resample is best for signal processing applications) to get the same number of data for each subject risks having a different sampling frequency for each subject. This also means that any signal processing you do (such as filtering) would have to be individualised for each subject, as would subsequent data analysis. So I would advise against that.
You could likely do it by using the ‘p’ and ‘q’ parameters as the integer values of the actual and desired record lengths, since resample just needs those values to change the sampling frequency (and record length) of the argument vector. (It cares not one whit what the numbers actually represent.) However for the reasons I already mentioned, this is unadvisable.
Use cell arrays to store the varying-length records, with the same sampling frequency for all of them, and then use the same analytical techniques for every subject.
  4 comentarios
husnir nasyuha
husnir nasyuha el 9 de Mzo. de 2021
hi may is ask, what if the signals have different sampling rates?
Star Strider
Star Strider el 9 de Mzo. de 2021
husnir nasyuha — I would consider using resample first to get them all to have the same sampling frequency, the do the rest as explained here. Understand the hazards involved in doing that, though.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by