dividing signal into subsets

5 visualizaciones (últimos 30 días)
neamah al-naffakh
neamah al-naffakh el 5 de Mayo de 2017
Comentada: neamah al-naffakh el 8 de Mayo de 2017
I have about 5 hours of the acceleration data for a particular user ( the collected data is real life data, which means I don't know what the user is doing at a particular time).
the dataset contains the time stamp in the first column and the acceleration data of 3 axes (X, Y, and Y) in the second, third, fourth columns respectively.
Time Stamp X Data Y Data Z Data
I would like to divide the data based on the user's activities (which is called Activity Recognition in order to make it easy for the classification).
For example, if the user is walking, extract his signal and store it in an array, if he is typing, the typing data will be extracted and store in another array, and so on. Hence, N number of arrays will be created, each will contain data of specific activity.
by the way, it doesn't matter what is the activity, it is more useful to extract the user's pattern for each part of the original signal ( pattern means, the user's signal looks consistent).
here is an example of the original signal for each axis
As we can see, the original signal looks very noisy ( as the user do more than one activity at the same day) therefore, I'd like to divide the signal into subsets based on the user's activity.
Note, the highlighted part in attached pics was just an example of walking data from the original signal. I know it's walking data because as we can see it contains repetitive peaks that normally generated when the user is walking
I have attached a sample of my data
really appreciate any help.
Regards.

Respuestas (2)

Image Analyst
Image Analyst el 5 de Mayo de 2017
You forgot to attach any data so people can't try anything. I'd be tempted to filter the data with movstd() and then threshold. The parts you indicated should have low standard deviation. You'll need to play around with the window size parameter to find out what window size is best for your particular data.
  1 comentario
neamah al-naffakh
neamah al-naffakh el 5 de Mayo de 2017
Dear Image Analyst,
I have attached a sample of my data, right now I don't have a clue how to get this done. could you please help me with that?

Iniciar sesión para comentar.


Image Analyst
Image Analyst el 5 de Mayo de 2017
See attached demo.
  5 comentarios
Image Analyst
Image Analyst el 6 de Mayo de 2017
Most of your code should still work with the new version, unless you've used some function deprecated long ago. You can't stay stuck in the past forever so I'd encourage you to upgrade.
You don't need xticks() so you can just remove it.
You say "I don't want to smooth the signal now!" But that's the way to identify the sections you want. To extract your original signal, save it then extract it
xAccel = xAccel(1 : lastIndex+1);
originalSignal = xAccel; % Save original, non smoothed, non filtered signal.
% Smooth it.
kernel = ones(1001, 1) / 1001;
xAccel = conv(xAccel, kernel, 'same');
Then at the end, extract it
extractedSignal = originalSignal(startingIndex : startingIndex);
neamah al-naffakh
neamah al-naffakh el 8 de Mayo de 2017
Dear Sir, thanks for your help. again i guess you still misunderstood the idea! first: the smothed data become flat! and i want to keep the pattern of the extracted part as it is !
Second: the output of this line of code is only one value? while I expect to get many rows and 4 columns ( time stamp, X, Y, Z)
extractedSignal = xAccel(startingIndex : startingIndex);

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by