フィルターのクリア

How to remove outliers without using filter?

5 ビュー (過去 30 日間)
Nik Rocky
Nik Rocky 2020 年 12 月 14 日
コメント済み: KALYAN ACHARJYA 2020 年 12 月 14 日
Hello,
I have a measure results and there are some random outliers with a big negative or positive values (jitter of uC), there are just random, single values, outliers have a similar value.
So, I want to eliminate this values (just take the same value from left or linear interpolation value ((k-1)+(k+1))/2).
My question is, how to detect this values without using medfilt or filloutliers?
In this case outlier is by motor 3, at 48. sec (negative peak).
Array is in attachement. Thank you!
Yellow peak at 4,8 sek
If I use:
FX = gradient(v3);
I get:
0,209265176669710
0,236204049673113
0,549647683628642
-0,0127194313868060
-0,452682745464152
-0,605877560385565
-1,42706647302949
-35,9107931304111
0,321110515084925 -< this is a position of outlier
36,0098773311071
1,55432187084153
0,329500733819600
-1,10153727341736
-0,535656388090509
0,222372662282162
-0,349206720356847

採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2020 年 12 月 14 日
編集済み: KALYAN ACHARJYA 2020 年 12 月 14 日
Use diff function, more details
result=diff(data);
You will get a large variation in such cases (Use threshold to get the indecies), hope I understand your question.
  2 件のコメント
Nik Rocky
Nik Rocky 2020 年 12 月 14 日
Thank you very much! It works!
Here is solution:
res1 = find(diff(v1)>20); %find index of outlier
v1(res1)=rdivide((v1(res1-1))+(v1(res1+1)),2); %enter a mean value from left and right
KALYAN ACHARJYA
KALYAN ACHARJYA 2020 年 12 月 14 日
:)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDigital Filtering についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by