How to detect change in mean value of a signal

22 visualizaciones (últimos 30 días)
Danupon Subanapong
Danupon Subanapong el 28 de Jul. de 2019
Comentada: Steven Lord el 31 de Jul. de 2019
Hello!!!
I would like to ask for some help.
I am working with inputing a large number of time-series signals. Among these signals, there are some signals which the mean value has changed. I would ignore reading the signals which there is a change in mean value. I will give three examples of signal: 1) normal (without changing mean), 2) abrupt changing in mean value, and 3) linear changing in mean value. My goal is to detect signals which there is a change in mean and skip reading these signals.
Ps., I would like to set criteria that if the magnitude of change in mean is larger than 10,000, it will treat as there is a change of mean value. Lastly, the files of these three examples of signal are also attached.
1) Normal (✅ would like to input to matlab)
2) Abupt change (❌ do not want to input to matlab)
3) Linear change (❌ do not want to input to matlab)

Respuesta aceptada

Akira Agata
Akira Agata el 31 de Jul. de 2019
It may need to apply "smoothing" before detecting changes larger than 10,000. Looking at your data, ~2000 points movmean will clarify whether data contains changing point or not, as shown in the followign plot.
But, please note that ~2000 points moving mean will clean-up changes in short time (such as spilke noise). So, if some of your data contains such a short-time changes, you should consider some additional detection methods.
movmean.png

Más respuestas (2)

Jan
Jan el 28 de Jul. de 2019
Editada: Jan el 28 de Jul. de 2019
It is impossible to detect a change, if it occurs in the first or last few frames.
Ist there only 1 change of the mean? Then fit a line to the data and set a limit for the slope. If there can be more changes, fit a parabola or a polynomial of higher order to the data and check the factors.
Alternatively use findchangepts.
Is the sine wave with a frequency of about 4/100 the search data. Then you can filter it out at first to reduce the noise for the detection of a change in the mean.
  1 comentario
Danupon Subanapong
Danupon Subanapong el 29 de Jul. de 2019
Thank you so much for your suggestions. In some cases, there are more than 1 change of the mean. But the idea of fit a line is good. I will try this idea. If it works, I will inform you again.

Iniciar sesión para comentar.


dpb
dpb el 28 de Jul. de 2019
Editada: dpb el 28 de Jul. de 2019
The linear or similar trend is probably detectable as Jan says by fitting linear trend line and testing for nonzero slope..._IF_ the trend is something like your example and doesn't also include returning to the same or near same baseline...in that case you could have essentially zero overall slope with two trend lines buried inside.
I'd guess more robust would be to use windowing to compute means over the duration of the signal and compare those for stationarity--perhaps some preliminary smoothing might help, then again might not.
Which is the kind of thing as Jan recommends findchangepts does...I had not been aware it had been introduced to Signal Processing TB -- it's a fairly recent addition.
  2 comentarios
Danupon Subanapong
Danupon Subanapong el 29 de Jul. de 2019
"I'd guess more robust would be to use windowing to compute means over the duration of the signal and compare those for stationarity--perhaps some preliminary smoothing might help, then again might not."
I also think about this idea. I think this also might work. I will try both of your ideas. Thank you so much for your help.
Steven Lord
Steven Lord el 31 de Jul. de 2019
FYI, a couple releases after findchangepts was introduced in Signal Processing Toolbox we also added ischange to MATLAB itself.

Iniciar sesión para comentar.

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by