フィルターのクリア

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

2 ビュー (過去 30 日間)
Abbas Atefi
Abbas Atefi 2017 年 7 月 24 日
回答済み: Chad Greene 2017 年 7 月 24 日
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