Accelerometer signal segmentation -

i have 1d accelerometer signal (one axis only). create robust algorithm, able recognize shapes in signal.
at first apply moving average filter raw signal. on attached picture raw signal coloured red , averaged signal black. seen picture, trends visible averaged (black) signal - signal contains 10 repetitions of peak pattern, acceleration climbs maximum , drops down. have marked beginnings , endings of patterns cross.
so goal find marked positions automatically. problem making pattern extraction difficult are:
- the start of pattern have different y value end of pattern
- the pattern have more 1 peak
- i not have concrete time information (from start end of pattern takes time units)
i have tried different approaches, pretty home-brew, won't mention them - don't want biased way of thinking. there standard or books approaches doing kind of pattern extraction? or maybe know how tackle problem in robust way?
any idea appreciated.
keep simple!
appears moving average enough damper device; keep as-is, maybe increasing or decreasing sample count if notice either leaves noise or removes signal respectively. work off averaged signal exclusively.
the pattern markers seek seems relatively easy detect. expressed in english, these markers are:
targets = points of inflection in averaged readings curve, when slope goes markedly negative positive.
should therefore able detect situation comparison of slope values, calculated along moving average, each new reading value comes available (of course short delay, of course slope @ given point can calculated when averaged reading next [few] point[s] available)
to avoid false detection, however, you'd need define few parameters aimed @ filtering undesirable patterns. these paremeters define more precisely meaning of "markedly" in above target definition.
tentatively formula detecting point of interest simple this
(-1 * s(t-1) + st ) > min_delta_slope
where
s slope (more on this) @ time t-1 , t, respectively
min_delta_slope parameter defining how "sharp" change in slope want @ minimum.
assuming normalized t , y units, can set min_delta_slope parameter close or past 1. intuitively value of 1 (again in normalized units) indicate target points curved "arrived" downward slope of 50% , left point upward slope of 50% (or 40% + 60% or .. 10% i.e flat , 90% i.e. vertical).
avoid detecting points in case when merely small dip in curve, can take more points consideration, fancier formula such say
(pm2 * s(t-2) + pm1 * s(t-1) + p0 * st + pp1 s(t+1) ) > min_delta_slope
where
pm2, pm1, p0 , pp1 coefficients giving relative importance slope @ various point before , after point of interest. (pm2 , pm1 typically negative values unless use positive parameter , use negative signs in formula)
st +/- n slope various times
, min_delta_slope parameter defining how "sharp" change in slope want @ minimum.
intuitively, 4 points formula take account shape of curve @ point 2 readings prior , 2 reading past point of interest (in addition considering point right before , after it). given proper values parameters, formula require curve steadily coming "down" 2 time slices, steadily going next 2 time slices, hence avoiding mark smaller dips in curve.
alternative way achieve this, may compute slope using difference in y value between [averaged] reading two (or more) time slices ago , of current [averaged] reading. these 2 approaches similar produce different result; we'd have more on desired shape of curve pm2, pm1, p0 , p1 parameters.
Comments
Post a Comment