MATLAB Answers

K E
1

Faster sliding window statistics?

K E
さんによって質問されました 2016 年 10 月 13 日
最新アクティビティ K E
さんによって 編集されました 2016 年 10 月 14 日
I use slidefun to estimate statistics such as max, min, or RMS within a sliding window applied to a time series. It is very useful, but it can be slow if there are a lot of data points. Is there a faster sliding window routine out there? I didn't see any obvious candidates in the File Exchange, but would like to know if I missed any.

  0 件のコメント

サインイン to comment.

2 件の回答

Steven Lord
回答者: Steven Lord
2016 年 10 月 13 日
 採用された回答

If you're using release R2016a or later, consider using the moving statistics functions in MATLAB for at least min and max.
Depending on exactly what type of windows you're using, if you're using release R2016b storing your data in a timetable and using the retime function with an aggregation method is another potential option.

  1 件のコメント

K E
2016 年 10 月 14 日
On my machine: with movmin , 0.7s. With slidefun, 310s. This is really going to streamline a lot of work for me & my coworkers.

サインイン to comment.


Image Analyst
回答者: Image Analyst
2016 年 10 月 13 日

You can use these alternate functions. For mean, use conv(). For max, use imdilate(). For min use imerode(). Or the new moving stats functions Steve mentioned. They're all highly optimized. Whether they're faster than slidefun() is something you'll just have to check.

  1 件のコメント

K E
2016 年 10 月 14 日
Unfortunately I do not have the Image Processing Toolbox, but I am sure these would be faster.

サインイン to comment.



Translated by