Data segmentation for Accelerometer time series data
이전 댓글 표시

I have time series data collected from a cellphone accelerometer sampled at 500Hz. The data is collected from the phone of a wheelchair user as he goes over a platform of a certain thickness. The abrupt change in height causes spikes in the data stream which is the event. Each sample has two events, the user going up the platform and when he comes down the platform. What would be a good way to filter noise and perform data segmentation?
댓글 수: 10
kowshik Thopalli
2017년 11월 30일
can you share an example data file?
Manas Gupte
2017년 11월 30일
Star Strider
2017년 11월 30일
What data do each of the 4 columns represent?
What are the data you want us to look at?
kowshik Thopalli
2017년 11월 30일
Star strider- The columns are X,Y,Z and time taken from previous samples respectively. I think Manas wants to see the Z data,because he plotted the data(:,3) and attached the figure
Star Strider
2017년 11월 30일
So this is a duplicate Question?
kowshik Thopalli
2017년 11월 30일
편집: kowshik Thopalli
2017년 11월 30일
I dont know if this is a duplicate question. Manas's profile https://www.mathworks.com/matlabcentral/answers/?term=asked_by_id%253A217739 says it is not.
Star Strider
2017년 11월 30일
The fourth column does not make sense as a time vector. We need to know the sampling frequency or sampling times. That most of them are sampled at 2 ms makes the data impossible to analyse. They have to be sampled at discrete times.
Kaushik Lakshminarasimhan
2017년 11월 30일
편집: Kaushik Lakshminarasimhan
2017년 11월 30일
@Star: I guess the fourth column is dt, so t = cumsum(data(:,4)).
@Manas: Which abrupt changes are you referring to? There is an abrupt increase around the fifth column of the grid, and then a much larger increase in the 9th column. Is the latter what you call noise? And what are those blue vertical lines?
Star Strider
2017년 11월 30일
We need discrete sampling times.
We should not have to guess.
Manas Gupte
2017년 12월 3일
답변 (2개)
Philipp Doblhofer
2017년 12월 29일
Hello,
one simple option is to set a threshold value for the signal power of your data. To reduce the noise level you can apply for example a moving average filter.

close all
clc
data=csvread('acc', 26, 0);
% Width of the moving average window (filter)
window_width = 50;
% Threshold level for the signal energy
threshold = 0.005;
% Remove constant offset from data and normalize
data(:,3) = data(:,3) - mean(data(:,3));
data(:,3) = data(:,3)/max(data(:,3));
% Calculate signal power
signal_power = data(:,3).^2;
% filtered data
filtered_signal_power = movmean(signal_power, window_width);
% event detection
event = filtered_signal_power > threshold;
plot(data(:,3))
hold on
plot(event)
Chris Turnes
2018년 2월 2일
0 개 추천
For the segmentation, if you have R2017b, the new ischange function should help to separate the events.
카테고리
도움말 센터 및 File Exchange에서 Time Series Events에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!