Fast moving average

A fast implementation of the moving average filter for long kernels.

您现在正在关注此提交

In terms of behavior, this is an alternative to filter() for a moving-average kernel. The running time does not grow with filter length beyond N=500.

The code uses a variant of the cumsum-trick, although not the "garden variety" but in a way that does not run into numerical issues for long data arrays.

The function is suitable for incremental (online) processing.

引用格式

Christian Kothe (2026). Fast moving average (https://ww2.mathworks.cn/matlabcentral/fileexchange/34567-fast-moving-average), MATLAB Central File Exchange. 检索时间: .

致谢

启发作品: downsample_ts

类别

Help CenterMATLAB Answers 中查找有关 Signal Processing Toolbox 的更多信息

一般信息

MATLAB 版本兼容性

  • 兼容任何版本

平台兼容性

  • Windows
  • macOS
  • Linux
版本 已发布 发行说明 Action
1.2.0.0

The N<500 case is now correctly implemented... (had a dumb error before)

1.1.0.0

Fixed an issue pointed out by Jan Simon (failed to determine along which dimension to filter when the signal was a scalar) and updated the docs.

1.0.0.0