How can I find abrupt changes in a signal in MATLAB 2015b (32bit)?

1 次查看(过去 30 天)
Hi,
I need to find abrupt changes in a signal. I found "findchangepts" function in MATALB and it works in MATLAB 2017a (64 bit). For some reason, I should use MATLAB 2015b (32 bit). When I run the function, I got this error "Undefined function or variable 'findchangept'". It seems MATLAB 2015b (32bit) does not have this function. Do we have a similar function which can find abrupt changes in a signal in MATLAB 2015b(32bit)? Or does a way exist to use "findchangepts" function in MATLAB 2015b(32bit)?
I appreciate any help in advance.
Thank you,
Abbas

回答(1 个)

Chad Greene
Chad Greene 2017-7-24
Indeed, findchangepts is a Signal Processing Toolbox function that was introduced in 2016a. If you're simply looking for steps larger than some threshold, you can use diff, which tells you the difference between each element and the one before it. For example,
y = [1 2 3 200 201 200 2 1]
The step sizes using diff are
dy = [0 diff(y)]
dy =
0 1 1 197 1 -1 -198 -1
If you want to find every step bigger than 100,
changepoints = find(abs(dy)>100)
changepoints =
4 7
The fourth and seventh elements in y jumped or dropped by a magnitude of more than 100.

Community Treasure Hunt

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

Start Hunting!

Translated by