MATLAB Answers

Data segmentation for Accelerometer time series data

44 ビュー (過去 30 日間)
Manas Gupte
Manas Gupte 2017 年 11 月 30 日
回答済み: Chris Turnes 2018 年 2 月 2 日
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 件のコメント

表示 7 件の古いコメント
Kaushik Lakshminarasimhan
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
Star Strider 2017 年 11 月 30 日
We need discrete sampling times.
We should not have to guess.
Manas Gupte
Manas Gupte 2017 年 12 月 3 日
@Star Strider&@Kaushik Lakshminarasimhan Sorry guys! Didn't have a net connection for the past two days. The fourth column is the time stamp. The data file information reads that the minimum delay between observations is 2ms. I'm a beginner in signal processing. I'm assuming that this could be treated as the sampling frequency (2ms=500Hz)? The data points enclosed by the two set of blue vertical lines are the part of the time series that I want to segment. The initial spikes are from acceleration of the wheel chair. The ones within the blue lines are from the wheelchair going up a .75in step and the second one if from the wheelchair going down the step. I used a manual wheelchair to collect the data.

サインイン to comment.

回答 (2 件)

Philipp Doblhofer
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)

  0 件のコメント

サインイン to comment.


Chris Turnes
Chris Turnes 2018 年 2 月 2 日
For the segmentation, if you have R2017b, the new ischange function should help to separate the events.

  0 件のコメント

サインイン to comment.

サインイン してこの質問に回答します。


Translated by