dividing signal into subsets

17 views (last 30 days)
neamah al-naffakh
neamah al-naffakh on 5 May 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.

Answers (2)

Image Analyst
Image Analyst on 5 May 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 Comment
neamah al-naffakh
neamah al-naffakh on 5 May 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?

Sign in to comment.


Image Analyst
Image Analyst on 5 May 2017
See attached demo.
  5 Comments
neamah al-naffakh
neamah al-naffakh on 8 May 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);

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!